Bug 218912 - [Media In GPU Process][MSE] Add infrastructure needed to run MediaPlayerPrivateMediaSourceAVFObjC in the GPU process
Summary: [Media In GPU Process][MSE] Add infrastructure needed to run MediaPlayerPriva...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Peng Liu
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-11-13 10:08 PST by Peng Liu
Modified: 2020-11-17 09:26 PST (History)
20 users (show)

See Also:


Attachments
WIP patch (123.30 KB, patch)
2020-11-16 08:57 PST, Peng Liu
no flags Details | Formatted Diff | Diff
Rebased WIP patch (122.35 KB, patch)
2020-11-16 10:07 PST, Peng Liu
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
WIP patch: enable unified build (124.80 KB, patch)
2020-11-16 10:41 PST, Peng Liu
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
WIP patch: fix WPE build failures (128.92 KB, patch)
2020-11-16 10:52 PST, Peng Liu
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
WIP patch: fix WPE build failures again (128.91 KB, patch)
2020-11-16 11:04 PST, Peng Liu
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
WIP patch: fix build failures (126.85 KB, patch)
2020-11-16 12:11 PST, Peng Liu
no flags Details | Formatted Diff | Diff
WIP patch: fix build failures on WPE and GTK ports (126.90 KB, patch)
2020-11-16 14:04 PST, Peng Liu
no flags Details | Formatted Diff | Diff
WIP patch: fix build failures on WPE and GTK ports (again) (127.30 KB, patch)
2020-11-16 14:18 PST, Peng Liu
no flags Details | Formatted Diff | Diff
WIP patch: fix build failures on WPE and GTK ports (127.13 KB, patch)
2020-11-16 14:45 PST, Peng Liu
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
WIP patch: fix build failures on WPE and GTK ports (update WebKit_MESSAGES_IN_FILES in CMakeLists.txt) (130.13 KB, patch)
2020-11-16 15:31 PST, Peng Liu
no flags Details | Formatted Diff | Diff
Patch (131.10 KB, patch)
2020-11-16 16:04 PST, Peng Liu
eric.carlson: review+
Details | Formatted Diff | Diff
Patch for landing (129.80 KB, patch)
2020-11-16 20:46 PST, Peng Liu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peng Liu 2020-11-13 10:08:09 PST
We need to add MediaSourcePrivateRemote/RemoteMediaSourceProxy and SourceBufferPrivateRemote/RemoteSourceBufferProxy and setup the IPC messages.
Comment 1 Peng Liu 2020-11-16 08:57:48 PST Comment hidden (obsolete)
Comment 2 Peng Liu 2020-11-16 09:26:19 PST Comment hidden (obsolete)
Comment 3 Peng Liu 2020-11-16 10:07:11 PST Comment hidden (obsolete)
Comment 4 Peng Liu 2020-11-16 10:41:26 PST Comment hidden (obsolete)
Comment 5 Peng Liu 2020-11-16 10:52:04 PST Comment hidden (obsolete)
Comment 6 Peng Liu 2020-11-16 11:04:10 PST Comment hidden (obsolete)
Comment 7 Peng Liu 2020-11-16 12:11:38 PST Comment hidden (obsolete)
Comment 8 Peng Liu 2020-11-16 14:04:39 PST Comment hidden (obsolete)
Comment 9 Peng Liu 2020-11-16 14:18:00 PST Comment hidden (obsolete)
Comment 10 Peng Liu 2020-11-16 14:45:47 PST Comment hidden (obsolete)
Comment 11 Peng Liu 2020-11-16 15:31:10 PST Comment hidden (obsolete)
Comment 12 Peng Liu 2020-11-16 16:04:59 PST
Created attachment 414286 [details]
Patch
Comment 13 Eric Carlson 2020-11-16 17:00:41 PST
Comment on attachment 414286 [details]
Patch

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

> Source/WebCore/platform/graphics/MediaPlayer.cpp:-480
> -    m_contentType = contentType;

Is this really not needed if we end up in `nextBestMediaEngine`?

> Source/WebKit/GPUProcess/media/RemoteMediaSourceProxy.cpp:61
> +    return { };

You could call `notImplemented()` from all of these stub methods.

> Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.cpp:62
> +}

Ditto

> Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:637
> +    if (m_remoteEngineIdentifier == MediaPlayerEnums::MediaEngineIdentifier::AVFoundationMSE) {
> +        auto identifier = RemoteMediaSourceIdentifier::generate();
> +        connection().send(Messages::RemoteMediaPlayerProxy::LoadMediaSource(url, identifier), m_id);
> +        m_mediaSourcePrivate = MediaSourcePrivateRemote::create(m_manager.gpuProcessConnection(), identifier, m_manager.typeCache(m_remoteEngineIdentifier), *this, client);
> +    } else {

You could use an early return here instead of the `else`

> Source/WebKit/WebProcess/GPU/media/MediaSourcePrivateRemote.cpp:107
> +}

notImplemented()

> Source/WebKit/WebProcess/GPU/media/SourceBufferPrivateRemote.cpp:85
> +}

Ditto
Comment 14 Peng Liu 2020-11-16 20:46:52 PST
Created attachment 414304 [details]
Patch for landing
Comment 15 Peng Liu 2020-11-16 20:48:59 PST
Comment on attachment 414286 [details]
Patch

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

>> Source/WebCore/platform/graphics/MediaPlayer.cpp:-480
>> -    m_contentType = contentType;
> 
> Is this really not needed if we end up in `nextBestMediaEngine`?

Hmm, we may need it in that case. To be safe, I added the parameter back and changed MediaPlayerPrivate::load() accordingly.

>> Source/WebKit/GPUProcess/media/RemoteMediaSourceProxy.cpp:61
>> +    return { };
> 
> You could call `notImplemented()` from all of these stub methods.

Fixed.

>> Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.cpp:62
>> +}
> 
> Ditto

Fixed.

>> Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:637
>> +    } else {
> 
> You could use an early return here instead of the `else`

Right! Fixed.

>> Source/WebKit/WebProcess/GPU/media/MediaSourcePrivateRemote.cpp:107
>> +}
> 
> notImplemented()

Fixed.

>> Source/WebKit/WebProcess/GPU/media/SourceBufferPrivateRemote.cpp:85
>> +}
> 
> Ditto

Fixed.
Comment 16 EWS 2020-11-17 09:25:51 PST
Committed r269907: <https://trac.webkit.org/changeset/269907>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 414304 [details].
Comment 17 Radar WebKit Bug Importer 2020-11-17 09:26:17 PST
<rdar://problem/71489527>