|
Lines 1192-1204
void MediaPlayerPrivateGStreamer::processTableOfContentsEntry(GstTocEntry* entry
a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp_sec1
|
| 1192 |
} |
1192 |
} |
| 1193 |
#endif |
1193 |
#endif |
| 1194 |
|
1194 |
|
|
|
1195 |
static int findHLSQueue(const GValue* item) |
| 1196 |
{ |
| 1197 |
GstElement* element = GST_ELEMENT(g_value_get_object(item)); |
| 1198 |
if (g_str_has_prefix(GST_ELEMENT_NAME(element), "queue")) { |
| 1199 |
GstElement* parent = GST_ELEMENT(GST_ELEMENT_PARENT(element)); |
| 1200 |
if (!GST_IS_OBJECT(parent)) |
| 1201 |
return 1; |
| 1202 |
|
| 1203 |
if (g_str_has_prefix(GST_ELEMENT_NAME(GST_ELEMENT_PARENT(parent)), "hlsdemux")) |
| 1204 |
return 0; |
| 1205 |
} |
| 1206 |
|
| 1207 |
return 1; |
| 1208 |
} |
| 1209 |
|
| 1210 |
static bool isHLSProgressing(GstElement* playbin, GstQuery* query) |
| 1211 |
{ |
| 1212 |
GValue item = { }; |
| 1213 |
GstIterator* binIterator = gst_bin_iterate_recurse(GST_BIN(playbin)); |
| 1214 |
bool foundHLSQueue = gst_iterator_find_custom(binIterator, reinterpret_cast<GCompareFunc>(findHLSQueue), &item, nullptr); |
| 1215 |
gst_iterator_free(binIterator); |
| 1216 |
|
| 1217 |
if (!foundHLSQueue) |
| 1218 |
return false; |
| 1219 |
|
| 1220 |
GstElement* queueElement = GST_ELEMENT(g_value_get_object(&item)); |
| 1221 |
bool queryResult = gst_element_query(queueElement, query); |
| 1222 |
g_value_unset(&item); |
| 1223 |
|
| 1224 |
return queryResult; |
| 1225 |
} |
| 1226 |
|
| 1195 |
void MediaPlayerPrivateGStreamer::fillTimerFired() |
1227 |
void MediaPlayerPrivateGStreamer::fillTimerFired() |
| 1196 |
{ |
1228 |
{ |
| 1197 |
GstQuery* query = gst_query_new_buffering(GST_FORMAT_PERCENT); |
1229 |
GstQuery* query = gst_query_new_buffering(GST_FORMAT_PERCENT); |
| 1198 |
|
1230 |
|
| 1199 |
if (!gst_element_query(m_pipeline.get(), query)) { |
1231 |
if (G_UNLIKELY(!gst_element_query(m_pipeline.get(), query))) { |
| 1200 |
gst_query_unref(query); |
1232 |
// This query always fails for live pipelines. In the case of HLS, try and find |
| 1201 |
return; |
1233 |
// the queue inside the HLS element to get a proxy measure of progress. Note |
|
|
1234 |
// that the percentage value is rather meaningless as used below. |
| 1235 |
// This is a hack, see https://bugs.webkit.org/show_bug.cgi?id=141469. |
| 1236 |
if (!isHLSProgressing(m_pipeline.get(), query)) { |
| 1237 |
gst_query_unref(query); |
| 1238 |
return; |
| 1239 |
} |
| 1202 |
} |
1240 |
} |
| 1203 |
|
1241 |
|
| 1204 |
gint64 start, stop; |
1242 |
gint64 start, stop; |