Commit 899d03dc authored by Stefan Kost's avatar Stefan Kost
Browse files

auto{audio,video}{src,sink}: use can_intersect to avoid a caps copy

parent 0148a230
...@@ -243,7 +243,7 @@ gst_auto_audio_sink_find_best (GstAutoAudioSink * sink) ...@@ -243,7 +243,7 @@ gst_auto_audio_sink_find_best (GstAutoAudioSink * sink)
GSList *errors = NULL; GSList *errors = NULL;
GstBus *bus = gst_bus_new (); GstBus *bus = gst_bus_new ();
GstPad *el_pad = NULL; GstPad *el_pad = NULL;
GstCaps *el_caps = NULL, *intersect = NULL; GstCaps *el_caps = NULL;
gboolean no_match = TRUE; gboolean no_match = TRUE;
list = gst_registry_feature_filter (gst_registry_get_default (), list = gst_registry_feature_filter (gst_registry_get_default (),
...@@ -273,10 +273,8 @@ gst_auto_audio_sink_find_best (GstAutoAudioSink * sink) ...@@ -273,10 +273,8 @@ gst_auto_audio_sink_find_best (GstAutoAudioSink * sink)
GST_DEBUG_OBJECT (sink, GST_DEBUG_OBJECT (sink,
"Checking caps: %" GST_PTR_FORMAT " vs. %" GST_PTR_FORMAT, "Checking caps: %" GST_PTR_FORMAT " vs. %" GST_PTR_FORMAT,
sink->filter_caps, el_caps); sink->filter_caps, el_caps);
intersect = gst_caps_intersect (sink->filter_caps, el_caps); no_match = !gst_caps_can_intersect (sink->filter_caps, el_caps);
no_match = gst_caps_is_empty (intersect);
gst_caps_unref (el_caps); gst_caps_unref (el_caps);
gst_caps_unref (intersect);
if (no_match) { if (no_match) {
GST_DEBUG_OBJECT (sink, "Incompatible caps"); GST_DEBUG_OBJECT (sink, "Incompatible caps");
......
...@@ -244,7 +244,7 @@ gst_auto_audio_src_find_best (GstAutoAudioSrc * src) ...@@ -244,7 +244,7 @@ gst_auto_audio_src_find_best (GstAutoAudioSrc * src)
GSList *errors = NULL; GSList *errors = NULL;
GstBus *bus = gst_bus_new (); GstBus *bus = gst_bus_new ();
GstPad *el_pad = NULL; GstPad *el_pad = NULL;
GstCaps *el_caps = NULL, *intersect = NULL; GstCaps *el_caps = NULL;
gboolean no_match = TRUE; gboolean no_match = TRUE;
list = gst_registry_feature_filter (gst_registry_get_default (), list = gst_registry_feature_filter (gst_registry_get_default (),
...@@ -274,10 +274,8 @@ gst_auto_audio_src_find_best (GstAutoAudioSrc * src) ...@@ -274,10 +274,8 @@ gst_auto_audio_src_find_best (GstAutoAudioSrc * src)
GST_DEBUG_OBJECT (src, GST_DEBUG_OBJECT (src,
"Checking caps: %" GST_PTR_FORMAT " vs. %" GST_PTR_FORMAT, "Checking caps: %" GST_PTR_FORMAT " vs. %" GST_PTR_FORMAT,
src->filter_caps, el_caps); src->filter_caps, el_caps);
intersect = gst_caps_intersect (src->filter_caps, el_caps); no_match = !gst_caps_can_intersect (src->filter_caps, el_caps);
no_match = gst_caps_is_empty (intersect);
gst_caps_unref (el_caps); gst_caps_unref (el_caps);
gst_caps_unref (intersect);
if (no_match) { if (no_match) {
GST_DEBUG_OBJECT (src, "Incompatible caps"); GST_DEBUG_OBJECT (src, "Incompatible caps");
......
...@@ -243,7 +243,7 @@ gst_auto_video_sink_find_best (GstAutoVideoSink * sink) ...@@ -243,7 +243,7 @@ gst_auto_video_sink_find_best (GstAutoVideoSink * sink)
GSList *errors = NULL; GSList *errors = NULL;
GstBus *bus = gst_bus_new (); GstBus *bus = gst_bus_new ();
GstPad *el_pad = NULL; GstPad *el_pad = NULL;
GstCaps *el_caps = NULL, *intersect = NULL; GstCaps *el_caps = NULL;
gboolean no_match = TRUE; gboolean no_match = TRUE;
list = gst_registry_feature_filter (gst_registry_get_default (), list = gst_registry_feature_filter (gst_registry_get_default (),
...@@ -270,10 +270,8 @@ gst_auto_video_sink_find_best (GstAutoVideoSink * sink) ...@@ -270,10 +270,8 @@ gst_auto_video_sink_find_best (GstAutoVideoSink * sink)
GST_DEBUG_OBJECT (sink, GST_DEBUG_OBJECT (sink,
"Checking caps: %" GST_PTR_FORMAT " vs. %" GST_PTR_FORMAT, "Checking caps: %" GST_PTR_FORMAT " vs. %" GST_PTR_FORMAT,
sink->filter_caps, el_caps); sink->filter_caps, el_caps);
intersect = gst_caps_intersect (sink->filter_caps, el_caps); no_match = !gst_caps_can_intersect (sink->filter_caps, el_caps);
no_match = gst_caps_is_empty (intersect);
gst_caps_unref (el_caps); gst_caps_unref (el_caps);
gst_caps_unref (intersect);
if (no_match) { if (no_match) {
GST_DEBUG_OBJECT (sink, "Incompatible caps"); GST_DEBUG_OBJECT (sink, "Incompatible caps");
......
...@@ -244,7 +244,7 @@ gst_auto_video_src_find_best (GstAutoVideoSrc * src) ...@@ -244,7 +244,7 @@ gst_auto_video_src_find_best (GstAutoVideoSrc * src)
GSList *errors = NULL; GSList *errors = NULL;
GstBus *bus = gst_bus_new (); GstBus *bus = gst_bus_new ();
GstPad *el_pad = NULL; GstPad *el_pad = NULL;
GstCaps *el_caps = NULL, *intersect = NULL; GstCaps *el_caps = NULL;
gboolean no_match = TRUE; gboolean no_match = TRUE;
list = gst_registry_feature_filter (gst_registry_get_default (), list = gst_registry_feature_filter (gst_registry_get_default (),
...@@ -271,10 +271,8 @@ gst_auto_video_src_find_best (GstAutoVideoSrc * src) ...@@ -271,10 +271,8 @@ gst_auto_video_src_find_best (GstAutoVideoSrc * src)
GST_DEBUG_OBJECT (src, GST_DEBUG_OBJECT (src,
"Checking caps: %" GST_PTR_FORMAT " vs. %" GST_PTR_FORMAT, "Checking caps: %" GST_PTR_FORMAT " vs. %" GST_PTR_FORMAT,
src->filter_caps, el_caps); src->filter_caps, el_caps);
intersect = gst_caps_intersect (src->filter_caps, el_caps); no_match = !gst_caps_can_intersect (src->filter_caps, el_caps);
no_match = gst_caps_is_empty (intersect);
gst_caps_unref (el_caps); gst_caps_unref (el_caps);
gst_caps_unref (intersect);
if (no_match) { if (no_match) {
GST_DEBUG_OBJECT (src, "Incompatible caps"); GST_DEBUG_OBJECT (src, "Incompatible caps");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment