mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-29 21:21:12 +00:00
uridecodebin3: Specify URI for INFO/WARNING/ERROR messages
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6929>
This commit is contained in:
parent
1f4c1c18ca
commit
686d980955
1 changed files with 39 additions and 0 deletions
|
@ -2205,6 +2205,39 @@ beach:
|
|||
return message;
|
||||
}
|
||||
|
||||
static GstMessage *
|
||||
update_message_with_uri (GstURIDecodeBin3 * uridecodebin, GstMessage * msg)
|
||||
{
|
||||
gchar *uri = NULL;
|
||||
gboolean unlock_after = FALSE;
|
||||
if (gst_object_has_as_ancestor (GST_MESSAGE_SRC (msg),
|
||||
(GstObject *) uridecodebin->decodebin)) {
|
||||
uri = uridecodebin->output_item->main_item->uri;
|
||||
} else {
|
||||
GstSourceHandler *handler;
|
||||
PLAY_ITEMS_LOCK (uridecodebin);
|
||||
unlock_after = TRUE;
|
||||
/* Find the matching handler (if any) */
|
||||
if ((handler = find_source_handler_for_element (uridecodebin, msg->src))) {
|
||||
uri = handler->play_item->main_item->uri;
|
||||
}
|
||||
}
|
||||
|
||||
if (uri) {
|
||||
GstStructure *details;
|
||||
msg = gst_message_make_writable (msg);
|
||||
details = gst_message_writable_details (msg);
|
||||
if (details) {
|
||||
gst_structure_set (details, "uri", G_TYPE_STRING, uri, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (unlock_after)
|
||||
PLAY_ITEMS_UNLOCK (uridecodebin);
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_uri_decode_bin3_handle_message (GstBin * bin, GstMessage * msg)
|
||||
{
|
||||
|
@ -2263,8 +2296,14 @@ gst_uri_decode_bin3_handle_message (GstBin * bin, GstMessage * msg)
|
|||
if (details && gst_structure_has_field (details, "redirect-location"))
|
||||
msg =
|
||||
gst_uri_decode_bin3_handle_redirection (uridecodebin, msg, details);
|
||||
if (msg)
|
||||
msg = update_message_with_uri (uridecodebin, msg);
|
||||
break;
|
||||
}
|
||||
case GST_MESSAGE_WARNING:
|
||||
case GST_MESSAGE_INFO:
|
||||
msg = update_message_with_uri (uridecodebin, msg);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue