Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a1d1ac683b4432a7df1d450f22df7f5415b4c078
      
https://github.com/WebKit/WebKit/commit/a1d1ac683b4432a7df1d450f22df7f5415b4c078
  Author: Enrique Ocaña González <[email protected]>
  Date:   2024-08-30 (Fri, 30 Aug 2024)

  Changed paths:
    M Source/WebCore/html/HTMLMediaElement.cpp
    M Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
    M Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
    M 
Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp
    M 
Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h
    M 
Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.cpp
    M 
Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h

  Log Message:
  -----------
  [MSE][GStreamer] Support markEndOfStream() before appendBuffer()
https://bugs.webkit.org/show_bug.cgi?id=278726

Reviewed by Xabier Rodriguez-Calvar.

MediaSource::markEndOfStream() causes the SourceBuffer TrackBuffers to push
EOS to playback pipeline through WebKitMediaSrc. When that happens without
any SourceBuffer::appendBuffer() call, the pipeline can't finish autoplugging
and parsebin triggers an unrecoverable error. That's on GStreamer 1.18.6 at
least. On GStreamer 1.24 no error is triggered, but still, playback (of no
data) never finishes.

While it's certainly possible to change parsebin to not trigger the error,
the truth is that this seems legitimate GStreamer behaviour that shouldn't be
altered (and also, doesn't fix the problem by itself, I've checked it,
playback doesn't finish, see previous paragraph).

This commit adds support for temporarily ignoring the error when using an
affected GStreamer version, and asking the pipeline to change to READY state.
It also notifies HTMLMediaElement about timeChanged, so the "ended" event can
be triggered (after all, there's no other position to go beyond 0, as there
are no samples and 0 is already the duration, so technically playback is ended).

See: https://github.com/WebPlatformForEmbedded/WPEWebKit/issues/1366

* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerTimeChanged): Allow time change 
processing when duration is zero and current time is zero.
* Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): Ignore errors when the 
m_ignoreErrors flag is enabled.
* Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add 
m_ignoreErrors flag.
* 
Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::updateStates): Report time changed on 
EOS with no buffer.
(WebCore::MediaPlayerPrivateGStreamerMSE::setEosWithNoBuffers): Set the 
m_isEosWithNoBuffer flag. Change the pipeline to READY when enabled (with 
errors disabled on older GStreamer versions).
* 
Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
 Added m_isEosWithNoBuffer flag.
* 
Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.cpp:
(WebCore::MediaSourcePrivateGStreamer::markEndOfStream): Detect the "EOS with 
no buffers" condition and report it to the player private.
(WebCore::MediaSourcePrivateGStreamer::unmarkEndOfStream): Disable the "EOS 
with no buffers" condition.
* Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h: 
Added unmarkEndOfStream().

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to