summaryrefslogtreecommitdiffstats
path: root/gst/videobox
diff options
context:
space:
mode:
authorThomas Vander Stichele <thomas@apestaart.org>2005-08-24 13:34:05 +0000
committerThomas Vander Stichele <thomas@apestaart.org>2005-08-24 13:34:05 +0000
commit122cdbe814439efa81ba807f0d43caea2e012423 (patch)
tree3e4cf362dc2c2bf24c35c21ae7ba9957b4a7230e /gst/videobox
parent05f75a3c66c7d293308281a43cf847ed97081b27 (diff)
enable more; update for basetransform
Original commit message from CVS: enable more; update for basetransform
Diffstat (limited to 'gst/videobox')
-rw-r--r--gst/videobox/gstvideobox.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/gst/videobox/gstvideobox.c b/gst/videobox/gstvideobox.c
index 9b53078d..f1ebe4d9 100644
--- a/gst/videobox/gstvideobox.c
+++ b/gst/videobox/gstvideobox.c
@@ -126,10 +126,11 @@ static void gst_video_box_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
static GstCaps *gst_video_box_transform_caps (GstBaseTransform * trans,
- GstPad * pad, GstCaps * from);
+ GstPadDirection direction, GstCaps * from);
static gboolean gst_video_box_set_caps (GstBaseTransform * trans,
GstCaps * in, GstCaps * out);
-static guint gst_video_box_get_size (GstBaseTransform * trans, GstCaps * caps);
+static gboolean gst_video_box_get_unit_size (GstBaseTransform * trans,
+ GstCaps * caps, guint * size);
static GstFlowReturn gst_video_box_transform (GstBaseTransform * trans,
GstBuffer * in, GstBuffer * out);
@@ -209,7 +210,7 @@ gst_video_box_class_init (GstVideoBoxClass * klass)
trans_class->transform_caps = gst_video_box_transform_caps;
trans_class->set_caps = gst_video_box_set_caps;
- trans_class->get_size = gst_video_box_get_size;
+ trans_class->get_unit_size = gst_video_box_get_unit_size;
trans_class->transform = gst_video_box_transform;
}
@@ -325,17 +326,17 @@ gst_video_box_get_property (GObject * object, guint prop_id, GValue * value,
}
static GstCaps *
-gst_video_box_transform_caps (GstBaseTransform * trans, GstPad * pad,
- GstCaps * from)
+gst_video_box_transform_caps (GstBaseTransform * trans,
+ GstPadDirection direction, GstCaps * from)
{
GstVideoBox *video_box;
GstCaps *to;
GstStructure *structure;
- gint direction, i, tmp;
+ gint dir, i, tmp;
video_box = GST_VIDEO_BOX (trans);
to = gst_caps_copy (from);
- direction = (pad == trans->sinkpad) ? -1 : 1;
+ dir = (direction == GST_PAD_SINK) ? -1 : 1;
/* FIXME, include AYUV */
for (i = 0; i < gst_caps_get_size (to); i++) {
@@ -390,25 +391,26 @@ gst_video_box_set_caps (GstBaseTransform * trans, GstCaps * in, GstCaps * out)
#define GST_VIDEO_I420_SIZE(w,h) (GST_VIDEO_I420_V_OFFSET(w,h)+(GST_VIDEO_I420_V_ROWSTRIDE(w)*ROUND_UP_2(h)/2))
-static guint
-gst_video_box_get_size (GstBaseTransform * trans, GstCaps * caps)
+static gboolean
+gst_video_box_get_unit_size (GstBaseTransform * trans, GstCaps * caps,
+ guint * size)
{
- guint size = -1;
GstVideoBox *video_box;
+ g_return_val_if_fail (size, FALSE);
video_box = GST_VIDEO_BOX (trans);
if (gst_caps_is_equal (caps, GST_PAD_CAPS (trans->sinkpad))) {
- size = GST_VIDEO_I420_SIZE (video_box->in_width, video_box->in_height);
+ *size = GST_VIDEO_I420_SIZE (video_box->in_width, video_box->in_height);
} else if (gst_caps_is_equal (caps, GST_PAD_CAPS (trans->srcpad))) {
if (video_box->use_alpha) {
- size = video_box->out_height * video_box->out_height * 4;
+ *size = video_box->out_height * video_box->out_height * 4;
} else {
- size = GST_VIDEO_I420_SIZE (video_box->out_width, video_box->out_height);
+ *size = GST_VIDEO_I420_SIZE (video_box->out_width, video_box->out_height);
}
}
- return size;
+ return TRUE;
}
static int yuv_colors_Y[] = { 16, 150, 29 };