LCOV - code coverage report
Current view: top level - dom/media/webm - WebMWriter.h (source / functions) Hit Total Coverage
Test: output.info Lines: 0 2 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 4 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
       2             : /* This Source Code Form is subject to the terms of the Mozilla Public
       3             :  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
       4             :  * You can obtain one at http://mozilla.org/MPL/2.0/. */
       5             : 
       6             : #ifndef WebMWriter_h_
       7             : #define WebMWriter_h_
       8             : 
       9             : #include "ContainerWriter.h"
      10             : #include "nsAutoPtr.h"
      11             : 
      12             : namespace mozilla {
      13             : 
      14             : class EbmlComposer;
      15             : 
      16             : // Vorbis meta data structure
      17             : class VorbisMetadata : public TrackMetadataBase
      18             : {
      19             : public:
      20             :   nsTArray<uint8_t> mData;
      21             :   int32_t mChannels;
      22             :   float mSamplingFrequency;
      23             :   MetadataKind GetKind() const override { return METADATA_VORBIS; }
      24             : };
      25             : 
      26             : // VP8 meta data structure
      27           0 : class VP8Metadata : public TrackMetadataBase
      28             : {
      29             : public:
      30             :   int32_t mWidth;
      31             :   int32_t mHeight;
      32             :   int32_t mDisplayWidth;
      33             :   int32_t mDisplayHeight;
      34           0 :   MetadataKind GetKind() const override { return METADATA_VP8; }
      35             : };
      36             : 
      37             : /**
      38             :  * WebM writer helper
      39             :  * This class accepts encoder to set audio or video meta data or
      40             :  * encoded data to ebml Composer, and get muxing data through GetContainerData.
      41             :  * The ctor/dtor run in the MediaRecorder thread, others run in MediaEncoder thread.
      42             :  */
      43             : class WebMWriter : public ContainerWriter
      44             : {
      45             : public:
      46             :   // aTrackTypes indicate this muxer should multiplex into Video only or A/V foramt.
      47             :   // Run in MediaRecorder thread
      48             :   explicit WebMWriter(uint32_t aTrackTypes);
      49             :   virtual ~WebMWriter();
      50             : 
      51             :   // WriteEncodedTrack inserts raw packets into WebM stream.
      52             :   nsresult WriteEncodedTrack(const EncodedFrameContainer &aData,
      53             :                              uint32_t aFlags = 0) override;
      54             : 
      55             :   // GetContainerData outputs multiplexing data.
      56             :   // aFlags indicates the muxer should enter into finished stage and flush out
      57             :   // queue data.
      58             :   nsresult GetContainerData(nsTArray<nsTArray<uint8_t> >* aOutputBufs,
      59             :                             uint32_t aFlags = 0) override;
      60             : 
      61             :   // Assign metadata into muxer
      62             :   nsresult SetMetadata(TrackMetadataBase* aMetadata) override;
      63             : 
      64             : private:
      65             :   nsAutoPtr<EbmlComposer> mEbmlComposer;
      66             : 
      67             :   // Indicate what kind of meta data needed in the writer.
      68             :   // If this value become 0, it means writer can start to generate header.
      69             :   uint8_t mMetadataRequiredFlag;
      70             : };
      71             : 
      72             : } // namespace mozilla
      73             : 
      74             : #endif

Generated by: LCOV version 1.13