[webkit-changes] [WebKit/WebKit] e55d19: [GStreamer] MediaPlayerPrivateGStreamer: Abort sta...

Alicia Boya García noreply at github.com
Sun Sep 4 07:08:45 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e55d1903cf1086c65c6d1f1fdf87578d0d54596c
      https://github.com/WebKit/WebKit/commit/e55d1903cf1086c65c6d1f1fdf87578d0d54596c
  Author: Alicia Boya Garcia <aboya at igalia.com>
  Date:   2022-09-04 (Sun, 04 Sep 2022)

  Changed paths:
    M Source/WebCore/platform/graphics/gstreamer/GStreamerVideoSinkCommon.cpp
    M Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
    M Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h

  Log Message:
  -----------
  [GStreamer] MediaPlayerPrivateGStreamer: Abort stale tasks on flushes
https://bugs.webkit.org/show_bug.cgi?id=244534

Reviewed by Philippe Normand.

This patch is a combination of a follow-up of
https://github.com/WebKit/WebKit/pull/3746, and a fix for a race
condition I independently discovered before said PR was published.

Minor cleanups for pr/3746 are done, additional logging is added,
MediaPlayerPrivateGStreamer::m_abortableTaskQueue is renamed to
MediaPlayerPrivateGStreamer::m_sinkTaskQueue, comments are added, and
most importantly: the task queue is flushed when a GStreamer flush is
received. This fixes a race condition on MSE flushes.

To compensate the additional logic added to the WebKit video sink probe,
this patch refactors the function, getting rid of the early return
spaghetti it had slowly become over the years.

In the process, I found the code for calling flushCurrentBuffer() on
FLUSH_START in the previous code was actually unreachable and had been
so for the most part of a year, as an accident of an early return in the
old code (FLUSH_START events have the
GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM flag. The old code did an early
return when that flag was found for an event other than a tag event).

Figuring out all bugs with flushCurrentBuffer() and what usages it
should have is very much outside of the scope of this patch. Instead,
this patch makes no change on behavior and adds a FIXME section
explaining the situation and how it needs further work.

* Source/WebCore/platform/graphics/gstreamer/GStreamerVideoSinkCommon.cpp:
(webKitVideoSinkSetMediaPlayerPrivate):
* Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
(WebCore::MediaPlayerPrivateGStreamer::updateVideoOrientation):
* Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
(WebCore::MediaPlayerPrivateGStreamer::sinkTaskQueue):

Canonical link: https://commits.webkit.org/254142@main




More information about the webkit-changes mailing list