Changeset 243537 in webkit
- Timestamp:
- Mar 27, 2019, 4:34:53 AM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (modified) (2 diffs)
-
platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h (modified) (1 diff)
-
platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r243532 r243537 1 2019-03-27 Philippe Normand <pnormand@igalia.com> 2 3 [GStreamer] Remove the HLS queue buffering query hack 4 https://bugs.webkit.org/show_bug.cgi?id=196244 5 6 Reviewed by Xabier Rodriguez-Calvar. 7 8 Because the http src element now provides network statistics to 9 the player we can now compute an estimation of the data loading in 10 case the buffering query isn't handled by any element of the 11 pipeline. 12 13 No new tests, existing HLS tests cover this change. 14 15 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: 16 (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired): 17 (WebCore::findHLSQueue): Deleted. 18 (WebCore::isHLSProgressing): Deleted. 19 1 20 2019-03-26 Said Abou-Hallawa <sabouhallawa@apple.com> 2 21 -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
r243489 r243537 1375 1375 } 1376 1376 } else if (gst_structure_has_name(structure, "webkit-network-statistics")) { 1377 if (gst_structure_get _uint64(structure, "read-position", &m_networkReadPosition))1378 GST_DEBUG_OBJECT(pipeline(), "Updated network read position %" G_GUINT64_FORMAT , m_networkReadPosition);1377 if (gst_structure_get(structure, "read-position", G_TYPE_UINT64, &m_networkReadPosition, "size", G_TYPE_UINT64, &m_httpResponseTotalSize, nullptr)) 1378 GST_DEBUG_OBJECT(pipeline(), "Updated network read position %" G_GUINT64_FORMAT ", size: %" G_GUINT64_FORMAT, m_networkReadPosition, m_httpResponseTotalSize); 1379 1379 } else 1380 1380 GST_DEBUG_OBJECT(pipeline(), "Unhandled element message: %" GST_PTR_FORMAT, structure); … … 1583 1583 #endif 1584 1584 1585 static gint findHLSQueue(gconstpointer a, gconstpointer)1586 {1587 GValue* item = static_cast<GValue*>(const_cast<gpointer>(a));1588 GstElement* element = GST_ELEMENT(g_value_get_object(item));1589 if (g_str_has_prefix(GST_ELEMENT_NAME(element), "queue")) {1590 GstElement* parent = GST_ELEMENT(GST_ELEMENT_PARENT(element));1591 if (!GST_IS_OBJECT(parent))1592 return 1;1593 1594 if (g_str_has_prefix(GST_ELEMENT_NAME(GST_ELEMENT_PARENT(parent)), "hlsdemux"))1595 return 0;1596 }1597 1598 return 1;1599 }1600 1601 static bool isHLSProgressing(GstElement* playbin, GstQuery* query)1602 {1603 GValue item = { };1604 GstIterator* binIterator = gst_bin_iterate_recurse(GST_BIN(playbin));1605 bool foundHLSQueue = gst_iterator_find_custom(binIterator, reinterpret_cast<GCompareFunc>(findHLSQueue), &item, nullptr);1606 gst_iterator_free(binIterator);1607 1608 if (!foundHLSQueue)1609 return false;1610 1611 GstElement* queueElement = GST_ELEMENT(g_value_get_object(&item));1612 bool queryResult = gst_element_query(queueElement, query);1613 g_value_unset(&item);1614 1615 return queryResult;1616 }1617 1618 1585 void MediaPlayerPrivateGStreamer::fillTimerFired() 1619 1586 { 1620 GstQuery* query = gst_query_new_buffering(GST_FORMAT_PERCENT); 1621 1622 if (G_UNLIKELY(!gst_element_query(m_pipeline.get(), query))) { 1623 // This query always fails for live pipelines. In the case of HLS, try and find 1624 // the queue inside the HLS element to get a proxy measure of progress. Note 1625 // that the percentage value is rather meaningless as used below. 1626 // This is a hack, see https://bugs.webkit.org/show_bug.cgi?id=141469. 1627 if (!isHLSProgressing(m_pipeline.get(), query)) { 1628 gst_query_unref(query); 1629 return; 1630 } 1631 } 1632 1633 gint64 start, stop; 1634 gdouble fillStatus = 100.0; 1635 1636 gst_query_parse_buffering_range(query, nullptr, &start, &stop, nullptr); 1637 gst_query_unref(query); 1638 1639 if (stop != -1) 1640 fillStatus = 100.0 * stop / GST_FORMAT_PERCENT_MAX; 1587 GRefPtr<GstQuery> query = adoptGRef(gst_query_new_buffering(GST_FORMAT_PERCENT)); 1588 double fillStatus = 100.0; 1589 1590 if (gst_element_query(m_pipeline.get(), query.get())) { 1591 int64_t stop; 1592 GstFormat format; 1593 gst_query_parse_buffering_range(query.get(), &format, nullptr, &stop, nullptr); 1594 ASSERT(format == GST_FORMAT_PERCENT); 1595 1596 if (stop != -1) 1597 fillStatus = 100.0 * stop / GST_FORMAT_PERCENT_MAX; 1598 } else if (m_httpResponseTotalSize) { 1599 GST_DEBUG_OBJECT(pipeline(), "[Buffering] Query failed, falling back to network read position estimation"); 1600 fillStatus = 100.0 * (m_networkReadPosition / m_httpResponseTotalSize); 1601 } else { 1602 GST_DEBUG_OBJECT(pipeline(), "[Buffering] Unable to determine on-disk buffering status"); 1603 return; 1604 } 1641 1605 1642 1606 GST_DEBUG_OBJECT(pipeline(), "[Buffering] Download buffer filled up to %f%%", fillStatus); -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
r243489 r243537 288 288 virtual bool isMediaSource() const { return false; } 289 289 290 uint64_t m_httpResponseTotalSize { 0 }; 290 291 uint64_t m_networkReadPosition { 0 }; 291 292 mutable uint64_t m_readPositionAtLastDidLoadingProgress { 0 }; -
trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
r243197 r243537 999 999 priv->requestedPosition = newPosition; 1000 1000 priv->readPosition = newPosition; 1001 gst_element_post_message(GST_ELEMENT_CAST(src), gst_message_new_element(GST_OBJECT_CAST(src),1002 gst_structure_new("webkit-network-statistics", "read-position", G_TYPE_UINT64, priv->readPosition, nullptr)));1003 1001 1004 1002 uint64_t newSize = 0; … … 1018 1016 } 1019 1017 1018 gst_element_post_message(GST_ELEMENT_CAST(src), gst_message_new_element(GST_OBJECT_CAST(src), 1019 gst_structure_new("webkit-network-statistics", "read-position", G_TYPE_UINT64, priv->readPosition, "size", G_TYPE_UINT64, priv->size, nullptr))); 1020 1020 1021 checkUpdateBlocksize(length); 1021 1022
Note:
See TracChangeset
for help on using the changeset viewer.