Commit ff58bf3d authored by Wim Taymans's avatar Wim Taymans

use transform_ip_on_passthrough

parent 068ee888
......@@ -92,6 +92,7 @@ gst_alpha_color_class_init (GstAlphaColorClass * klass)
gstbasetransform_class->transform_caps =
GST_DEBUG_FUNCPTR (gst_alpha_color_transform_caps);
gstbasetransform_class->transform_ip_on_passthrough = FALSE;
gstvideofilter_class->set_info = GST_DEBUG_FUNCPTR (gst_alpha_color_set_info);
gstvideofilter_class->transform_frame_ip =
......@@ -678,9 +679,6 @@ gst_alpha_color_transform_frame_ip (GstVideoFilter * filter,
{
GstAlphaColor *alpha = GST_ALPHA_COLOR (filter);
if (gst_base_transform_is_passthrough (GST_BASE_TRANSFORM (filter)))
return GST_FLOW_OK;
if (G_UNLIKELY (!alpha->process))
goto not_negotiated;
......
......@@ -297,10 +297,12 @@ gst_audio_amplify_class_init (GstAudioAmplifyClass * klass)
caps);
gst_caps_unref (caps);
GST_AUDIO_FILTER_CLASS (klass)->setup =
GST_DEBUG_FUNCPTR (gst_audio_amplify_setup);
GST_BASE_TRANSFORM_CLASS (klass)->transform_ip =
GST_DEBUG_FUNCPTR (gst_audio_amplify_transform_ip);
GST_BASE_TRANSFORM_CLASS (klass)->transform_ip_on_passthrough = FALSE;
GST_AUDIO_FILTER_CLASS (klass)->setup =
GST_DEBUG_FUNCPTR (gst_audio_amplify_setup);
}
static void
......@@ -460,8 +462,7 @@ gst_audio_amplify_transform_ip (GstBaseTransform * base, GstBuffer * buf)
if (GST_CLOCK_TIME_IS_VALID (stream_time))
gst_object_sync_values (GST_OBJECT (filter), stream_time);
if (gst_base_transform_is_passthrough (base) ||
G_UNLIKELY (GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_GAP)))
if (G_UNLIKELY (GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_GAP)))
return GST_FLOW_OK;
gst_buffer_map (buf, &map, GST_MAP_READWRITE);
......
......@@ -256,8 +256,10 @@ gst_audio_dynamic_class_init (GstAudioDynamicClass * klass)
GST_AUDIO_FILTER_CLASS (klass)->setup =
GST_DEBUG_FUNCPTR (gst_audio_dynamic_setup);
GST_BASE_TRANSFORM_CLASS (klass)->transform_ip =
GST_DEBUG_FUNCPTR (gst_audio_dynamic_transform_ip);
GST_BASE_TRANSFORM_CLASS (klass)->transform_ip_on_passthrough = FALSE;
}
static void
......@@ -705,8 +707,7 @@ gst_audio_dynamic_transform_ip (GstBaseTransform * base, GstBuffer * buf)
if (GST_CLOCK_TIME_IS_VALID (stream_time))
gst_object_sync_values (GST_OBJECT (filter), stream_time);
if (gst_base_transform_is_passthrough (base) ||
G_UNLIKELY (GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_GAP)))
if (G_UNLIKELY (GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_GAP)))
return GST_FLOW_OK;
gst_buffer_map (buf, &map, GST_MAP_READWRITE);
......
......@@ -116,6 +116,7 @@ gst_audio_fx_base_iir_filter_class_init (GstAudioFXBaseIIRFilterClass * klass)
trans_class->transform_ip =
GST_DEBUG_FUNCPTR (gst_audio_fx_base_iir_filter_transform_ip);
trans_class->transform_ip_on_passthrough = FALSE;
trans_class->stop = GST_DEBUG_FUNCPTR (gst_audio_fx_base_iir_filter_stop);
}
......@@ -371,9 +372,6 @@ gst_audio_fx_base_iir_filter_transform_ip (GstBaseTransform * base,
if (GST_CLOCK_TIME_IS_VALID (stream_time))
gst_object_sync_values (GST_OBJECT (filter), stream_time);
if (gst_base_transform_is_passthrough (base))
return GST_FLOW_OK;
g_return_val_if_fail (filter->a != NULL, GST_FLOW_ERROR);
gst_buffer_map (buf, &map, GST_MAP_READWRITE);
......
......@@ -121,10 +121,12 @@ gst_audio_invert_class_init (GstAudioInvertClass * klass)
caps);
gst_caps_unref (caps);
GST_AUDIO_FILTER_CLASS (klass)->setup =
GST_DEBUG_FUNCPTR (gst_audio_invert_setup);
GST_BASE_TRANSFORM_CLASS (klass)->transform_ip =
GST_DEBUG_FUNCPTR (gst_audio_invert_transform_ip);
GST_BASE_TRANSFORM_CLASS (klass)->transform_ip_on_passthrough = FALSE;
GST_AUDIO_FILTER_CLASS (klass)->setup =
GST_DEBUG_FUNCPTR (gst_audio_invert_setup);
}
static void
......@@ -240,8 +242,7 @@ gst_audio_invert_transform_ip (GstBaseTransform * base, GstBuffer * buf)
if (GST_CLOCK_TIME_IS_VALID (stream_time))
gst_object_sync_values (GST_OBJECT (filter), stream_time);
if (gst_base_transform_is_passthrough (base) ||
G_UNLIKELY (GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_GAP)))
if (G_UNLIKELY (GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_GAP)))
return GST_FLOW_OK;
gst_buffer_map (buf, &map, GST_MAP_READWRITE);
......
......@@ -142,10 +142,12 @@ gst_audio_karaoke_class_init (GstAudioKaraokeClass * klass)
caps);
gst_caps_unref (caps);
GST_AUDIO_FILTER_CLASS (klass)->setup =
GST_DEBUG_FUNCPTR (gst_audio_karaoke_setup);
GST_BASE_TRANSFORM_CLASS (klass)->transform_ip =
GST_DEBUG_FUNCPTR (gst_audio_karaoke_transform_ip);
GST_BASE_TRANSFORM_CLASS (klass)->transform_ip_on_passthrough = FALSE;
GST_AUDIO_FILTER_CLASS (klass)->setup =
GST_DEBUG_FUNCPTR (gst_audio_karaoke_setup);
}
static void
......@@ -348,8 +350,7 @@ gst_audio_karaoke_transform_ip (GstBaseTransform * base, GstBuffer * buf)
if (GST_CLOCK_TIME_IS_VALID (stream_time))
gst_object_sync_values (GST_OBJECT (filter), stream_time);
if (gst_base_transform_is_passthrough (base) ||
G_UNLIKELY (GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_GAP)))
if (G_UNLIKELY (GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_GAP)))
return GST_FLOW_OK;
gst_buffer_map (buf, &map, GST_MAP_READWRITE);
......
......@@ -134,6 +134,7 @@ gst_gamma_class_init (GstGammaClass * g_class)
trans_class->before_transform =
GST_DEBUG_FUNCPTR (gst_gamma_before_transform);
trans_class->transform_ip_on_passthrough = FALSE;
vfilter_class->set_info = GST_DEBUG_FUNCPTR (gst_gamma_set_info);
vfilter_class->transform_frame_ip =
......@@ -400,14 +401,10 @@ gst_gamma_transform_frame_ip (GstVideoFilter * vfilter, GstVideoFrame * frame)
if (!gamma->process)
goto not_negotiated;
if (gst_base_transform_is_passthrough (GST_BASE_TRANSFORM (vfilter)))
goto done;
GST_OBJECT_LOCK (gamma);
gamma->process (gamma, frame);
GST_OBJECT_UNLOCK (gamma);
done:
return GST_FLOW_OK;
/* ERRORS */
......
......@@ -434,15 +434,10 @@ gst_video_balance_transform_frame_ip (GstVideoFilter * vfilter,
if (!videobalance->process)
goto not_negotiated;
/* if no change is needed, we are done */
if (gst_base_transform_is_passthrough (GST_BASE_TRANSFORM (vfilter)))
goto done;
GST_OBJECT_LOCK (videobalance);
videobalance->process (videobalance, frame);
GST_OBJECT_UNLOCK (videobalance);
done:
return GST_FLOW_OK;
/* ERRORS */
......@@ -519,6 +514,7 @@ gst_video_balance_class_init (GstVideoBalanceClass * klass)
trans_class->before_transform =
GST_DEBUG_FUNCPTR (gst_video_balance_before_transform);
trans_class->transform_ip_on_passthrough = FALSE;
vfilter_class->set_info = GST_DEBUG_FUNCPTR (gst_video_balance_set_info);
vfilter_class->transform_frame_ip =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment