mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 15:08:53 +00:00
gst/alpha/gstalphacolor.c: Handle caps negotiation in a better way.
Original commit message from CVS: 2005-10-17 Julien MOUTTE <julien@moutte.net> * gst/alpha/gstalphacolor.c: (gst_alpha_color_transform_caps), (transform_rgb), (transform_bgr): Handle caps negotiation in a better way.
This commit is contained in:
parent
22060a915c
commit
1adfcec298
2 changed files with 29 additions and 9 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2005-10-17 Julien MOUTTE <julien@moutte.net>
|
||||||
|
|
||||||
|
* gst/alpha/gstalphacolor.c: (gst_alpha_color_transform_caps),
|
||||||
|
(transform_rgb), (transform_bgr): Handle caps negotiation in a better
|
||||||
|
way.
|
||||||
|
|
||||||
2005-10-17 Julien MOUTTE <julien@moutte.net>
|
2005-10-17 Julien MOUTTE <julien@moutte.net>
|
||||||
|
|
||||||
* gst/videobox/gstvideobox.c: (gst_video_box_transform_caps),
|
* gst/videobox/gstvideobox.c: (gst_video_box_transform_caps),
|
||||||
|
|
|
@ -138,18 +138,32 @@ static GstCaps *
|
||||||
gst_alpha_color_transform_caps (GstBaseTransform * btrans,
|
gst_alpha_color_transform_caps (GstBaseTransform * btrans,
|
||||||
GstPadDirection direction, GstCaps * caps)
|
GstPadDirection direction, GstCaps * caps)
|
||||||
{
|
{
|
||||||
GstAlphaColor *alpha;
|
GstAlphaColor *alpha = NULL;
|
||||||
GstCaps *result;
|
GstCaps *result = NULL;
|
||||||
|
|
||||||
alpha = GST_ALPHA_COLOR (btrans);
|
alpha = GST_ALPHA_COLOR (btrans);
|
||||||
|
|
||||||
GST_DEBUG ("transforming direction %d caps %s", direction,
|
if (gst_caps_is_fixed (caps)) {
|
||||||
gst_caps_to_string (caps));
|
GstStructure *structure = NULL;
|
||||||
|
gint width, height;
|
||||||
|
gdouble fps;
|
||||||
|
|
||||||
|
structure = gst_caps_get_structure (caps, 0);
|
||||||
|
gst_structure_get_int (structure, "width", &width);
|
||||||
|
gst_structure_get_int (structure, "height", &height);
|
||||||
|
gst_structure_get_double (structure, "framerate", &fps);
|
||||||
|
|
||||||
result = gst_caps_new_simple ("video/x-raw-yuv",
|
result = gst_caps_new_simple ("video/x-raw-yuv",
|
||||||
"format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('A', 'Y', 'U', 'V'),
|
"format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('A', 'Y', 'U', 'V'),
|
||||||
"width", GST_TYPE_INT_RANGE, 16, 4096,
|
"width", G_TYPE_INT, width,
|
||||||
"height", GST_TYPE_INT_RANGE, 16, 4096,
|
"height", G_TYPE_INT, height, "framerate", G_TYPE_DOUBLE, fps, NULL);
|
||||||
|
} else {
|
||||||
|
result = gst_caps_new_simple ("video/x-raw-yuv",
|
||||||
|
"format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('A', 'Y', 'U', 'V'),
|
||||||
|
"width", GST_TYPE_INT_RANGE, 1, G_MAXINT,
|
||||||
|
"height", GST_TYPE_INT_RANGE, 1, G_MAXINT,
|
||||||
"framerate", GST_TYPE_DOUBLE_RANGE, 0.0, G_MAXDOUBLE, NULL);
|
"framerate", GST_TYPE_DOUBLE_RANGE, 0.0, G_MAXDOUBLE, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue