mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-27 01:27:30 +09:00
[webm] Store LastSeenFrame dimensions as an nsIntSize
This simplifies the comparison and update logic.
This commit is contained in:
parent
d6206801dd
commit
e7d7e0d2bf
2 changed files with 6 additions and 8 deletions
|
|
@ -651,14 +651,13 @@ WebMDemuxer::GetNextPacket(TrackInfo::TrackType aType, MediaRawDataQueue *aSampl
|
||||||
if (isKeyframe) {
|
if (isKeyframe) {
|
||||||
// We only look for resolution changes on keyframes for both VP8 and
|
// We only look for resolution changes on keyframes for both VP8 and
|
||||||
// VP9. Other resolution changes are invalid.
|
// VP9. Other resolution changes are invalid.
|
||||||
if (mLastSeenFrameWidth.isSome() && mLastSeenFrameHeight.isSome() &&
|
auto dimensions = nsIntSize(si.w, si.h);
|
||||||
(si.w != mLastSeenFrameWidth.value() ||
|
if (mLastSeenFrameSize.isSome()
|
||||||
si.h != mLastSeenFrameHeight.value())) {
|
&& (dimensions != mLastSeenFrameSize.value())) {
|
||||||
mInfo.mVideo.mDisplay = nsIntSize(si.w, si.h);
|
mInfo.mVideo.mDisplay = dimensions;
|
||||||
mSharedVideoTrackInfo = new SharedTrackInfo(mInfo.mVideo, ++sStreamSourceID);
|
mSharedVideoTrackInfo = new SharedTrackInfo(mInfo.mVideo, ++sStreamSourceID);
|
||||||
}
|
}
|
||||||
mLastSeenFrameWidth = Some(si.w);
|
mLastSeenFrameSize = Some(dimensions);
|
||||||
mLastSeenFrameHeight = Some(si.h);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -237,8 +237,7 @@ private:
|
||||||
int64_t mLastWebMBlockOffset;
|
int64_t mLastWebMBlockOffset;
|
||||||
const bool mIsMediaSource;
|
const bool mIsMediaSource;
|
||||||
|
|
||||||
Maybe<uint32_t> mLastSeenFrameWidth;
|
Maybe<nsIntSize> mLastSeenFrameSize;
|
||||||
Maybe<uint32_t> mLastSeenFrameHeight;
|
|
||||||
// This will be populated only if a resolution change occurs, otherwise it
|
// This will be populated only if a resolution change occurs, otherwise it
|
||||||
// will be left as null so the original metadata is used
|
// will be left as null so the original metadata is used
|
||||||
RefPtr<SharedTrackInfo> mSharedVideoTrackInfo;
|
RefPtr<SharedTrackInfo> mSharedVideoTrackInfo;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue