mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
sys/: Check the caps against our xcontext caps.
Original commit message from CVS: 2005-10-24 Julien MOUTTE <julien@moutte.net> * sys/ximage/ximagesink.c: (gst_ximagesink_setcaps): * sys/xvimage/xvimagesink.c: (gst_xvimagesink_setcaps): Check the caps against our xcontext caps.
This commit is contained in:
parent
a878cbdfe1
commit
d69cf5631a
3 changed files with 26 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2005-10-24 Julien MOUTTE <julien@moutte.net>
|
||||||
|
|
||||||
|
* sys/ximage/ximagesink.c: (gst_ximagesink_setcaps):
|
||||||
|
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_setcaps): Check
|
||||||
|
the caps against our xcontext caps.
|
||||||
|
|
||||||
2005-10-24 Wim Taymans <wim@fluendo.com>
|
2005-10-24 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
* gst-libs/gst/audio/gstbaseaudiosink.c:
|
* gst-libs/gst/audio/gstbaseaudiosink.c:
|
||||||
|
|
|
@ -1053,6 +1053,7 @@ gst_ximagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
||||||
GstXImageSink *ximagesink;
|
GstXImageSink *ximagesink;
|
||||||
gboolean ret = TRUE;
|
gboolean ret = TRUE;
|
||||||
GstStructure *structure;
|
GstStructure *structure;
|
||||||
|
GstCaps *intersection;
|
||||||
const GValue *par;
|
const GValue *par;
|
||||||
gint new_width, new_height;
|
gint new_width, new_height;
|
||||||
|
|
||||||
|
@ -1065,6 +1066,15 @@ gst_ximagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
||||||
"sinkconnect possible caps %" GST_PTR_FORMAT " with given caps %"
|
"sinkconnect possible caps %" GST_PTR_FORMAT " with given caps %"
|
||||||
GST_PTR_FORMAT, ximagesink->xcontext->caps, caps);
|
GST_PTR_FORMAT, ximagesink->xcontext->caps, caps);
|
||||||
|
|
||||||
|
intersection = gst_caps_intersect (ximagesink->xcontext->caps, caps);
|
||||||
|
GST_DEBUG_OBJECT (ximagesink, "intersection returned %" GST_PTR_FORMAT,
|
||||||
|
intersection);
|
||||||
|
if (gst_caps_is_empty (intersection)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
gst_caps_unref (intersection);
|
||||||
|
|
||||||
structure = gst_caps_get_structure (caps, 0);
|
structure = gst_caps_get_structure (caps, 0);
|
||||||
|
|
||||||
/* We used to only get the new width and height if we don't
|
/* We used to only get the new width and height if we don't
|
||||||
|
|
|
@ -1300,6 +1300,7 @@ gst_xvimagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
||||||
{
|
{
|
||||||
GstXvImageSink *xvimagesink;
|
GstXvImageSink *xvimagesink;
|
||||||
GstStructure *structure;
|
GstStructure *structure;
|
||||||
|
GstCaps *intersection;
|
||||||
guint32 im_format = 0;
|
guint32 im_format = 0;
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
gint video_width, video_height;
|
gint video_width, video_height;
|
||||||
|
@ -1315,6 +1316,15 @@ gst_xvimagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
||||||
"In setcaps. Possible caps %" GST_PTR_FORMAT ", setting caps %"
|
"In setcaps. Possible caps %" GST_PTR_FORMAT ", setting caps %"
|
||||||
GST_PTR_FORMAT, xvimagesink->xcontext->caps, 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)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
gst_caps_unref (intersection);
|
||||||
|
|
||||||
structure = gst_caps_get_structure (caps, 0);
|
structure = gst_caps_get_structure (caps, 0);
|
||||||
ret = gst_structure_get_int (structure, "width", &video_width);
|
ret = gst_structure_get_int (structure, "width", &video_width);
|
||||||
ret &= gst_structure_get_int (structure, "height", &video_height);
|
ret &= gst_structure_get_int (structure, "height", &video_height);
|
||||||
|
|
Loading…
Reference in a new issue