Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2104,6 +2104,8 @@ void MediaPlayerPrivateGStreamer::handleMessage(GstMessage* message)
if (!messageSourceIsPlaybin || m_isDelayingLoad)
break;

updateBufferingStatus();

// The MediaPlayerPrivateGStreamer superclass now processes what it needs by calling updateStates() in handleMessage() for
// GST_MESSAGE_STATE_CHANGED. However, subclasses still need to override asyncStateChangeDone() to do their own stuff.
didPreroll();
Expand Down Expand Up @@ -2404,6 +2406,17 @@ void MediaPlayerPrivateGStreamer::updateBufferingStatus(GstBufferingMode mode, d
boolForPrinting(m_wasBuffering), boolForPrinting(m_isBuffering), m_previousBufferingPercentage, m_bufferingPercentage);
}

void MediaPlayerPrivateGStreamer::updateBufferingStatus()
{
std::optional<int> percentage = queryBufferingPercentage();

if (!percentage.has_value()) {
GST_DEBUG_OBJECT(pipeline(), "[Buffering] Unable to determine buffering status");
return;
}
updateBufferingStatus(GST_BUFFERING_DOWNLOAD, percentage.value(), false, false);
}

#if USE(GSTREAMER_MPEGTS)
void MediaPlayerPrivateGStreamer::processMpegTsSection(GstMpegtsSection* section)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ class MediaPlayerPrivateGStreamer
virtual void updateDownloadBufferingFlag();
void processBufferingStats(GstMessage*);
void updateBufferingStatus(GstBufferingMode, double percentage, bool resetHistory = false, bool shouldUpdateStates = true);
void updateBufferingStatus();
void updateMaxTimeLoaded(double percentage);

#if USE(GSTREAMER_MPEGTS)
Expand Down