GstXImageSink *ximagesink;
gboolean ret = TRUE;
GstStructure *structure;
- GstCaps *intersection;
const GValue *par;
gint new_width, new_height;
const GValue *fps;
GST_PTR_FORMAT, ximagesink->xcontext->caps, caps);
/* We intersect those caps with our template to make sure they are correct */
- intersection = gst_caps_intersect (ximagesink->xcontext->caps, caps);
- GST_DEBUG_OBJECT (ximagesink, "intersection returned %" GST_PTR_FORMAT,
- intersection);
- if (gst_caps_is_empty (intersection)) {
- gst_caps_unref (intersection);
- return FALSE;
- }
-
- gst_caps_unref (intersection);
+ if (!gst_caps_can_intersect (ximagesink->xcontext->caps, caps))
+ goto incompatible_caps;
structure = gst_caps_get_structure (caps, 0);
return TRUE;
/* ERRORS */
+incompatible_caps:
+ {
+ GST_ERROR_OBJECT (ximagesink, "caps incompatible");
+ return FALSE;
+ }
wrong_aspect:
{
GST_INFO_OBJECT (ximagesink, "pixel aspect ratio does not match");
GstXvImageFormat *format = list->data;
if (format) {
- GstCaps *icaps = NULL;
-
- icaps = gst_caps_intersect (caps, format->caps);
- if (!gst_caps_is_empty (icaps)) {
- gst_caps_unref (icaps);
+ if (gst_caps_can_intersect (caps, format->caps)) {
return format->format;
}
- gst_caps_unref (icaps);
}
list = g_list_next (list);
}
{
GstXvImageSink *xvimagesink;
GstStructure *structure;
- GstCaps *intersection;
guint32 im_format = 0;
gboolean ret;
gint video_width, video_height;
"In setcaps. Possible caps %" GST_PTR_FORMAT ", setting caps %"
GST_PTR_FORMAT, xvimagesink->xcontext->caps, caps);
- intersection = gst_caps_intersect (xvimagesink->xcontext->caps, caps);
- GST_DEBUG_OBJECT (xvimagesink, "intersection returned %" GST_PTR_FORMAT,
- intersection);
- if (gst_caps_is_empty (intersection))
+ if (!gst_caps_intersect (xvimagesink->xcontext->caps, caps))
goto incompatible_caps;
- gst_caps_unref (intersection);
-
structure = gst_caps_get_structure (caps, 0);
ret = gst_structure_get_int (structure, "width", &video_width);
ret &= gst_structure_get_int (structure, "height", &video_height);
incompatible_caps:
{
GST_ERROR_OBJECT (xvimagesink, "caps incompatible");
- gst_caps_unref (intersection);
return FALSE;
}
incomplete_caps: