LCOV - code coverage report
Current view: top level - dom/media/platforms/agnostic - VorbisDecoder.h (source / functions) Hit Total Coverage
Test: output.info Lines: 0 2 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 1 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             : /* vim:set ts=2 sw=2 sts=2 et cindent: */
       3             : /* This Source Code Form is subject to the terms of the Mozilla Public
       4             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       5             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
       6             : #if !defined(VorbisDecoder_h_)
       7             : #define VorbisDecoder_h_
       8             : 
       9             : #include "AudioConverter.h"
      10             : #include "PlatformDecoderModule.h"
      11             : #include "mozilla/Maybe.h"
      12             : 
      13             : #ifdef MOZ_TREMOR
      14             : #include "tremor/ivorbiscodec.h"
      15             : #else
      16             : #include "vorbis/codec.h"
      17             : #endif
      18             : 
      19             : namespace mozilla {
      20             : 
      21             : class VorbisDataDecoder : public MediaDataDecoder
      22             : {
      23             : public:
      24             :   explicit VorbisDataDecoder(const CreateDecoderParams& aParams);
      25             :   ~VorbisDataDecoder();
      26             : 
      27             :   RefPtr<InitPromise> Init() override;
      28             :   RefPtr<DecodePromise> Decode(MediaRawData* aSample) override;
      29             :   RefPtr<DecodePromise> Drain() override;
      30             :   RefPtr<FlushPromise> Flush() override;
      31             :   RefPtr<ShutdownPromise> Shutdown() override;
      32           0 :   const char* GetDescriptionName() const override
      33             :   {
      34           0 :     return "vorbis audio decoder";
      35             :   }
      36             : 
      37             :   // Return true if mimetype is Vorbis
      38             :   static bool IsVorbis(const nsACString& aMimeType);
      39             :   static const AudioConfig::Channel* VorbisLayout(uint32_t aChannels);
      40             : 
      41             : private:
      42             :   nsresult DecodeHeader(const unsigned char* aData, size_t aLength);
      43             :   RefPtr<DecodePromise> ProcessDecode(MediaRawData* aSample);
      44             : 
      45             :   const AudioInfo& mInfo;
      46             :   const RefPtr<TaskQueue> mTaskQueue;
      47             : 
      48             :   // Vorbis decoder state
      49             :   vorbis_info mVorbisInfo;
      50             :   vorbis_comment mVorbisComment;
      51             :   vorbis_dsp_state mVorbisDsp;
      52             :   vorbis_block mVorbisBlock;
      53             : 
      54             :   int64_t mPacketCount;
      55             :   int64_t mFrames;
      56             :   Maybe<int64_t> mLastFrameTime;
      57             :   UniquePtr<AudioConverter> mAudioConverter;
      58             : };
      59             : 
      60             : } // namespace mozilla
      61             : #endif

Generated by: LCOV version 1.13