Bug 1497951 - P7. Check for in-band profile VP9 change, r=bryce

Because why not...

Depends on D10913

Differential Revision: https://phabricator.services.mozilla.com/D10914

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jean-Yves Avenard 2018-11-07 13:50:15 +00:00
parent 6aea43ac23
commit bb55747b9e

View File

@ -166,17 +166,22 @@ public:
return NS_OK;
}
auto dimensions = VPXDecoder::GetFrameSize(
MakeSpan<const uint8_t>(aSample->Data(), aSample->Size()), mCodec);
auto dataSpan = MakeSpan<const uint8_t>(aSample->Data(), aSample->Size());
auto dimensions = VPXDecoder::GetFrameSize(dataSpan, mCodec);
int profile = mCodec == VPXDecoder::Codec::VP9
? VPXDecoder::GetVP9Profile(dataSpan)
: 0;
if (!mSize) {
mSize = Some(dimensions);
mProfile = Some(profile);
return NS_OK;
}
if (mSize.ref() == dimensions) {
if (mSize.ref() == dimensions && mProfile.ref() == profile) {
return NS_OK;
}
mSize = Some(dimensions);
mProfile = Some(profile);
mCurrentConfig.mDisplay = dimensions;
return NS_ERROR_DOM_MEDIA_NEED_NEW_DECODER;
@ -197,6 +202,7 @@ public:
VideoInfo mCurrentConfig;
const VPXDecoder::Codec mCodec;
Maybe<gfx::IntSize> mSize;
Maybe<int> mProfile;
};
MediaChangeMonitor::MediaChangeMonitor(PlatformDecoderModule* aPDM,