Bug 195855

Summary: [MSE][GStreamer] Fix handling of resolution changes in AppendPipeline
Product: WebKit Reporter: Alicia Boya García <aboya>
Component: WebKitGTKAssignee: Alicia Boya García <aboya>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, calvaris, commit-queue, ews-watchlist, rniwa
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ews104 for mac-highsierra-wk2
none
Archive of layout-test-results from ews100 for mac-highsierra
none
Archive of layout-test-results from ews115 for mac-highsierra
none
Patch
none
Archive of layout-test-results from ews101 for mac-highsierra
none
Archive of layout-test-results from ews105 for mac-highsierra-wk2
none
Archive of layout-test-results from ews116 for mac-highsierra
none
Patch
none
Archive of layout-test-results from ews103 for mac-highsierra
none
Archive of layout-test-results from ews106 for mac-highsierra-wk2
none
Archive of layout-test-results from ews112 for mac-highsierra
none
Patch
none
Archive of layout-test-results from ews204 for win-future
none
Patch none

Description Alicia Boya García 2019-03-16 13:01:59 PDT
MediaSample instances produced by the AppendPipeline were not accounting for resolution changes. The causes of this are twofold:

1) m_presentationSize is set by connectDemuxerSrcPadToAppsink() (by calling parseDemuxerSrcPadCaps()), but not by appsinkCapsChanged().
2) appsinkCapsChanged() was being called in the main thread as an asynchronous task. In consequence, even if m_presentationSize is set there, many samples with the new resolution would still be wrapped in a MediaSampleGStreamer using the old resolution by the main thread running consumeAppsinkAvailableSamples() before appsinkCapsChanged() is dispatched.

This patch fixes these problems by updating m_presentationSize in appsinkCapsChanged() and making the streaming thread block until the main thread has dispatched appsinkCapsChanged(). This way the handling of caps changes is serialized with the handling of frames.
Comment 1 Alicia Boya García 2019-03-16 18:29:38 PDT
Created attachment 364952 [details]
Patch
Comment 2 EWS Watchlist 2019-03-16 19:23:34 PDT
Comment on attachment 364952 [details]
Patch

Attachment 364952 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/11537034

New failing tests:
media/media-source/media-source-samples-resolution-change.html
Comment 3 EWS Watchlist 2019-03-16 19:23:36 PDT
Created attachment 364954 [details]
Archive of layout-test-results from ews104 for mac-highsierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-highsierra-wk2  Platform: Mac OS X 10.13.6
Comment 4 EWS Watchlist 2019-03-16 19:33:09 PDT
Comment on attachment 364952 [details]
Patch

Attachment 364952 [details] did not pass mac-ews (mac):
Output: https://webkit-queues.webkit.org/results/11537090

New failing tests:
media/media-source/media-source-samples-resolution-change.html
Comment 5 EWS Watchlist 2019-03-16 19:33:11 PDT
Created attachment 364955 [details]
Archive of layout-test-results from ews100 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 6 EWS Watchlist 2019-03-16 20:15:53 PDT
Comment on attachment 364952 [details]
Patch

Attachment 364952 [details] did not pass mac-debug-ews (mac):
Output: https://webkit-queues.webkit.org/results/11537137

New failing tests:
media/media-source/media-source-samples-resolution-change.html
Comment 7 EWS Watchlist 2019-03-16 20:15:55 PDT
Created attachment 364956 [details]
Archive of layout-test-results from ews115 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews115  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 8 Alicia Boya García 2019-03-17 08:24:13 PDT
Created attachment 364964 [details]
Patch
Comment 9 EWS Watchlist 2019-03-17 09:27:54 PDT
Comment on attachment 364964 [details]
Patch

Attachment 364964 [details] did not pass mac-ews (mac):
Output: https://webkit-queues.webkit.org/results/11541407

New failing tests:
media/media-source/media-source-samples-resolution-change.html
Comment 10 EWS Watchlist 2019-03-17 09:27:55 PDT
Created attachment 364967 [details]
Archive of layout-test-results from ews101 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 11 EWS Watchlist 2019-03-17 09:40:58 PDT
Comment on attachment 364964 [details]
Patch

Attachment 364964 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/11541422

