Bug 218912

Summary: [Media In GPU Process][MSE] Add infrastructure needed to run MediaPlayerPrivateMediaSourceAVFObjC in the GPU process
Product: WebKit Reporter: Peng Liu <peng.liu6>
Component: MediaAssignee: Peng Liu <peng.liu6>
Status: RESOLVED FIXED    
Severity: Normal CC: annulen, calvaris, cdumez, cgarcia, changseok, eric.carlson, esprehn+autocc, ews-watchlist, glenn, gustavo, gyuyoung.kim, jer.noble, menard, mkwst, philipj, pnormand, ryuan.choi, sergio, vjaquez, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
WIP patch
none
Rebased WIP patch
ews-feeder: commit-queue-
WIP patch: enable unified build
ews-feeder: commit-queue-
WIP patch: fix WPE build failures
ews-feeder: commit-queue-
WIP patch: fix WPE build failures again
ews-feeder: commit-queue-
WIP patch: fix build failures
none
WIP patch: fix build failures on WPE and GTK ports
none
WIP patch: fix build failures on WPE and GTK ports (again)
none
WIP patch: fix build failures on WPE and GTK ports
ews-feeder: commit-queue-
WIP patch: fix build failures on WPE and GTK ports (update WebKit_MESSAGES_IN_FILES in CMakeLists.txt)
none
Patch
eric.carlson: review+
Patch for landing none

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>