diff options
author | David Schleef <ds@schleef.org> | 2002-09-15 21:38:28 +0000 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2002-09-15 21:38:28 +0000 |
commit | 4f5c32f1400ff11280d4ffb18b04eeac1a98aa9c (patch) | |
tree | 0308f97212eb504d91dca62eb6f51fbc86981072 | |
parent | c5d1baf05a956b7b8b23731a27dc5bc41ff5a9e0 (diff) | |
download | gstreamer-plugins-base-4f5c32f1400ff11280d4ffb18b04eeac1a98aa9c.tar.gz |
If output size == input size, just pass through buffer
Original commit message from CVS:
If output size == input size, just pass through buffer
-rw-r--r-- | gst/videoscale/gstvideoscale.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/gst/videoscale/gstvideoscale.c b/gst/videoscale/gstvideoscale.c index e5bf9124a..269d49d3f 100644 --- a/gst/videoscale/gstvideoscale.c +++ b/gst/videoscale/gstvideoscale.c @@ -266,22 +266,27 @@ GST_DEBUG(0,"size=%ld from=%dx%d to=%dx%d newsize=%d", videoscale->targetwidth, videoscale->targetheight, videoscale->targetwidth*videoscale->targetheight + videoscale->targetwidth*videoscale->targetheight/2); - outbuf = gst_buffer_new(); - /* XXX this is wrong for anything but I420 */ - GST_BUFFER_SIZE(outbuf) = videoscale->targetwidth*videoscale->targetheight + + if(videoscale->targetwidth==videoscale->width && + videoscale->targetheight==videoscale->height){ + gst_pad_push(videoscale->srcpad, buf); + }else{ + outbuf = gst_buffer_new(); + /* XXX this is wrong for anything but I420 */ + GST_BUFFER_SIZE(outbuf) = videoscale->targetwidth*videoscale->targetheight + videoscale->targetwidth*videoscale->targetheight/2; - GST_BUFFER_DATA(outbuf) = g_malloc (videoscale->targetwidth*videoscale->targetheight*2); - GST_BUFFER_TIMESTAMP(outbuf) = GST_BUFFER_TIMESTAMP(buf); + GST_BUFFER_DATA(outbuf) = g_malloc (videoscale->targetwidth*videoscale->targetheight*2); + GST_BUFFER_TIMESTAMP(outbuf) = GST_BUFFER_TIMESTAMP(buf); - /*g_return_if_fail(videoscale->scale_cc != NULL); */ - videoscale->scale_cc(videoscale, data, GST_BUFFER_DATA(outbuf)); + /*g_return_if_fail(videoscale->scale_cc != NULL); */ + videoscale->scale_cc(videoscale, data, GST_BUFFER_DATA(outbuf)); - GST_DEBUG (0,"gst_videoscale_chain: pushing buffer of %d bytes in '%s'",GST_BUFFER_SIZE(outbuf), + GST_DEBUG (0,"gst_videoscale_chain: pushing buffer of %d bytes in '%s'",GST_BUFFER_SIZE(outbuf), GST_OBJECT_NAME (videoscale)); - gst_pad_push(videoscale->srcpad, outbuf); + gst_pad_push(videoscale->srcpad, outbuf); - gst_buffer_unref(buf); + gst_buffer_unref(buf); + } } static void |