Bug 1400537 - P2. Pass video framerate to decoder. r?gerald draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Sun, 17 Sep 2017 18:06:47 +0200
changeset 666070 5769635fa4fc9f639170f6f56da4556e2b930620
parent 666069 f62d02d732d6aec3278d65ed00003f3804131176
child 666826 1f21f337e375e9de3498db318e20c109d8c67712
push id80264
push userbmo:jyavenard@mozilla.com
push dateSun, 17 Sep 2017 16:07:26 +0000
reviewersgerald
bugs1400537, 1397307
milestone57.0a1
Bug 1400537 - P2. Pass video framerate to decoder. r?gerald Continuation on bug 1397307 which was incomplete. MozReview-Commit-ID: JGGHQyjnALI
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
@@ -27,16 +27,17 @@ H264Converter::H264Converter(PlatformDec
   , mImageContainer(aParams.mImageContainer)
   , mTaskQueue(aParams.mTaskQueue)
   , mDecoder(nullptr)
   , mGMPCrashHelper(aParams.mCrashHelper)
   , mLastError(NS_OK)
   , mType(aParams.mType)
   , mOnWaitingForKeyEvent(aParams.mOnWaitingForKeyEvent)
   , mDecoderOptions(aParams.mOptions)
+  , mRate(aParams.mRate)
 {
   mLastError = CreateDecoder(mOriginalConfig, aParams.mDiagnostics);
   if (mDecoder) {
     MOZ_ASSERT(mp4_demuxer::H264::HasSPS(mOriginalConfig.mExtraData));
     // The video metadata contains out of band SPS/PPS (AVC1) store it.
     mOriginalExtraData = mOriginalConfig.mExtraData;
   }
 }
@@ -273,16 +274,17 @@ H264Converter::CreateDecoder(const Video
     mTaskQueue,
     aDiagnostics,
     mImageContainer,
     mKnowsCompositor,
     mGMPCrashHelper,
     mType,
     mOnWaitingForKeyEvent,
     mDecoderOptions,
+    mRate,
     &error
   });
 
   if (!mDecoder) {
     if (NS_FAILED(error)) {
       // The decoder supports CreateDecoderParam::mError, returns the value.
       return error;
     } else {
--- a/dom/media/platforms/wrappers/H264Converter.h
+++ b/dom/media/platforms/wrappers/H264Converter.h
@@ -99,14 +99,15 @@ private:
 
   RefPtr<GMPCrashHelper> mGMPCrashHelper;
   Maybe<bool> mNeedAVCC;
   MediaResult mLastError;
   bool mNeedKeyframe = true;
   const TrackInfo::TrackType mType;
   MediaEventProducer<TrackInfo::TrackType>* const mOnWaitingForKeyEvent;
   const CreateDecoderParams::OptionSet mDecoderOptions;
+  const CreateDecoderParams::VideoFrameRate mRate;
   Maybe<bool> mCanRecycleDecoder;
 };
 
 } // namespace mozilla
 
 #endif // mozilla_H264Converter_h