WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
156020
[WinCairo][MediaFoundation] Video size is not always set.
https://bugs.webkit.org/show_bug.cgi?id=156020
Summary
[WinCairo][MediaFoundation] Video size is not always set.
peavo
Reported
2016-03-30 03:59:02 PDT
This happens because getting the video display control from the media session might fail the first time. If it fails the first time, we should try again later.
Attachments
Patch
(3.88 KB, patch)
2016-03-30 04:07 PDT
,
peavo
darin
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
peavo
Comment 1
2016-03-30 04:07:22 PDT
Created
attachment 275192
[details]
Patch
Darin Adler
Comment 2
2016-03-30 09:01:18 PDT
Comment on
attachment 275192
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=275192&action=review
> Source/WebCore/ChangeLog:9 > + Getting the video display control object from the media session might fail the first time. > + In case it fails, we should try again when setting the video size.
Is keeping the video display control object an important optimization? Maybe we should just get it every time.
> Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:353 > + COMPtr<IMFVideoDisplayControl> videoDisplay = getVideoDisplay();
Probably a little nicer to use auto here.
> Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:778 > + if (FAILED(MFGetServicePtr()(m_mediaSession.get(), MR_VIDEO_RENDER_SERVICE, IID_PPV_ARGS(&m_videoDisplay)))) > + return nullptr; > + > + return m_videoDisplay;
Checking FAILED explicitly here means we don’t trust that m_videoDisplay will be nullptr if the function calls. We check FAILED and explicitly return nullptr rather than just returning m_videoDisplay, which will be nullptr. But when this function is called again, whatever is stored in m_videoDisplay *will* be trusted. So we should omit the FAILED check since it does us no good.
> Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:794 > + COMPtr<IMFVideoDisplayControl> videoDisplay = getVideoDisplay(); > + if (videoDisplay) {
Would read nicer with auto and nesting the assignment in the if statement. if (auto videoDisplay = this->videoDisplay()) {
> Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:138 > + COMPtr<IMFVideoDisplayControl> getVideoDisplay();
In WebKit coding style we do not use “get” in the names of functions like this one unless they produce values through "out arguments". We can either just call this videoDisplay or use some verb other than “get”.
peavo
Comment 3
2016-03-30 11:37:46 PDT
Thanks for reviewing!
peavo
Comment 4
2016-03-30 11:39:25 PDT
Committed
r198848
: <
http://trac.webkit.org/changeset/198848
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug