Bug 1400537 - P2. Pass video framerate to decoder. r?gerald
Continuation on
bug 1397307 which was incomplete.
MozReview-Commit-ID: JGGHQyjnALI
--- 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