mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
videoscale: use can_intersect to avoid a caps copy
This commit is contained in:
parent
948d06e4b3
commit
4967d4e3fd
1 changed files with 2 additions and 5 deletions
|
@ -356,16 +356,13 @@ static int
|
||||||
gst_video_scale_get_format (GstCaps * caps)
|
gst_video_scale_get_format (GstCaps * caps)
|
||||||
{
|
{
|
||||||
gint i;
|
gint i;
|
||||||
GstCaps *icaps, *scaps;
|
GstCaps *scaps;
|
||||||
|
|
||||||
for (i = 0; i < G_N_ELEMENTS (gst_video_scale_format_caps); i++) {
|
for (i = 0; i < G_N_ELEMENTS (gst_video_scale_format_caps); i++) {
|
||||||
scaps = gst_static_caps_get (&gst_video_scale_format_caps[i]);
|
scaps = gst_static_caps_get (&gst_video_scale_format_caps[i]);
|
||||||
icaps = gst_caps_intersect (caps, scaps);
|
if (gst_caps_can_intersect (caps, scaps)) {
|
||||||
if (!gst_caps_is_empty (icaps)) {
|
|
||||||
gst_caps_unref (icaps);
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
gst_caps_unref (icaps);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in a new issue