New failing tests:
media/media-source/media-source-samples-resolution-change.html
Comment 12 EWS Watchlist 2019-03-17 09:41:00 PDT
Created attachment 364968 [details]
Archive of layout-test-results from ews105 for mac-highsierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-highsierra-wk2  Platform: Mac OS X 10.13.6
Comment 13 EWS Watchlist 2019-03-17 10:11:14 PDT
Comment on attachment 364964 [details]
Patch

Attachment 364964 [details] did not pass mac-debug-ews (mac):
Output: https://webkit-queues.webkit.org/results/11541459

New failing tests:
media/media-source/media-source-samples-resolution-change.html
Comment 14 EWS Watchlist 2019-03-17 10:11:15 PDT
Created attachment 364969 [details]
Archive of layout-test-results from ews116 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews116  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 15 Xabier Rodríguez Calvar 2019-03-18 00:30:50 PDT
Comment on attachment 364964 [details]
Patch

It looks like you need to flag the test for mac.
Comment 16 Xabier Rodríguez Calvar 2019-03-18 02:34:30 PDT
And another comment, could you try to write this test in the W3C test suite and then backport it here?
Comment 17 Alicia Boya García 2019-03-18 03:56:53 PDT
Unfortunately no. This test uses WebKit `internals` methods that are only available in WebKit test runner.
Comment 18 Alicia Boya García 2019-03-18 03:58:36 PDT
(and there is no standard APIs to poke in these internals)
Comment 19 Alicia Boya García 2019-03-19 07:09:40 PDT
Created attachment 365152 [details]
Patch
Comment 20 EWS Watchlist 2019-03-19 08:12:24 PDT
Comment on attachment 365152 [details]
Patch

Attachment 365152 [details] did not pass mac-ews (mac):
Output: https://webkit-queues.webkit.org/results/11565758

New failing tests:
media/media-source/media-source-samples-resolution-change.html
Comment 21 EWS Watchlist 2019-03-19 08:12:26 PDT
Created attachment 365158 [details]
Archive of layout-test-results from ews103 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews103  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 22 EWS Watchlist 2019-03-19 08:24:37 PDT
Comment on attachment 365152 [details]
Patch

Attachment 365152 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/11565832

New failing tests:
media/media-source/media-source-samples-resolution-change.html
Comment 23 EWS Watchlist 2019-03-19 08:24:39 PDT
Created attachment 365160 [details]
Archive of layout-test-results from ews106 for mac-highsierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106  Port: mac-highsierra-wk2  Platform: Mac OS X 10.13.6
Comment 24 EWS Watchlist 2019-03-19 08:54:54 PDT
Comment on attachment 365152 [details]
Patch

Attachment 365152 [details] did not pass mac-debug-ews (mac):
Output: https://webkit-queues.webkit.org/results/11565864

New failing tests:
media/media-source/media-source-samples-resolution-change.html
Comment 25 EWS Watchlist 2019-03-19 08:54:56 PDT
Created attachment 365166 [details]
Archive of layout-test-results from ews112 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews112  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 26 Alicia Boya García 2019-03-19 08:59:33 PDT
Created attachment 365167 [details]
Patch
Comment 27 EWS Watchlist 2019-03-19 10:49:09 PDT
Comment on attachment 365167 [details]
Patch

Attachment 365167 [details] did not pass win-ews (win):
Output: https://webkit-queues.webkit.org/results/11567380

New failing tests:
storage/indexeddb/modern/gc-closes-database-private.html
Comment 28 EWS Watchlist 2019-03-19 10:49:21 PDT
Created attachment 365184 [details]
Archive of layout-test-results from ews204 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews204  Port: win-future  Platform: CYGWIN_NT-6.1-2.10.0-0.325-5-3-x86_64-64bit
Comment 29 Alicia Boya García 2019-03-19 12:55:13 PDT
Created attachment 365213 [details]
Patch
Comment 30 WebKit Commit Bot 2019-03-20 06:11:15 PDT
Comment on attachment 365213 [details]
Patch

Clearing flags on attachment: 365213

Committed r243199: <https://trac.webkit.org/changeset/243199>
Comment 31 WebKit Commit Bot 2019-03-20 06:11:17 PDT
All reviewed patches have been landed.  Closing bug.