mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-18 05:16:05 +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>
|
||||
|
||||
* gst/videobox/gstvideobox.c: (gst_video_box_transform_caps),
|
||||
|
|
|
@ -138,18 +138,32 @@ static GstCaps *
|
|||
gst_alpha_color_transform_caps (GstBaseTransform * btrans,
|
||||
GstPadDirection direction, GstCaps * caps)
|
||||
{
|
||||
GstAlphaColor *alpha;
|
||||
GstCaps *result;
|
||||
GstAlphaColor *alpha = NULL;
|
||||
GstCaps *result = NULL;
|
||||
|
||||
alpha = GST_ALPHA_COLOR (btrans);
|
||||
|
||||
GST_DEBUG ("transforming direction %d caps %s", direction,
|
||||
gst_caps_to_string (caps));
|
||||
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, 16, 4096,
|
||||
"height", GST_TYPE_INT_RANGE, 16, 4096,
|
||||
"framerate", GST_TYPE_DOUBLE_RANGE, 0.0, G_MAXDOUBLE, NULL);
|
||||
if (gst_caps_is_fixed (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",
|
||||
"format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('A', 'Y', 'U', 'V'),
|
||||
"width", G_TYPE_INT, width,
|
||||
"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);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue