mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-22 17:51:16 +00:00
decodebin3: Include the stream-id in ERROR/WARNING/INFO messages
Allows application and other users to know to which stream the error/warning/info message originated from. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6964>
This commit is contained in:
parent
fd21d97060
commit
cb95ba72cf
1 changed files with 22 additions and 0 deletions
|
@ -2899,6 +2899,28 @@ gst_decodebin3_handle_message (GstBin * bin, GstMessage * message)
|
|||
}
|
||||
SELECTION_UNLOCK (dbin);
|
||||
}
|
||||
case GST_MESSAGE_WARNING:
|
||||
case GST_MESSAGE_ERROR:
|
||||
case GST_MESSAGE_INFO:
|
||||
{
|
||||
GList *tmp;
|
||||
/* Add the relevant stream-id if the message comes from a decoder */
|
||||
for (tmp = dbin->output_streams; tmp; tmp = tmp->next) {
|
||||
DecodebinOutputStream *out = tmp->data;
|
||||
GstStructure *structure;
|
||||
if (out->decoder
|
||||
&& (GST_MESSAGE_SRC (message) == (GstObject *) out->decoder
|
||||
|| gst_object_has_as_ancestor (GST_MESSAGE_SRC (message),
|
||||
(GstObject *) out->decoder))) {
|
||||
message = gst_message_make_writable (message);
|
||||
structure = gst_message_writable_details (message);
|
||||
gst_structure_set (structure, "stream-id", G_TYPE_STRING,
|
||||
out->slot->active_stream_id, NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue