From 7d10d86635aa66c881e32fd72c8511ec4a187f09 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Thu, 4 Aug 2005 19:52:32 +0000 Subject: [PATCH] gst/videoscale/gstvideoscale.c (gst_videoscale_get_size): gst/ffmpegcolorspace/gstffmpegcolorspace.c Original commit message from CVS: 2005-08-04 Andy Wingo * gst/videoscale/gstvideoscale.c (gst_videoscale_get_size): * gst/ffmpegcolorspace/gstffmpegcolorspace.c (gst_ffmpegcsp_get_size): Adapt to API changes. * gst/videoscale/gstvideoscale.c (gst_videoscale_transform_ip): Implement an in-place do-nothing transform. --- ChangeLog | 9 +++++++++ docs/libs/tmpl/gstcolorbalance.sgml | 9 +++++++++ docs/libs/tmpl/gstmixer.sgml | 6 ------ gst/ffmpegcolorspace/gstffmpegcolorspace.c | 12 ++++++++---- gst/videoscale/gstvideoscale.c | 20 +++++++++++++++++--- 5 files changed, 43 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 019c89eecb..73eb6b0fb9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-08-04 Andy Wingo + + * gst/videoscale/gstvideoscale.c (gst_videoscale_get_size): + * gst/ffmpegcolorspace/gstffmpegcolorspace.c + (gst_ffmpegcsp_get_size): Adapt to API changes. + + * gst/videoscale/gstvideoscale.c (gst_videoscale_transform_ip): + Implement an in-place do-nothing transform. + 2005-08-04 Ronald S. Bultje * sys/ximage/ximagesink.c: (gst_ximagesink_ximage_put), diff --git a/docs/libs/tmpl/gstcolorbalance.sgml b/docs/libs/tmpl/gstcolorbalance.sgml index 6190e66544..59fb98aa53 100644 --- a/docs/libs/tmpl/gstcolorbalance.sgml +++ b/docs/libs/tmpl/gstcolorbalance.sgml @@ -23,6 +23,15 @@ interface for elements that provide color balance operations + + + + + +@gstcolorbalance: the object which received the signal. +@arg1: +@arg2: + diff --git a/docs/libs/tmpl/gstmixer.sgml b/docs/libs/tmpl/gstmixer.sgml index 8c2e0e2ab9..1260283781 100644 --- a/docs/libs/tmpl/gstmixer.sgml +++ b/docs/libs/tmpl/gstmixer.sgml @@ -48,18 +48,12 @@ gstmixer -@parent: -@values: -@_gst_reserved: -@parent: -@label: -@flags: diff --git a/gst/ffmpegcolorspace/gstffmpegcolorspace.c b/gst/ffmpegcolorspace/gstffmpegcolorspace.c index 383be87932..266b8d16b6 100644 --- a/gst/ffmpegcolorspace/gstffmpegcolorspace.c +++ b/gst/ffmpegcolorspace/gstffmpegcolorspace.c @@ -91,7 +91,7 @@ static void gst_ffmpegcsp_init (GstFFMpegCsp * space); static gboolean gst_ffmpegcsp_set_caps (GstBaseTransform * btrans, GstCaps * incaps, GstCaps * outcaps); -static guint gst_ffmpegcsp_get_size (GstBaseTransform * btrans); +static guint gst_ffmpegcsp_get_size (GstBaseTransform * btrans, GstCaps * caps); static GstFlowReturn gst_ffmpegcsp_transform (GstBaseTransform * btrans, GstBuffer * inbuf, GstBuffer * outbuf); static GstFlowReturn gst_ffmpegcsp_transform_ip @@ -311,13 +311,17 @@ gst_ffmpegcsp_init (GstFFMpegCsp * space) } static guint -gst_ffmpegcsp_get_size (GstBaseTransform * btrans) +gst_ffmpegcsp_get_size (GstBaseTransform * btrans, GstCaps * caps) { GstFFMpegCsp *space; - guint size; + guint size = -1; space = GST_FFMPEGCSP (btrans); - size = avpicture_get_size (space->to_pixfmt, space->width, space->height); + if (gst_caps_is_equal (caps, GST_PAD_CAPS (btrans->srcpad))) { + size = avpicture_get_size (space->to_pixfmt, space->width, space->height); + } else if (gst_caps_is_equal (caps, GST_PAD_CAPS (btrans->sinkpad))) { + size = avpicture_get_size (space->from_pixfmt, space->width, space->height); + } return size; } diff --git a/gst/videoscale/gstvideoscale.c b/gst/videoscale/gstvideoscale.c index a08e5568a9..1d11f26d7c 100644 --- a/gst/videoscale/gstvideoscale.c +++ b/gst/videoscale/gstvideoscale.c @@ -149,7 +149,9 @@ static GstCaps *gst_videoscale_transform_caps (GstBaseTransform * trans, GstPad * pad, GstCaps * caps); static gboolean gst_videoscale_set_caps (GstBaseTransform * trans, GstCaps * in, GstCaps * out); -static guint gst_videoscale_get_size (GstBaseTransform * trans); +static guint gst_videoscale_get_size (GstBaseTransform * trans, GstCaps * caps); +static GstFlowReturn gst_videoscale_transform_ip (GstBaseTransform * trans, + GstBuffer * in); static GstFlowReturn gst_videoscale_transform (GstBaseTransform * trans, GstBuffer * in, GstBuffer * out); @@ -218,6 +220,7 @@ gst_videoscale_class_init (GstVideoscaleClass * klass) trans_class->transform_caps = gst_videoscale_transform_caps; trans_class->set_caps = gst_videoscale_set_caps; trans_class->get_size = gst_videoscale_get_size; + trans_class->transform_ip = gst_videoscale_transform_ip; trans_class->transform = gst_videoscale_transform; parent_class = g_type_class_peek_parent (klass); @@ -421,15 +424,20 @@ gst_videoscale_prepare_sizes (GstVideoscale * videoscale, VSImage * src, } static guint -gst_videoscale_get_size (GstBaseTransform * trans) +gst_videoscale_get_size (GstBaseTransform * trans, GstCaps * caps) { GstVideoscale *videoscale; VSImage dest; VSImage src; + guint size = -1; videoscale = GST_VIDEOSCALE (trans); - return (guint) gst_videoscale_prepare_sizes (videoscale, &src, &dest, TRUE); + if (gst_caps_is_equal (caps, GST_PAD_CAPS (trans->srcpad))) + size = gst_videoscale_prepare_sizes (videoscale, &src, &dest, TRUE); + /* don't have an easy way of getting the size on the sink side for now... */ + + return size; } static void @@ -462,6 +470,12 @@ gst_videoscale_prepare_images (GstVideoscale * videoscale, GstBuffer * in, } } +static GstFlowReturn +gst_videoscale_transform_ip (GstBaseTransform * trans, GstBuffer * in) +{ + return GST_FLOW_OK; +} + static GstFlowReturn gst_videoscale_transform (GstBaseTransform * trans, GstBuffer * in, GstBuffer * out)