mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
transcodebin: logs when inserting, or not, a filter
It's not easy atm to figure out from the logs if a filter has actually be inserted or not.
This commit is contained in:
parent
9575d835ba
commit
4b6164339f
1 changed files with 21 additions and 8 deletions
|
@ -106,15 +106,24 @@ _insert_filter (GstTranscodeBin * self, GstPad * sinkpad, GstPad * pad,
|
||||||
GstPad *filter_src = NULL, *filter_sink = NULL;
|
GstPad *filter_src = NULL, *filter_sink = NULL;
|
||||||
GstElement *filter = NULL;
|
GstElement *filter = NULL;
|
||||||
GstObject *filter_parent;
|
GstObject *filter_parent;
|
||||||
|
const gchar *media_type;
|
||||||
|
|
||||||
if (self->video_filter &&
|
media_type = gst_structure_get_name (gst_caps_get_structure (caps, 0));
|
||||||
!g_strcmp0 (gst_structure_get_name (gst_caps_get_structure (caps, 0)),
|
|
||||||
"video/x-raw")) {
|
if (self->video_filter && g_str_has_prefix (media_type, "video")) {
|
||||||
filter = self->video_filter;
|
if (!g_strcmp0 (media_type, "video/x-raw"))
|
||||||
} else if (self->audio_filter &&
|
filter = self->video_filter;
|
||||||
!g_strcmp0 (gst_structure_get_name (gst_caps_get_structure (caps, 0)),
|
else
|
||||||
"audio/x-raw")) {
|
GST_ERROR_OBJECT (pad, "decodebin pad does not produce raw data (%"
|
||||||
filter = self->audio_filter;
|
GST_PTR_FORMAT "), cannot add video filter '%s'", caps,
|
||||||
|
GST_ELEMENT_NAME (self->video_filter));
|
||||||
|
} else if (self->audio_filter && g_str_has_prefix (media_type, "audio")) {
|
||||||
|
if (!g_strcmp0 (media_type, "audio/x-raw"))
|
||||||
|
filter = self->audio_filter;
|
||||||
|
else
|
||||||
|
GST_ERROR_OBJECT (pad, "decodebin pad does not produce raw data (%"
|
||||||
|
GST_PTR_FORMAT "), cannot add audio filter '%s'", caps,
|
||||||
|
GST_ELEMENT_NAME (self->audio_filter));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!filter)
|
if (!filter)
|
||||||
|
@ -152,6 +161,10 @@ _insert_filter (GstTranscodeBin * self, GstPad * sinkpad, GstPad * pad,
|
||||||
|
|
||||||
gst_element_sync_state_with_parent (filter);
|
gst_element_sync_state_with_parent (filter);
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT (self, "added %s filter '%s'",
|
||||||
|
filter == self->video_filter ? "video" : "audio",
|
||||||
|
GST_ELEMENT_NAME (filter));
|
||||||
|
|
||||||
return filter_src;
|
return filter_src;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue