LCOV - code coverage report
Current view: top level - dom/media/platforms/agnostic - AgnosticDecoderModule.cpp (source / functions) Hit Total Coverage
Test: output.info Lines: 0 28 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 3 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             : 
       7             : #include "AgnosticDecoderModule.h"
       8             : #include "OpusDecoder.h"
       9             : #include "TheoraDecoder.h"
      10             : #include "VPXDecoder.h"
      11             : #include "VorbisDecoder.h"
      12             : #include "WAVDecoder.h"
      13             : #include "mozilla/Logging.h"
      14             : 
      15             : #ifdef MOZ_AV1
      16             : #include "AOMDecoder.h"
      17             : #endif
      18             : 
      19             : namespace mozilla {
      20             : 
      21             : bool
      22           0 : AgnosticDecoderModule::SupportsMimeType(
      23             :   const nsACString& aMimeType,
      24             :   DecoderDoctorDiagnostics* aDiagnostics) const
      25             : {
      26             :   bool supports =
      27           0 :     VPXDecoder::IsVPX(aMimeType)
      28             : #ifdef MOZ_AV1
      29           0 :     || AOMDecoder::IsAV1(aMimeType)
      30             : #endif
      31           0 :     || OpusDataDecoder::IsOpus(aMimeType)
      32           0 :     || VorbisDataDecoder::IsVorbis(aMimeType)
      33           0 :     || WaveDataDecoder::IsWave(aMimeType)
      34           0 :     || TheoraDecoder::IsTheora(aMimeType);
      35           0 :   MOZ_LOG(sPDMLog, LogLevel::Debug, ("Agnostic decoder %s requested type",
      36             :         supports ? "supports" : "rejects"));
      37           0 :   return supports;
      38             : }
      39             : 
      40             : already_AddRefed<MediaDataDecoder>
      41           0 : AgnosticDecoderModule::CreateVideoDecoder(const CreateDecoderParams& aParams)
      42             : {
      43           0 :   RefPtr<MediaDataDecoder> m;
      44             : 
      45           0 :   if (VPXDecoder::IsVPX(aParams.mConfig.mMimeType)) {
      46           0 :     m = new VPXDecoder(aParams);
      47             :   }
      48             : #ifdef MOZ_AV1
      49           0 :   else if (AOMDecoder::IsAV1(aParams.mConfig.mMimeType)) {
      50           0 :     m = new AOMDecoder(aParams);
      51             :   }
      52             : #endif
      53           0 :   else if (TheoraDecoder::IsTheora(aParams.mConfig.mMimeType)) {
      54           0 :     m = new TheoraDecoder(aParams);
      55             :   }
      56             : 
      57           0 :   return m.forget();
      58             : }
      59             : 
      60             : already_AddRefed<MediaDataDecoder>
      61           0 : AgnosticDecoderModule::CreateAudioDecoder(const CreateDecoderParams& aParams)
      62             : {
      63           0 :   RefPtr<MediaDataDecoder> m;
      64             : 
      65           0 :   const TrackInfo& config = aParams.mConfig;
      66           0 :   if (VorbisDataDecoder::IsVorbis(config.mMimeType)) {
      67           0 :     m = new VorbisDataDecoder(aParams);
      68           0 :   } else if (OpusDataDecoder::IsOpus(config.mMimeType)) {
      69           0 :     m = new OpusDataDecoder(aParams);
      70           0 :   } else if (WaveDataDecoder::IsWave(config.mMimeType)) {
      71           0 :     m = new WaveDataDecoder(aParams);
      72             :   }
      73             : 
      74           0 :   return m.forget();
      75             : }
      76             : 
      77             : } // namespace mozilla

Generated by: LCOV version 1.13