decodebin3: Do not try to plug a decoder on raw formats

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3123>
This commit is contained in:
Thibault Saunier 2022-10-03 15:20:53 -03:00 committed by GStreamer Marge Bot
parent c9f12b5086
commit 31acfcd875
3 changed files with 24 additions and 3 deletions

View file

@ -943,6 +943,7 @@ validate.test.mp4.qtdemux_reverse_playback_full_gop.reverse_playback_full_gop
validate.test.mp4.redirect.play_15s
validate.test.nle.urisource.play
validate.test.playbin.check_active_stream
validate.test.playbin3.ignore_raw_audio_from_demuxer
validate.test.playbin3.sourcebin_check_mixed_static_and_dyanmic_pads
validate.test.rtp.h264.payloader_fail_nego_force_profile
validate.test.rtp.h264.payloader_nego_profile

View file

@ -0,0 +1,10 @@
set-globals, media_dir="$(test_dir)/../../../medias/"
meta,
handles-states=true,
args = {
"uridecodebin3 uri=\"file://$(media_dir)/defaults/mp4/raw_h264.0.mp4\" caps=video/x-raw ! $(videosink) ",
}
pause
stop

View file

@ -197,6 +197,16 @@ check_parser_caps_filter (GstDecodebin3 * dbin, GstCaps * caps)
{
GList *tmp;
gboolean res = FALSE;
GstCaps *default_raw = gst_static_caps_get (&default_raw_caps);
if (gst_caps_can_intersect (caps, default_raw)) {
GST_INFO_OBJECT (dbin, "Dealing with raw stream from the demuxer, "
" we can handle them even if we won't expose then");
gst_caps_unref (default_raw);
return TRUE;
}
gst_caps_unref (default_raw);
g_mutex_lock (&dbin->factories_lock);
gst_decode_bin_update_factories_list (dbin);
@ -223,7 +233,7 @@ check_parser_caps_filter (GstDecodebin3 * dbin, GstCaps * caps)
}
beach:
g_mutex_unlock (&dbin->factories_lock);
GST_DEBUG_OBJECT (dbin, "Can intersect : %d", res);
GST_DEBUG_OBJECT (dbin, "Can intersect %" GST_PTR_FORMAT ": %d", caps, res);
return res;
}
@ -341,9 +351,9 @@ parse_chain_output_probe (GstPad * pad, GstPadProbeInfo * info,
GstCaps *prop = NULL;
gst_query_parse_accept_caps (q, &prop);
/* Fast check against target caps */
if (gst_caps_can_intersect (prop, input->dbin->caps))
if (gst_caps_can_intersect (prop, input->dbin->caps)) {
gst_query_set_accept_caps_result (q, TRUE);
else {
} else {
gboolean accepted = check_parser_caps_filter (input->dbin, prop);
/* check against caps filter */
gst_query_set_accept_caps_result (q, accepted);