Bug 1345768 - Fix build error in H264Converter.h/cpp; r=jwwang
authorKaku Kuo <kaku@mozilla.com>
Thu, 09 Mar 2017 16:06:55 +0800
changeset 394848 83b00af70efd663e9416f434d8b52ae120c0fe69
parent 394847 f7689bfb22d7828b70a9159403f5818ce6750366
child 394849 cc4a644b213693a55f9bf545e2f9cc8288e7cd0b
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwwang
bugs1345768
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1345768 - Fix build error in H264Converter.h/cpp; r=jwwang MozReview-Commit-ID: IOH5jZyQwZi
dom/media/platforms/wrappers/H264Converter.cpp
dom/media/platforms/wrappers/H264Converter.h
--- a/dom/media/platforms/wrappers/H264Converter.cpp
+++ b/dom/media/platforms/wrappers/H264Converter.cpp
@@ -1,22 +1,24 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/TaskQueue.h"
 
+#include "DecoderDoctorDiagnostics.h"
 #include "H264Converter.h"
 #include "ImageContainer.h"
 #include "MediaInfo.h"
 #include "MediaPrefs.h"
 #include "mp4_demuxer/AnnexB.h"
 #include "mp4_demuxer/H264.h"
+#include "PDMFactory.h"
 
 namespace mozilla
 {
 
 H264Converter::H264Converter(PlatformDecoderModule* aPDM,
                              const CreateDecoderParams& aParams)
   : mPDM(aPDM)
   , mOriginalConfig(aParams.VideoConfig())
@@ -265,16 +267,24 @@ H264Converter::OnDecoderInitFailed(const
 {
   mInitPromiseRequest.Complete();
   mDecodePromise.Reject(
     MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
                 RESULT_DETAIL("Unable to initialize H264 decoder")),
     __func__);
 }
 
+bool
+H264Converter::CanRecycleDecoder() const
+{
+  MOZ_ASSERT(mDecoder);
+  return MediaPrefs::MediaDecoderCheckRecycling()
+         && mDecoder->SupportDecoderRecycling();
+}
+
 void
 H264Converter::DecodeFirstSample(MediaRawData* aSample)
 {
   if (mNeedKeyframe && !aSample->mKeyframe) {
     mDecodePromise.Resolve(DecodedData(), __func__);
     return;
   }
 
--- a/dom/media/platforms/wrappers/H264Converter.h
+++ b/dom/media/platforms/wrappers/H264Converter.h
@@ -7,16 +7,18 @@
 #ifndef mozilla_H264Converter_h
 #define mozilla_H264Converter_h
 
 #include "PlatformDecoderModule.h"
 #include "mozilla/Maybe.h"
 
 namespace mozilla {
 
+class DecoderDoctorDiagnostics;
+
 // H264Converter is a MediaDataDecoder wrapper used to ensure that
 // only AVCC or AnnexB is fed to the underlying MediaDataDecoder.
 // The H264Converter allows playback of content where the SPS NAL may not be
 // provided in the init segment (e.g. AVC3 or Annex B)
 // H264Converter will monitor the input data, and will delay creation of the
 // MediaDataDecoder until a SPS and PPS NALs have been extracted.
 
 class H264Converter : public MediaDataDecoder
@@ -71,22 +73,17 @@ private:
   nsresult CreateDecoder(DecoderDoctorDiagnostics* aDiagnostics);
   nsresult CreateDecoderAndInit(MediaRawData* aSample);
   nsresult CheckForSPSChange(MediaRawData* aSample);
   void UpdateConfigFromExtraData(MediaByteBuffer* aExtraData);
 
   void OnDecoderInitDone(const TrackType aTrackType);
   void OnDecoderInitFailed(const MediaResult& aError);
 
-  bool CanRecycleDecoder() const
-  {
-    MOZ_ASSERT(mDecoder);
-    return MediaPrefs::MediaDecoderCheckRecycling()
-           && mDecoder->SupportDecoderRecycling();
-  }
+  bool CanRecycleDecoder() const;
 
   void DecodeFirstSample(MediaRawData* aSample);
 
   RefPtr<PlatformDecoderModule> mPDM;
   const VideoInfo mOriginalConfig;
   VideoInfo mCurrentConfig;
   RefPtr<layers::KnowsCompositor> mKnowsCompositor;
   RefPtr<layers::ImageContainer> mImageContainer;