mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
auto{audio,video}{src,sink}: use can_intersect to avoid a caps copy
This commit is contained in:
parent
0148a230ac
commit
899d03dcc6
4 changed files with 8 additions and 16 deletions
|
@ -243,7 +243,7 @@ gst_auto_audio_sink_find_best (GstAutoAudioSink * sink)
|
|||
GSList *errors = NULL;
|
||||
GstBus *bus = gst_bus_new ();
|
||||
GstPad *el_pad = NULL;
|
||||
GstCaps *el_caps = NULL, *intersect = NULL;
|
||||
GstCaps *el_caps = NULL;
|
||||
gboolean no_match = TRUE;
|
||||
|
||||
list = gst_registry_feature_filter (gst_registry_get_default (),
|
||||
|
@ -273,10 +273,8 @@ gst_auto_audio_sink_find_best (GstAutoAudioSink * sink)
|
|||
GST_DEBUG_OBJECT (sink,
|
||||
"Checking caps: %" GST_PTR_FORMAT " vs. %" GST_PTR_FORMAT,
|
||||
sink->filter_caps, el_caps);
|
||||
intersect = gst_caps_intersect (sink->filter_caps, el_caps);
|
||||
no_match = gst_caps_is_empty (intersect);
|
||||
no_match = !gst_caps_can_intersect (sink->filter_caps, el_caps);
|
||||
gst_caps_unref (el_caps);
|
||||
gst_caps_unref (intersect);
|
||||
|
||||
if (no_match) {
|
||||
GST_DEBUG_OBJECT (sink, "Incompatible caps");
|
||||
|
|
|
@ -244,7 +244,7 @@ gst_auto_audio_src_find_best (GstAutoAudioSrc * src)
|
|||
GSList *errors = NULL;
|
||||
GstBus *bus = gst_bus_new ();
|
||||
GstPad *el_pad = NULL;
|
||||
GstCaps *el_caps = NULL, *intersect = NULL;
|
||||
GstCaps *el_caps = NULL;
|
||||
gboolean no_match = TRUE;
|
||||
|
||||
list = gst_registry_feature_filter (gst_registry_get_default (),
|
||||
|
@ -274,10 +274,8 @@ gst_auto_audio_src_find_best (GstAutoAudioSrc * src)
|
|||
GST_DEBUG_OBJECT (src,
|
||||
"Checking caps: %" GST_PTR_FORMAT " vs. %" GST_PTR_FORMAT,
|
||||
src->filter_caps, el_caps);
|
||||
intersect = gst_caps_intersect (src->filter_caps, el_caps);
|
||||
no_match = gst_caps_is_empty (intersect);
|
||||
no_match = !gst_caps_can_intersect (src->filter_caps, el_caps);
|
||||
gst_caps_unref (el_caps);
|
||||
gst_caps_unref (intersect);
|
||||
|
||||
if (no_match) {
|
||||
GST_DEBUG_OBJECT (src, "Incompatible caps");
|
||||
|
|
|
@ -243,7 +243,7 @@ gst_auto_video_sink_find_best (GstAutoVideoSink * sink)
|
|||
GSList *errors = NULL;
|
||||
GstBus *bus = gst_bus_new ();
|
||||
GstPad *el_pad = NULL;
|
||||
GstCaps *el_caps = NULL, *intersect = NULL;
|
||||
GstCaps *el_caps = NULL;
|
||||
gboolean no_match = TRUE;
|
||||
|
||||
list = gst_registry_feature_filter (gst_registry_get_default (),
|
||||
|
@ -270,10 +270,8 @@ gst_auto_video_sink_find_best (GstAutoVideoSink * sink)
|
|||
GST_DEBUG_OBJECT (sink,
|
||||
"Checking caps: %" GST_PTR_FORMAT " vs. %" GST_PTR_FORMAT,
|
||||
sink->filter_caps, el_caps);
|
||||
intersect = gst_caps_intersect (sink->filter_caps, el_caps);
|
||||
no_match = gst_caps_is_empty (intersect);
|
||||
no_match = !gst_caps_can_intersect (sink->filter_caps, el_caps);
|
||||
gst_caps_unref (el_caps);
|
||||
gst_caps_unref (intersect);
|
||||
|
||||
if (no_match) {
|
||||
GST_DEBUG_OBJECT (sink, "Incompatible caps");
|
||||
|
|
|
@ -244,7 +244,7 @@ gst_auto_video_src_find_best (GstAutoVideoSrc * src)
|
|||
GSList *errors = NULL;
|
||||
GstBus *bus = gst_bus_new ();
|
||||
GstPad *el_pad = NULL;
|
||||
GstCaps *el_caps = NULL, *intersect = NULL;
|
||||
GstCaps *el_caps = NULL;
|
||||
gboolean no_match = TRUE;
|
||||
|
||||
list = gst_registry_feature_filter (gst_registry_get_default (),
|
||||
|
@ -271,10 +271,8 @@ gst_auto_video_src_find_best (GstAutoVideoSrc * src)
|
|||
GST_DEBUG_OBJECT (src,
|
||||
"Checking caps: %" GST_PTR_FORMAT " vs. %" GST_PTR_FORMAT,
|
||||
src->filter_caps, el_caps);
|
||||
intersect = gst_caps_intersect (src->filter_caps, el_caps);
|
||||
no_match = gst_caps_is_empty (intersect);
|
||||
no_match = !gst_caps_can_intersect (src->filter_caps, el_caps);
|
||||
gst_caps_unref (el_caps);
|
||||
gst_caps_unref (intersect);
|
||||
|
||||
if (no_match) {
|
||||
GST_DEBUG_OBJECT (src, "Incompatible caps");
|
||||
|
|
Loading…
Reference in a new issue