[webkit-reviews] review granted: [Bug 206209] Expose video tracks for media files in the GPUProcess : [Attachment 387605] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 13 20:35:49 PST 2020


Jer Noble <jer.noble at apple.com> has granted Eric Carlson
<eric.carlson at apple.com>'s request for review:
Bug 206209: Expose video tracks for media files in the GPUProcess
https://bugs.webkit.org/show_bug.cgi?id=206209

Attachment 387605: Patch

https://bugs.webkit.org/attachment.cgi?id=387605&action=review




--- Comment #3 from Jer Noble <jer.noble at apple.com> ---
Comment on attachment 387605
  --> https://bugs.webkit.org/attachment.cgi?id=387605
Patch

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

r=me with a nit and a couple fixes.

> Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:423
> +    ASSERT(!m_videoTracks.contains(identifier));
> +    if (m_videoTracks.contains(identifier))
> +	   return;
> +
> +    auto track = VideoTrackPrivateRemote::create(*this, identifier,
WTFMove(configuration));
> +    m_player->addVideoTrack(m_videoTracks.add(identifier,
WTFMove(track)).iterator->value);

Nit: This could be made ever so slightly more efficient by doing something
like:

  auto addResult = m_videoTracks.ensure(identifier, [&] { return
VideoTrackPrivateRemote::create(*this, identifier, WTFMove(configuration)); 
});
  ASSERT(addResult.isNewEntry);
  if (!addResult.isNewEntry)
    return;
  m_player->addVideoTrack(addResult.iterator->value);

> Source/WebKit/WebProcess/GPU/media/VideoTrackPrivateRemote.cpp:65
> +	       client()->idChanged(m_label);

  labelChanged(m_label)?

> Source/WebKit/WebProcess/GPU/media/VideoTrackPrivateRemote.cpp:72
> +	       client()->idChanged(m_language);

  languageChanged(m_language)?

> Source/WebKit/WebProcess/GPU/media/VideoTrackPrivateRemote.h:67
> +    int m_trackIndex { -1 };

Is it too late to use Optional<int> here?  Probably, but it'd be a nice clean
up in a future patch.


More information about the webkit-reviews mailing list