From: Sebastian Dröge Date: Thu, 13 May 2010 10:16:38 +0000 (+0200) Subject: videoscale: Use passthrough mode if width and height are not changed X-Git-Tag: RELEASE-0.10.30~194 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a6a125e4bafdfcd39b748bfff962a64caea82155;p=platform%2Fupstream%2Fgst-plugins-base.git videoscale: Use passthrough mode if width and height are not changed It doesn't matter if the PAR changes or not, processing of every pixel is only necessary when the width or height changes. --- diff --git a/gst/videoscale/gstvideoscale.c b/gst/videoscale/gstvideoscale.c index 06ea8b1..5ae058d 100644 --- a/gst/videoscale/gstvideoscale.c +++ b/gst/videoscale/gstvideoscale.c @@ -264,8 +264,6 @@ gst_video_scale_class_init (GstVideoScaleClass * klass) trans_class->transform = GST_DEBUG_FUNCPTR (gst_video_scale_transform); trans_class->fixate_caps = GST_DEBUG_FUNCPTR (gst_video_scale_fixate_caps); trans_class->src_event = GST_DEBUG_FUNCPTR (gst_video_scale_src_event); - - trans_class->passthrough_on_same_caps = TRUE; } static void @@ -545,6 +543,10 @@ gst_video_scale_set_caps (GstBaseTransform * trans, GstCaps * in, GstCaps * out) if (to_dar_n != from_dar_n || to_dar_d != from_dar_d) GST_WARNING_OBJECT (videoscale, "Can't keep DAR!"); + gst_base_transform_set_passthrough (trans, + (videoscale->from_width == videoscale->to_width + && videoscale->from_height == videoscale->to_height)); + GST_DEBUG_OBJECT (videoscale, "from=%dx%d (par=%d/%d dar=%d/%d), size %d " "-> to=%dx%d (par=%d/%d dar=%d/%d), size %d", videoscale->from_width, videoscale->from_height, from_par_n, from_par_d,