summaryrefslogtreecommitdiffstats
path: root/gst/videobox
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2005-07-07 18:38:54 +0000
committerWim Taymans <wim.taymans@gmail.com>2005-07-07 18:38:54 +0000
commit48eb68a1d92d5fa76ec681e149e5db203bc8e4af (patch)
tree021cf82c394ef9f7770d9c73156fc34487bf9945 /gst/videobox
parent1970ac0fc79addbbb8087222e5a0c4ed7e9885bd (diff)
gst/videobox/gstvideobox.c: Logic was reversed. Needs some more fixes in the transform function to include AYUV output.
Original commit message from CVS: * gst/videobox/gstvideobox.c: (gst_video_box_init), (gst_video_box_transform_caps), (gst_video_box_set_caps): Logic was reversed. Needs some more fixes in the transform function to include AYUV output. Moved AYUV as prefered format.
Diffstat (limited to 'gst/videobox')
-rw-r--r--gst/videobox/gstvideobox.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/gst/videobox/gstvideobox.c b/gst/videobox/gstvideobox.c
index 05c9da7e..ec23d3d7 100644
--- a/gst/videobox/gstvideobox.c
+++ b/gst/videobox/gstvideobox.c
@@ -106,7 +106,7 @@ static GstStaticPadTemplate gst_video_box_src_template =
GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("{ I420, AYUV }"))
+ GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("{ AYUV, I420 }"))
);
static GstStaticPadTemplate gst_video_box_sink_template =
@@ -218,12 +218,15 @@ gst_video_box_init (GstVideoBox * video_box)
video_box->box_left = DEFAULT_LEFT;
video_box->box_top = DEFAULT_TOP;
video_box->box_bottom = DEFAULT_BOTTOM;
+ video_box->crop_right = 0;
+ video_box->crop_left = 0;
+ video_box->crop_top = 0;
+ video_box->crop_bottom = 0;
video_box->fill_type = DEFAULT_FILL_TYPE;
video_box->alpha = DEFAULT_ALPHA;
video_box->border_alpha = DEFAULT_BORDER_ALPHA;
}
-/* do we need this function? */
static void
gst_video_box_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
@@ -330,8 +333,9 @@ gst_video_box_transform_caps (GstBaseTransform * trans, GstPad * pad,
video_box = GST_VIDEO_BOX (trans);
to = gst_caps_copy (from);
- direction = (pad == trans->sinkpad) ? 1 : -1;
+ direction = (pad == trans->sinkpad) ? -1 : 1;
+ /* FIXME, include AYUV */
for (i = 0; i < gst_caps_get_size (to); i++) {
structure = gst_caps_get_structure (to, i);
if (gst_structure_get_int (structure, "width", &tmp))
@@ -351,6 +355,7 @@ gst_video_box_set_caps (GstBaseTransform * trans, GstCaps * in, GstCaps * out)
GstVideoBox *video_box;
GstStructure *structure;
gboolean ret;
+ guint32 fourcc = 0;
video_box = GST_VIDEO_BOX (trans);
@@ -361,6 +366,9 @@ gst_video_box_set_caps (GstBaseTransform * trans, GstCaps * in, GstCaps * out)
structure = gst_caps_get_structure (out, 0);
ret &= gst_structure_get_int (structure, "width", &video_box->out_width);
ret &= gst_structure_get_int (structure, "height", &video_box->out_height);
+ ret &= gst_structure_get_fourcc (structure, "format", &fourcc);
+
+ video_box->use_alpha = fourcc == GST_STR_FOURCC ("AYUV");
return ret;
}