Lines Matching refs:dc
75 GstDiscoverer *dc; member
151 #define DISCO_LOCK(dc) g_mutex_lock (&dc->priv->lock); argument
152 #define DISCO_UNLOCK(dc) g_mutex_unlock (&dc->priv->lock); argument
193 static void gst_discoverer_set_timeout (GstDiscoverer * dc,
195 static gboolean async_timeout_cb (GstDiscoverer * dc);
198 GstDiscoverer * dc);
200 GstDiscoverer * dc);
202 GstPad * pad, GstDiscoverer * dc);
204 GstDiscoverer * dc);
206 GParamSpec * pspec, GstDiscoverer * dc);
208 static void gst_discoverer_dispose (GObject * dc);
209 static void gst_discoverer_finalize (GObject * dc);
214 static gboolean _setup_locked (GstDiscoverer * dc);
215 static void handle_current_async (GstDiscoverer * dc);
216 static gboolean emit_discovererd_and_next (GstDiscoverer * dc);
333 GstElement * child, GstDiscoverer * dc) in uridecodebin_element_added_cb() argument
338 if (G_OBJECT_TYPE (child) == dc->priv->decodebin_type) { in uridecodebin_element_added_cb()
344 gst_discoverer_init (GstDiscoverer * dc) in gst_discoverer_init() argument
349 dc->priv = gst_discoverer_get_instance_private (dc); in gst_discoverer_init()
351 dc->priv->timeout = DEFAULT_PROP_TIMEOUT; in gst_discoverer_init()
352 dc->priv->use_cache = DEFAULT_PROP_USE_CACHE; in gst_discoverer_init()
353 dc->priv->async = FALSE; in gst_discoverer_init()
355 g_mutex_init (&dc->priv->lock); in gst_discoverer_init()
357 dc->priv->pending_subtitle_pads = 0; in gst_discoverer_init()
359 dc->priv->current_state = GST_STATE_NULL; in gst_discoverer_init()
360 dc->priv->target_state = GST_STATE_NULL; in gst_discoverer_init()
361 dc->priv->no_more_pads = FALSE; in gst_discoverer_init()
363 dc->priv->all_tags = NULL; in gst_discoverer_init()
364 dc->priv->global_tags = NULL; in gst_discoverer_init()
367 dc->priv->pipeline = (GstBin *) gst_pipeline_new ("Discoverer"); in gst_discoverer_init()
368 GST_LOG_OBJECT (dc, "Creating uridecodebin"); in gst_discoverer_init()
369 dc->priv->uridecodebin = in gst_discoverer_init()
371 if (G_UNLIKELY (dc->priv->uridecodebin == NULL)) { in gst_discoverer_init()
375 GST_LOG_OBJECT (dc, "Adding uridecodebin to pipeline"); in gst_discoverer_init()
376 gst_bin_add (dc->priv->pipeline, dc->priv->uridecodebin); in gst_discoverer_init()
378 dc->priv->pad_added_id = in gst_discoverer_init()
379 g_signal_connect_object (dc->priv->uridecodebin, "pad-added", in gst_discoverer_init()
380 G_CALLBACK (uridecodebin_pad_added_cb), dc, 0); in gst_discoverer_init()
381 dc->priv->pad_remove_id = in gst_discoverer_init()
382 g_signal_connect_object (dc->priv->uridecodebin, "pad-removed", in gst_discoverer_init()
383 G_CALLBACK (uridecodebin_pad_removed_cb), dc, 0); in gst_discoverer_init()
384 dc->priv->no_more_pads_id = in gst_discoverer_init()
385 g_signal_connect_object (dc->priv->uridecodebin, "no-more-pads", in gst_discoverer_init()
386 G_CALLBACK (uridecodebin_no_more_pads_cb), dc, 0); in gst_discoverer_init()
387 dc->priv->source_chg_id = in gst_discoverer_init()
388 g_signal_connect_object (dc->priv->uridecodebin, "notify::source", in gst_discoverer_init()
389 G_CALLBACK (uridecodebin_source_changed_cb), dc, 0); in gst_discoverer_init()
391 GST_LOG_OBJECT (dc, "Getting pipeline bus"); in gst_discoverer_init()
392 dc->priv->bus = gst_pipeline_get_bus ((GstPipeline *) dc->priv->pipeline); in gst_discoverer_init()
394 dc->priv->bus_cb_id = in gst_discoverer_init()
395 g_signal_connect_object (dc->priv->bus, "message", in gst_discoverer_init()
396 G_CALLBACK (discoverer_bus_cb), dc, 0); in gst_discoverer_init()
398 GST_DEBUG_OBJECT (dc, "Done initializing Discoverer"); in gst_discoverer_init()
403 dc->priv->element_added_id = in gst_discoverer_init()
404 g_signal_connect_object (dc->priv->uridecodebin, "element-added", in gst_discoverer_init()
405 G_CALLBACK (uridecodebin_element_added_cb), dc, 0); in gst_discoverer_init()
407 dc->priv->decodebin_type = G_OBJECT_TYPE (tmp); in gst_discoverer_init()
411 dc->priv->seeking_query = gst_query_new_seeking (format); in gst_discoverer_init()
415 discoverer_reset (GstDiscoverer * dc) in discoverer_reset() argument
417 GST_DEBUG_OBJECT (dc, "Resetting"); in discoverer_reset()
419 if (dc->priv->pending_uris) { in discoverer_reset()
420 g_list_foreach (dc->priv->pending_uris, (GFunc) g_free, NULL); in discoverer_reset()
421 g_list_free (dc->priv->pending_uris); in discoverer_reset()
422 dc->priv->pending_uris = NULL; in discoverer_reset()
425 if (dc->priv->pipeline) in discoverer_reset()
426 gst_element_set_state ((GstElement *) dc->priv->pipeline, GST_STATE_NULL); in discoverer_reset()
438 GstDiscoverer *dc = (GstDiscoverer *) obj; in gst_discoverer_dispose() local
440 GST_DEBUG_OBJECT (dc, "Disposing"); in gst_discoverer_dispose()
442 discoverer_reset (dc); in gst_discoverer_dispose()
444 if (G_LIKELY (dc->priv->pipeline)) { in gst_discoverer_dispose()
446 DISCONNECT_SIGNAL (dc->priv->uridecodebin, dc->priv->pad_added_id); in gst_discoverer_dispose()
447 DISCONNECT_SIGNAL (dc->priv->uridecodebin, dc->priv->pad_remove_id); in gst_discoverer_dispose()
448 DISCONNECT_SIGNAL (dc->priv->uridecodebin, dc->priv->no_more_pads_id); in gst_discoverer_dispose()
449 DISCONNECT_SIGNAL (dc->priv->uridecodebin, dc->priv->source_chg_id); in gst_discoverer_dispose()
450 DISCONNECT_SIGNAL (dc->priv->uridecodebin, dc->priv->element_added_id); in gst_discoverer_dispose()
451 DISCONNECT_SIGNAL (dc->priv->bus, dc->priv->bus_cb_id); in gst_discoverer_dispose()
454 gst_object_unref (dc->priv->pipeline); in gst_discoverer_dispose()
455 if (dc->priv->bus) in gst_discoverer_dispose()
456 gst_object_unref (dc->priv->bus); in gst_discoverer_dispose()
458 dc->priv->pipeline = NULL; in gst_discoverer_dispose()
459 dc->priv->uridecodebin = NULL; in gst_discoverer_dispose()
460 dc->priv->bus = NULL; in gst_discoverer_dispose()
463 gst_discoverer_stop (dc); in gst_discoverer_dispose()
465 if (dc->priv->seeking_query) { in gst_discoverer_dispose()
466 gst_query_unref (dc->priv->seeking_query); in gst_discoverer_dispose()
467 dc->priv->seeking_query = NULL; in gst_discoverer_dispose()
476 GstDiscoverer *dc = (GstDiscoverer *) obj; in gst_discoverer_finalize() local
478 g_mutex_clear (&dc->priv->lock); in gst_discoverer_finalize()
487 GstDiscoverer *dc = (GstDiscoverer *) object; in gst_discoverer_set_property() local
491 gst_discoverer_set_timeout (dc, g_value_get_uint64 (value)); in gst_discoverer_set_property()
494 DISCO_LOCK (dc); in gst_discoverer_set_property()
495 dc->priv->use_cache = g_value_get_boolean (value); in gst_discoverer_set_property()
496 DISCO_UNLOCK (dc); in gst_discoverer_set_property()
508 GstDiscoverer *dc = (GstDiscoverer *) object; in gst_discoverer_get_property() local
512 DISCO_LOCK (dc); in gst_discoverer_get_property()
513 g_value_set_uint64 (value, dc->priv->timeout); in gst_discoverer_get_property()
514 DISCO_UNLOCK (dc); in gst_discoverer_get_property()
517 DISCO_LOCK (dc); in gst_discoverer_get_property()
518 g_value_set_boolean (value, dc->priv->use_cache); in gst_discoverer_get_property()
519 DISCO_UNLOCK (dc); in gst_discoverer_get_property()
528 gst_discoverer_set_timeout (GstDiscoverer * dc, GstClockTime timeout) in gst_discoverer_set_timeout() argument
532 GST_DEBUG_OBJECT (dc, "timeout : %" GST_TIME_FORMAT, GST_TIME_ARGS (timeout)); in gst_discoverer_set_timeout()
535 DISCO_LOCK (dc); in gst_discoverer_set_timeout()
536 dc->priv->timeout = timeout; in gst_discoverer_set_timeout()
537 DISCO_UNLOCK (dc); in gst_discoverer_set_timeout()
551 DISCO_LOCK (ps->dc); in _event_probe()
553 if (G_LIKELY (ps->dc->priv->processing)) { in _event_probe()
558 DISCO_UNLOCK (ps->dc); in _event_probe()
609 got_subtitle_data (GstPad * pad, GstPadProbeInfo * info, GstDiscoverer * dc) in got_subtitle_data() argument
620 DISCO_LOCK (dc); in got_subtitle_data()
622 dc->priv->pending_subtitle_pads--; in got_subtitle_data()
626 gst_element_post_message ((GstElement *) dc->priv->pipeline, msg); in got_subtitle_data()
628 DISCO_UNLOCK (dc); in got_subtitle_data()
636 GParamSpec * pspec, GstDiscoverer * dc) in uridecodebin_source_changed_cb() argument
642 GST_DEBUG_OBJECT (dc, "got a new source %p", src); in uridecodebin_source_changed_cb()
644 g_signal_emit (dc, gst_discoverer_signals[SIGNAL_SOURCE_SETUP], 0, src); in uridecodebin_source_changed_cb()
650 GstDiscoverer * dc) in uridecodebin_pad_added_cb() argument
658 GST_DEBUG_OBJECT (dc, "pad %s:%s", GST_DEBUG_PAD_NAME (pad)); in uridecodebin_pad_added_cb()
660 DISCO_LOCK (dc); in uridecodebin_pad_added_cb()
661 if (dc->priv->cleanup) { in uridecodebin_pad_added_cb()
662 GST_WARNING_OBJECT (dc, "Cleanup, not adding pad"); in uridecodebin_pad_added_cb()
663 DISCO_UNLOCK (dc); in uridecodebin_pad_added_cb()
666 if (dc->priv->current_error) { in uridecodebin_pad_added_cb()
667 GST_WARNING_OBJECT (dc, "Ongoing error, not adding more pads"); in uridecodebin_pad_added_cb()
668 DISCO_UNLOCK (dc); in uridecodebin_pad_added_cb()
673 ps->dc = dc; in uridecodebin_pad_added_cb()
707 (GstPadProbeCallback) got_subtitle_data, dc, NULL); in uridecodebin_pad_added_cb()
709 dc->priv->pending_subtitle_pads++; in uridecodebin_pad_added_cb()
715 gst_bin_add_many (dc->priv->pipeline, ps->queue, ps->sink, NULL); in uridecodebin_pad_added_cb()
734 dc->priv->streams = g_list_append (dc->priv->streams, ps); in uridecodebin_pad_added_cb()
735 DISCO_UNLOCK (dc); in uridecodebin_pad_added_cb()
737 GST_DEBUG_OBJECT (dc, "Done handling pad"); in uridecodebin_pad_added_cb()
742 GST_ERROR_OBJECT (dc, "Error while handling pad"); in uridecodebin_pad_added_cb()
750 DISCO_UNLOCK (dc); in uridecodebin_pad_added_cb()
755 uridecodebin_no_more_pads_cb (GstElement * uridecodebin, GstDiscoverer * dc) in uridecodebin_no_more_pads_cb() argument
760 DISCO_LOCK (dc); in uridecodebin_no_more_pads_cb()
761 dc->priv->no_more_pads = TRUE; in uridecodebin_no_more_pads_cb()
762 gst_element_post_message ((GstElement *) dc->priv->pipeline, msg); in uridecodebin_no_more_pads_cb()
763 DISCO_UNLOCK (dc); in uridecodebin_no_more_pads_cb()
768 GstDiscoverer * dc) in uridecodebin_pad_removed_cb() argument
774 GST_DEBUG_OBJECT (dc, "pad %s:%s", GST_DEBUG_PAD_NAME (pad)); in uridecodebin_pad_removed_cb()
777 DISCO_LOCK (dc); in uridecodebin_pad_removed_cb()
778 for (tmp = dc->priv->streams; tmp; tmp = tmp->next) { in uridecodebin_pad_removed_cb()
785 DISCO_UNLOCK (dc); in uridecodebin_pad_removed_cb()
793 dc->priv->streams = g_list_delete_link (dc->priv->streams, tmp); in uridecodebin_pad_removed_cb()
804 gst_bin_remove_many (dc->priv->pipeline, ps->sink, ps->queue, NULL); in uridecodebin_pad_removed_cb()
806 DISCO_UNLOCK (dc); in uridecodebin_pad_removed_cb()
821 collect_stream_information (GstDiscoverer * dc, PrivateStream * ps, guint idx) in collect_stream_information() argument
904 collect_information (GstDiscoverer * dc, const GstStructure * st, in collect_information() argument
1118 find_stream_for_node (GstDiscoverer * dc, const GstStructure * topology) in find_stream_for_node() argument
1127 if (!dc->priv->streams) { in find_stream_for_node()
1139 for (i = 0, tmp = dc->priv->streams; tmp; tmp = tmp->next, i++) { in find_stream_for_node()
1152 st = collect_stream_information (dc, ps, i); in find_stream_for_node()
1218 parse_stream_topology (GstDiscoverer * dc, const GstStructure * topology, in parse_stream_topology() argument
1230 GstStructure *st = find_stream_for_node (dc, topology); in parse_stream_topology()
1234 res = collect_information (dc, st, parent); in parse_stream_topology()
1238 res = collect_information (dc, topology, parent); in parse_stream_topology()
1270 parse_stream_topology (dc, st, parent); in parse_stream_topology()
1275 parse_stream_topology (dc, st, parent); in parse_stream_topology()
1278 GstDiscovererStreamInfo *next = parse_stream_topology (dc, st, NULL); in parse_stream_topology()
1287 res->stream_number = dc->priv->current_info->stream_count++; in parse_stream_topology()
1288 dc->priv->current_info->stream_list = in parse_stream_topology()
1289 g_list_append (dc->priv->current_info->stream_list, res); in parse_stream_topology()
1317 if (dc->priv->global_tags) in parse_stream_topology()
1318 cont->tags = gst_tag_list_ref (dc->priv->global_tags); in parse_stream_topology()
1328 substream = parse_stream_topology (dc, subst, NULL); in parse_stream_topology()
1342 setup_next_uri_locked (GstDiscoverer * dc) in setup_next_uri_locked() argument
1344 if (dc->priv->pending_uris != NULL) { in setup_next_uri_locked()
1345 gboolean ready = _setup_locked (dc); in setup_next_uri_locked()
1346 DISCO_UNLOCK (dc); in setup_next_uri_locked()
1350 handle_current_async (dc); in setup_next_uri_locked()
1353 (GSourceFunc) emit_discovererd_and_next, gst_object_ref (dc), in setup_next_uri_locked()
1358 DISCO_UNLOCK (dc); in setup_next_uri_locked()
1359 g_signal_emit (dc, gst_discoverer_signals[SIGNAL_FINISHED], 0); in setup_next_uri_locked()
1364 _ensure_info_tags (GstDiscoverer * dc) in _ensure_info_tags() argument
1366 GstDiscovererInfo *info = dc->priv->current_info; in _ensure_info_tags()
1368 if (dc->priv->all_tags) in _ensure_info_tags()
1369 info->tags = dc->priv->all_tags; in _ensure_info_tags()
1370 dc->priv->all_tags = NULL; in _ensure_info_tags()
1375 emit_discovererd (GstDiscoverer * dc) in emit_discovererd() argument
1377 GstDiscovererInfo *info = _ensure_info_tags (dc); in emit_discovererd()
1378 GST_DEBUG_OBJECT (dc, "Emitting 'discoverered' %s", info->uri); in emit_discovererd()
1379 g_signal_emit (dc, gst_discoverer_signals[SIGNAL_DISCOVERED], 0, in emit_discovererd()
1380 info, dc->priv->current_error); in emit_discovererd()
1382 gst_discoverer_info_unref (dc->priv->current_info); in emit_discovererd()
1383 dc->priv->current_info = NULL; in emit_discovererd()
1387 emit_discovererd_and_next (GstDiscoverer * dc) in emit_discovererd_and_next() argument
1389 emit_discovererd (dc); in emit_discovererd_and_next()
1391 DISCO_LOCK (dc); in emit_discovererd_and_next()
1392 setup_next_uri_locked (dc); in emit_discovererd_and_next()
1399 discoverer_collect (GstDiscoverer * dc) in discoverer_collect() argument
1404 if (dc->priv->timeout_source) { in discoverer_collect()
1405 g_source_destroy (dc->priv->timeout_source); in discoverer_collect()
1406 g_source_unref (dc->priv->timeout_source); in discoverer_collect()
1407 dc->priv->timeout_source = NULL; in discoverer_collect()
1410 if (dc->priv->use_cache && dc->priv->current_info in discoverer_collect()
1411 && dc->priv->current_info->from_cache) { in discoverer_collect()
1412 GST_DEBUG_OBJECT (dc, in discoverer_collect()
1417 if (dc->priv->streams) { in discoverer_collect()
1420 GstElement *pipeline = (GstElement *) dc->priv->pipeline; in discoverer_collect()
1427 dc->priv->current_info->duration = (guint64) dur; in discoverer_collect()
1428 } else if (dc->priv->current_info->result != GST_DISCOVERER_ERROR) { in discoverer_collect()
1441 DISCO_LOCK (dc); in discoverer_collect()
1443 DISCO_UNLOCK (dc); in discoverer_collect()
1452 dc->priv->current_info->duration = (guint64) dur; in discoverer_collect()
1460 if (dc->priv->seeking_query) { in discoverer_collect()
1461 if (gst_element_query (pipeline, dc->priv->seeking_query)) { in discoverer_collect()
1465 gst_query_parse_seeking (dc->priv->seeking_query, &format, in discoverer_collect()
1469 dc->priv->current_info->seekable = seekable; in discoverer_collect()
1475 if (dc->priv->target_state == GST_STATE_PAUSED) in discoverer_collect()
1476 dc->priv->current_info->live = FALSE; in discoverer_collect()
1478 dc->priv->current_info->live = TRUE; in discoverer_collect()
1480 if (dc->priv->current_topology) { in discoverer_collect()
1481 dc->priv->current_info->stream_count = 1; in discoverer_collect()
1482 dc->priv->current_info->stream_info = parse_stream_topology (dc, in discoverer_collect()
1483 dc->priv->current_topology, NULL); in discoverer_collect()
1484 if (dc->priv->current_info->stream_info) in discoverer_collect()
1485 dc->priv->current_info->stream_info->stream_number = 0; in discoverer_collect()
1498 if (dc->priv->current_info->duration == 0 && in discoverer_collect()
1499 dc->priv->current_info->stream_info != NULL && in discoverer_collect()
1500 dc->priv->current_info->stream_info->next == NULL) { in discoverer_collect()
1504 stream_info = dc->priv->current_info->stream_info; in discoverer_collect()
1512 if (dc->priv->use_cache && dc->priv->current_info->cachefile && in discoverer_collect()
1513 dc->priv->current_info->result == GST_DISCOVERER_OK) { in discoverer_collect()
1514 GVariant *variant = gst_discoverer_info_to_variant (dc->priv->current_info, in discoverer_collect()
1517 g_file_set_contents (dc->priv->current_info->cachefile, in discoverer_collect()
1522 if (dc->priv->async) in discoverer_collect()
1523 emit_discovererd (dc); in discoverer_collect()
1542 handle_current_async (GstDiscoverer * dc) in handle_current_async() argument
1552 source = g_timeout_source_new (dc->priv->timeout / GST_MSECOND); in handle_current_async()
1553 g_source_set_callback_indirect (source, g_object_ref (dc), &cb_funcs); in handle_current_async()
1554 g_source_attach (source, dc->priv->ctx); in handle_current_async()
1555 dc->priv->timeout_source = source; in handle_current_async()
1561 handle_message (GstDiscoverer * dc, GstMessage * msg) in handle_message() argument
1577 dc->priv->current_error = gerr; in handle_message()
1585 if (dc->priv->current_info->result != GST_DISCOVERER_MISSING_PLUGINS || in handle_message()
1591 dc->priv->current_info->result = GST_DISCOVERER_ERROR; in handle_message()
1625 DISCO_LOCK (dc); in handle_message()
1626 if (dc->priv->pending_subtitle_pads == 0) in handle_message()
1627 done = dc->priv->no_more_pads in handle_message()
1628 && dc->priv->target_state == dc->priv->current_state; in handle_message()
1629 DISCO_UNLOCK (dc); in handle_message()
1640 if (GST_MESSAGE_SRC (msg) == (GstObject *) dc->priv->pipeline) { in handle_message()
1641 DISCO_LOCK (dc); in handle_message()
1642 dc->priv->current_state = new; in handle_message()
1644 if (dc->priv->pending_subtitle_pads == 0) in handle_message()
1645 done = dc->priv->no_more_pads in handle_message()
1646 && dc->priv->target_state == dc->priv->current_state; in handle_message()
1649 DISCO_UNLOCK (dc); in handle_message()
1669 dc->priv->current_info->result = GST_DISCOVERER_MISSING_PLUGINS; in handle_message()
1673 if (dc->priv->current_info->misc) in handle_message()
1674 gst_structure_free (dc->priv->current_info->misc); in handle_message()
1675 dc->priv->current_info->misc = gst_structure_copy (structure); in handle_message()
1676 g_ptr_array_add (dc->priv->current_info->missing_elements_details, in handle_message()
1679 if (dc->priv->current_topology) in handle_message()
1680 gst_structure_free (dc->priv->current_topology); in handle_message()
1681 dc->priv->current_topology = gst_structure_copy (structure); in handle_message()
1695 tmp = gst_tag_list_merge (dc->priv->all_tags, tl, GST_TAG_MERGE_APPEND); in handle_message()
1696 if (dc->priv->all_tags) in handle_message()
1697 gst_tag_list_unref (dc->priv->all_tags); in handle_message()
1698 dc->priv->all_tags = tmp; in handle_message()
1701 for (GList * curr = dc->priv->streams; curr; curr = curr->next) { in handle_message()
1714 gst_tag_list_merge (dc->priv->global_tags, tl, in handle_message()
1716 if (dc->priv->global_tags) in handle_message()
1717 gst_tag_list_unref (dc->priv->global_tags); in handle_message()
1718 dc->priv->global_tags = tmp; in handle_message()
1729 if (dc->priv->current_info->toc) in handle_message()
1730 gst_toc_unref (dc->priv->current_info->toc); in handle_message()
1731 dc->priv->current_info->toc = tmp; /* transfer ownership */ in handle_message()
1733 GST_PTR_FORMAT, dc->priv->current_info, tmp); in handle_message()
1743 GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (dc->priv->pipeline), in handle_message()
1750 handle_current_sync (GstDiscoverer * dc) in handle_current_sync() argument
1753 gdouble deadline = ((gdouble) dc->priv->timeout) / GST_SECOND; in handle_current_sync()
1763 if ((msg = gst_bus_timed_pop (dc->priv->bus, GST_SECOND / 2))) { in handle_current_sync()
1764 done = handle_message (dc, msg); in handle_current_sync()
1772 dc->priv->current_info->result = GST_DISCOVERER_TIMEOUT; in handle_current_sync()
1775 DISCO_LOCK (dc); in handle_current_sync()
1776 dc->priv->processing = FALSE; in handle_current_sync()
1777 DISCO_UNLOCK (dc); in handle_current_sync()
1787 _serialized_info_get_path (GstDiscoverer * dc, gchar * uri) in _serialized_info_get_path() argument
1796 GST_DEBUG_OBJECT (dc, "Can not work with serialized DiscovererInfo" in _serialized_info_get_path()
1804 GST_DEBUG_OBJECT (dc, "Could not get stat for file: %s", location); in _serialized_info_get_path()
1835 _get_info_from_cachefile (GstDiscoverer * dc, gchar * cachefile) in _get_info_from_cachefile() argument
1854 GST_INFO_OBJECT (dc, "Got info from cache: %p", info); in _get_info_from_cachefile()
1864 _setup_locked (GstDiscoverer * dc) in _setup_locked() argument
1867 gchar *uri = (gchar *) dc->priv->pending_uris->data; in _setup_locked()
1870 dc->priv->pending_uris = in _setup_locked()
1871 g_list_delete_link (dc->priv->pending_uris, dc->priv->pending_uris); in _setup_locked()
1873 if (dc->priv->use_cache) { in _setup_locked()
1874 cachefile = _serialized_info_get_path (dc, uri); in _setup_locked()
1876 dc->priv->current_info = _get_info_from_cachefile (dc, cachefile); in _setup_locked()
1878 if (dc->priv->current_info) { in _setup_locked()
1880 g_free (dc->priv->current_info->uri); in _setup_locked()
1881 dc->priv->current_info->uri = uri; in _setup_locked()
1883 dc->priv->current_info->cachefile = cachefile; in _setup_locked()
1884 dc->priv->processing = FALSE; in _setup_locked()
1885 dc->priv->target_state = GST_STATE_NULL; in _setup_locked()
1894 dc->priv->current_info = in _setup_locked()
1896 dc->priv->current_info->cachefile = cachefile; in _setup_locked()
1897 dc->priv->current_info->uri = uri; in _setup_locked()
1900 g_object_set (dc->priv->uridecodebin, "uri", dc->priv->current_info->uri, in _setup_locked()
1903 GST_DEBUG ("Current is now %s", dc->priv->current_info->uri); in _setup_locked()
1905 dc->priv->processing = TRUE; in _setup_locked()
1907 dc->priv->target_state = GST_STATE_PAUSED; in _setup_locked()
1910 DISCO_UNLOCK (dc); in _setup_locked()
1913 gst_element_set_state ((GstElement *) dc->priv->pipeline, in _setup_locked()
1914 dc->priv->target_state); in _setup_locked()
1918 dc->priv->target_state = GST_STATE_PLAYING; in _setup_locked()
1920 gst_element_set_state ((GstElement *) dc->priv->pipeline, in _setup_locked()
1921 dc->priv->target_state); in _setup_locked()
1923 DISCO_LOCK (dc); in _setup_locked()
1926 GST_DEBUG_OBJECT (dc, "Pipeline going to PAUSED : %s", in _setup_locked()
1933 discoverer_cleanup (GstDiscoverer * dc) in discoverer_cleanup() argument
1937 DISCO_LOCK (dc); in discoverer_cleanup()
1938 dc->priv->cleanup = TRUE; in discoverer_cleanup()
1939 DISCO_UNLOCK (dc); in discoverer_cleanup()
1941 gst_bus_set_flushing (dc->priv->bus, TRUE); in discoverer_cleanup()
1943 DISCO_LOCK (dc); in discoverer_cleanup()
1944 if (dc->priv->current_error) { in discoverer_cleanup()
1945 g_error_free (dc->priv->current_error); in discoverer_cleanup()
1946 DISCO_UNLOCK (dc); in discoverer_cleanup()
1947 gst_element_set_state ((GstElement *) dc->priv->pipeline, GST_STATE_NULL); in discoverer_cleanup()
1949 DISCO_UNLOCK (dc); in discoverer_cleanup()
1952 gst_element_set_state ((GstElement *) dc->priv->pipeline, GST_STATE_READY); in discoverer_cleanup()
1953 gst_bus_set_flushing (dc->priv->bus, FALSE); in discoverer_cleanup()
1955 DISCO_LOCK (dc); in discoverer_cleanup()
1956 dc->priv->current_error = NULL; in discoverer_cleanup()
1957 if (dc->priv->current_topology) { in discoverer_cleanup()
1958 gst_structure_free (dc->priv->current_topology); in discoverer_cleanup()
1959 dc->priv->current_topology = NULL; in discoverer_cleanup()
1962 dc->priv->current_info = NULL; in discoverer_cleanup()
1964 if (dc->priv->all_tags) { in discoverer_cleanup()
1965 gst_tag_list_unref (dc->priv->all_tags); in discoverer_cleanup()
1966 dc->priv->all_tags = NULL; in discoverer_cleanup()
1969 if (dc->priv->global_tags) { in discoverer_cleanup()
1970 gst_tag_list_unref (dc->priv->global_tags); in discoverer_cleanup()
1971 dc->priv->global_tags = NULL; in discoverer_cleanup()
1974 dc->priv->pending_subtitle_pads = 0; in discoverer_cleanup()
1976 dc->priv->current_state = GST_STATE_NULL; in discoverer_cleanup()
1977 dc->priv->target_state = GST_STATE_NULL; in discoverer_cleanup()
1978 dc->priv->no_more_pads = FALSE; in discoverer_cleanup()
1979 dc->priv->cleanup = FALSE; in discoverer_cleanup()
1983 if (dc->priv->async) { in discoverer_cleanup()
1984 setup_next_uri_locked (dc); in discoverer_cleanup()
1986 DISCO_UNLOCK (dc); in discoverer_cleanup()
1992 discoverer_bus_cb (GstBus * bus, GstMessage * msg, GstDiscoverer * dc) in discoverer_bus_cb() argument
1994 if (dc->priv->processing) { in discoverer_bus_cb()
1995 if (handle_message (dc, msg)) { in discoverer_bus_cb()
1998 DISCO_LOCK (dc); in discoverer_bus_cb()
1999 dc->priv->processing = FALSE; in discoverer_bus_cb()
2000 DISCO_UNLOCK (dc); in discoverer_bus_cb()
2001 discoverer_collect (dc); in discoverer_bus_cb()
2002 discoverer_cleanup (dc); in discoverer_bus_cb()
2008 async_timeout_cb (GstDiscoverer * dc) in async_timeout_cb() argument
2012 dc->priv->current_info->result = GST_DISCOVERER_TIMEOUT; in async_timeout_cb()
2013 dc->priv->processing = FALSE; in async_timeout_cb()
2014 discoverer_collect (dc); in async_timeout_cb()
2015 discoverer_cleanup (dc); in async_timeout_cb()
2027 start_discovering (GstDiscoverer * dc) in start_discovering() argument
2034 DISCO_LOCK (dc); in start_discovering()
2035 if (dc->priv->pending_uris == NULL) { in start_discovering()
2038 DISCO_UNLOCK (dc); in start_discovering()
2042 if (dc->priv->current_info != NULL) { in start_discovering()
2045 DISCO_UNLOCK (dc); in start_discovering()
2049 g_signal_emit (dc, gst_discoverer_signals[SIGNAL_STARTING], 0); in start_discovering()
2051 ready = _setup_locked (dc); in start_discovering()
2053 DISCO_UNLOCK (dc); in start_discovering()
2055 if (dc->priv->async) { in start_discovering()
2061 (GSourceFunc) emit_discovererd_and_next, gst_object_ref (dc), in start_discovering()
2063 g_source_attach (source, dc->priv->ctx); in start_discovering()
2067 handle_current_async (dc); in start_discovering()
2070 handle_current_sync (dc); in start_discovering()