Bug 174582 - [GTK] HTMLMediaElement resize event not fired when video size changes
Summary: [GTK] HTMLMediaElement resize event not fired when video size changes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nael Ouedraogo
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-07-17 08:10 PDT by Nael Ouedraogo
Modified: 2017-09-27 12:55 PDT (History)
7 users (show)

See Also:


Attachments
Patch (4.23 KB, patch)
2017-07-17 08:29 PDT, Nael Ouedraogo
no flags Details | Formatted Diff | Diff
Patch (4.24 KB, patch)
2017-07-17 09:00 PDT, Nael Ouedraogo
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews121 for ios-simulator-wk2 (11.74 MB, application/zip)
2017-07-17 11:32 PDT, Build Bot
no flags Details
Patch (10.41 KB, patch)
2017-09-22 01:39 PDT, Nael Ouedraogo
no flags Details | Formatted Diff | Diff
Patch (10.44 KB, patch)
2017-09-22 07:00 PDT, Nael Ouedraogo
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nael Ouedraogo 2017-07-17 08:10:23 PDT
[GTK] HTMLMediaElement resize event not fired when video size change.
Comment 1 Nael Ouedraogo 2017-07-17 08:29:40 PDT
Created attachment 315664 [details]
Patch
Comment 2 Nael Ouedraogo 2017-07-17 09:00:14 PDT
Created attachment 315667 [details]
Patch
Comment 3 Build Bot 2017-07-17 11:32:01 PDT
Comment on attachment 315667 [details]
Patch

Attachment 315667 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/4136505

New failing tests:
storage/websql/execute-sql-rowsAffected.html
Comment 4 Build Bot 2017-07-17 11:32:03 PDT
Created attachment 315684 [details]
Archive of layout-test-results from ews121 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews121  Port: ios-simulator-wk2  Platform: Mac OS X 10.12.5
Comment 5 Nael Ouedraogo 2017-07-18 01:36:25 PDT
Failing tests on ios-sim seems not related to this patch.
Comment 6 Enrique Ocaña 2017-09-05 03:32:40 PDT
This fix has a small problem: AppendPipeline::m_oldTrack and m_track aren't being currently updated on caps changes (and probably they shouldn't, that smells to legacy code). Anyway, as they're not updated, the code in MediaPlayerPrivateGStreamerMSE::trackDetected() will always call PlaybackPipeline::attachTrack() and never call reattachTrack() (the proper thing to do on caps changes). AttachTrack() creates a new stream bin in WebKitMediaSrc, and that's not good.

If reattachTrack() was called, the old stream bin would be reused, which is the right thing to happen.

Please, could you make it work in that way? Maybe you will need to change the signature of trackDetected() to signal the purpose of reattaching with a boolean instead of with the old track parameter (currently useless?).

Thanks.
Comment 7 Nael Ouedraogo 2017-09-22 01:39:31 PDT
Created attachment 321527 [details]
Patch
Comment 8 Nael Ouedraogo 2017-09-22 01:43:52 PDT
Thanks for the review. In uploaded patch, I removed oldTrack and call reattachTrack as suggested. I also modified  reattachTrack since caps of stream's appsrc are not valid when calling reattachTrack.
Comment 9 Enrique Ocaña 2017-09-22 05:50:53 PDT
Comment on attachment 321527 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=321527&action=review

Apart from the minor comment below, the rest is ok. I've checked locally that it causes no test regressions and, indeed, the new passing tests actually pass.

> Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:83
> +    void trackDetected(RefPtr<AppendPipeline>, RefPtr<WebCore::TrackPrivateBase> newTrack, bool);

Leave the newTrack parameter name empty. It's not needed now that there are no confusion betweet two parameters with the same name. Add a parameter name for the bool parameter. See: https://webkit.org/code-style-guidelines/#names-variable-name-in-function-decl
Comment 10 Xabier Rodríguez Calvar 2017-09-22 06:04:29 PDT
Comment on attachment 321527 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=321527&action=review

On top of Enrique's, I add two small change requests.

> Source/WebCore/platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:303
> +void PlaybackPipeline::reattachTrack(RefPtr<SourceBufferPrivateGStreamer> sourceBufferPrivate, RefPtr<TrackPrivateBase> trackPrivate, const gchar* mediaType)

gchar -> char

> Source/WebCore/platform/graphics/gstreamer/mse/PlaybackPipeline.h:61
> +    void reattachTrack(RefPtr<SourceBufferPrivateGStreamer>, RefPtr<TrackPrivateBase>, const gchar*);

gchar -> char
Comment 11 Nael Ouedraogo 2017-09-22 07:00:58 PDT
Created attachment 321541 [details]
Patch
Comment 12 Nael Ouedraogo 2017-09-22 07:07:07 PDT
Thanks for the reviews.
Comment 13 WebKit Commit Bot 2017-09-22 08:43:27 PDT
Comment on attachment 321541 [details]
Patch

Clearing flags on attachment: 321541

Committed r222388: <http://trac.webkit.org/changeset/222388>
Comment 14 WebKit Commit Bot 2017-09-22 08:43:29 PDT
All reviewed patches have been landed.  Closing bug.
Comment 15 Radar WebKit Bug Importer 2017-09-27 12:55:31 PDT
<rdar://problem/34694280>