From 48eb68a1d92d5fa76ec681e149e5db203bc8e4af Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 7 Jul 2005 18:38:54 +0000 Subject: 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. --- gst/videobox/gstvideobox.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'gst/videobox') 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; } -- cgit