зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1358662 - Store LastSeenFrame dimensions as an nsIntSize. r=jya
This simplifies the comparison and update logic. MozReview-Commit-ID: A6YII8tlEUn --HG-- extra : rebase_source : e225b34f91e12591d5872121e024ef29c63a11e0
This commit is contained in:
Родитель
76892628f3
Коммит
9032567bba
|
@ -692,16 +692,14 @@ WebMDemuxer::GetNextPacket(TrackInfo::TrackType aType,
|
|||
if (isKeyframe) {
|
||||
// We only look for resolution changes on keyframes for both VP8 and
|
||||
// VP9. Other resolution changes are invalid.
|
||||
if (mLastSeenFrameWidth.isSome()
|
||||
&& mLastSeenFrameHeight.isSome()
|
||||
&& (si.w != mLastSeenFrameWidth.value()
|
||||
|| si.h != mLastSeenFrameHeight.value())) {
|
||||
mInfo.mVideo.mDisplay = nsIntSize(si.w, si.h);
|
||||
auto dimensions = nsIntSize(si.w, si.h);
|
||||
if (mLastSeenFrameSize.isSome()
|
||||
&& (dimensions != mLastSeenFrameSize.value())) {
|
||||
mInfo.mVideo.mDisplay = dimensions;
|
||||
mSharedVideoTrackInfo =
|
||||
new TrackInfoSharedPtr(mInfo.mVideo, ++sStreamSourceID);
|
||||
}
|
||||
mLastSeenFrameWidth = Some(si.w);
|
||||
mLastSeenFrameHeight = Some(si.h);
|
||||
mLastSeenFrameSize = Some(dimensions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -257,8 +257,7 @@ private:
|
|||
int64_t mLastWebMBlockOffset;
|
||||
const bool mIsMediaSource;
|
||||
|
||||
Maybe<uint32_t> mLastSeenFrameWidth;
|
||||
Maybe<uint32_t> mLastSeenFrameHeight;
|
||||
Maybe<nsIntSize> mLastSeenFrameSize;
|
||||
// This will be populated only if a resolution change occurs, otherwise it
|
||||
// will be left as null so the original metadata is used
|
||||
RefPtr<TrackInfoSharedPtr> mSharedVideoTrackInfo;
|
||||
|
|
Загрузка…
Ссылка в новой задаче