Closed Bug 2070325 Opened 1 month ago Closed 26 days ago

Use FrameSource's own size in TestMediaDataEncoder GetFrame

Categories

(Core :: Audio/Video, defect, P5)

defect

Tracking

()

RESOLVED FIXED
159 Branch
Tracking Status
firefox159 --- fixed

People

(Reporter: chunmin, Assigned: corpus_e, Mentored)

Details

(Keywords: good-first-bug, Whiteboard: [lang=c++])

Attachments

(1 file, 1 external file)

In dom/media/gtest/TestMediaDataEncoder.cpp, the FrameSource test helper is initialized with a size through FrameSource::Init(aSize), which it stores in its mSize member. But FrameSource::GetFrame hardcodes the global kImageSize when building the frame's display size instead of using mSize:

RefPtr<MediaData> frame = VideoData::CreateFromImage(
    kImageSize, 0,
    ...

So a FrameSource created at any size other than kImageSize produces frames that report the wrong display size. For example, mData4K is initialized at kImageSize4K (3840x2160) but its frames still claim a 640x480 display size. Change kImageSize to mSize on that line so the helper reports the size it was actually initialized with.

Code: TestMediaDataEncoder.cpp:139

To verify, the encoder gtests should still pass: ./mach gtest 'MediaDataEncoderTest.*'

Contribution guides: contribution quickref and stack quickref.

Assignee: nobody → corpus_e
Status: NEW → ASSIGNED
Pushed by cchang@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/33f0b2b5d2ef https://hg.mozilla.org/integration/autoland/rev/a8d1eb56b6a1 Use FrameSource's own size in TestMediaDataEncoder GetFrame, r=media-playback-reviewers,chunmin
Status: ASSIGNED → RESOLVED
Closed: 26 days ago
Resolution: --- → FIXED
Target Milestone: --- → 159 Branch
QA Whiteboard: [qa-triage-done-c160/b159]
You need to log in before you can comment on or make changes to this bug.