mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 23:06:49 +00:00
gst/videobox/gstvideobox.c: Fix caps nego some more to get
Original commit message from CVS: 2005-10-17 Julien MOUTTE <julien@moutte.net> * gst/videobox/gstvideobox.c: (gst_video_box_transform_caps), (gst_video_box_get_unit_size): Fix caps nego some more to get AYUV output declared in transform_caps.
This commit is contained in:
parent
55fd6600e0
commit
22060a915c
3 changed files with 44 additions and 14 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2005-10-17 Julien MOUTTE <julien@moutte.net>
|
||||||
|
|
||||||
|
* gst/videobox/gstvideobox.c: (gst_video_box_transform_caps),
|
||||||
|
(gst_video_box_get_unit_size): Fix caps nego some more to get AYUV
|
||||||
|
output declared in transform_caps.
|
||||||
|
|
||||||
2005-10-17 Julien MOUTTE <julien@moutte.net>
|
2005-10-17 Julien MOUTTE <julien@moutte.net>
|
||||||
|
|
||||||
* ext/libpng/gstpngdec.c: (gst_pngdec_init): We use fixed caps.
|
* ext/libpng/gstpngdec.c: (gst_pngdec_init): We use fixed caps.
|
||||||
|
|
2
common
2
common
|
@ -1 +1 @@
|
||||||
Subproject commit 3a9d355b657cf710011aa1eaadd64f6723527e14
|
Subproject commit cf363b3ae6ce3c4a84a561e04ffc4e3b37435a61
|
|
@ -337,22 +337,46 @@ gst_video_box_transform_caps (GstBaseTransform * trans,
|
||||||
{
|
{
|
||||||
GstVideoBox *video_box;
|
GstVideoBox *video_box;
|
||||||
GstCaps *to;
|
GstCaps *to;
|
||||||
GstStructure *structure;
|
|
||||||
gint dir, i, tmp;
|
|
||||||
|
|
||||||
video_box = GST_VIDEO_BOX (trans);
|
video_box = GST_VIDEO_BOX (trans);
|
||||||
to = gst_caps_copy (from);
|
|
||||||
|
if (gst_caps_is_fixed (from)) {
|
||||||
|
GstCaps *to_ayuv, *to_i420;
|
||||||
|
GstStructure *structure;
|
||||||
|
gint width, height, dir;
|
||||||
|
gdouble fps;
|
||||||
|
|
||||||
dir = (direction == GST_PAD_SINK) ? -1 : 1;
|
dir = (direction == GST_PAD_SINK) ? -1 : 1;
|
||||||
|
|
||||||
/* FIXME, include AYUV */
|
structure = gst_caps_get_structure (from, 0);
|
||||||
for (i = 0; i < gst_caps_get_size (to); i++) {
|
|
||||||
structure = gst_caps_get_structure (to, i);
|
gst_structure_get_int (structure, "width", &width);
|
||||||
if (gst_structure_get_int (structure, "width", &tmp))
|
gst_structure_get_int (structure, "height", &height);
|
||||||
gst_structure_set (structure, "width", G_TYPE_INT,
|
gst_structure_get_double (structure, "framerate", &fps);
|
||||||
tmp + dir * (video_box->box_left + video_box->box_right), NULL);
|
|
||||||
if (gst_structure_get_int (structure, "height", &tmp))
|
width += dir * (video_box->box_left + video_box->box_right);
|
||||||
gst_structure_set (structure, "height", G_TYPE_INT,
|
height += dir * (video_box->box_top + video_box->box_bottom);
|
||||||
tmp + dir * (video_box->box_top + video_box->box_bottom), NULL);
|
|
||||||
|
to_i420 = gst_caps_new_simple ("video/x-raw-yuv",
|
||||||
|
"format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('I', '4', '2', '0'),
|
||||||
|
"width", G_TYPE_INT, width,
|
||||||
|
"height", G_TYPE_INT, height, "framerate", G_TYPE_DOUBLE, fps, NULL);
|
||||||
|
|
||||||
|
to_ayuv = 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);
|
||||||
|
to = to_i420;
|
||||||
|
gst_caps_append (to, to_ayuv);
|
||||||
|
} else {
|
||||||
|
GstPadTemplate *tmpl;
|
||||||
|
|
||||||
|
if (direction == GST_PAD_SINK) {
|
||||||
|
tmpl = gst_static_pad_template_get (&gst_video_box_src_template);
|
||||||
|
} else {
|
||||||
|
tmpl = gst_static_pad_template_get (&gst_video_box_sink_template);
|
||||||
|
}
|
||||||
|
to = gst_caps_copy (gst_pad_template_get_caps (tmpl));
|
||||||
}
|
}
|
||||||
|
|
||||||
return to;
|
return to;
|
||||||
|
|
Loading…
Reference in a new issue