From 7aeed2d79dbb38ce726991aeac7895e0a806fff7 Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Fri, 3 May 2013 21:46:08 +0200 Subject: [PATCH] ladspa: sync controlled parames in filters and sinks --- ext/ladspa/gstladspafilter.c | 27 +++++++++++---------------- ext/ladspa/gstladspasink.c | 8 ++++---- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/ext/ladspa/gstladspafilter.c b/ext/ladspa/gstladspafilter.c index 2411c06b61..af64b2118c 100644 --- a/ext/ladspa/gstladspafilter.c +++ b/ext/ladspa/gstladspafilter.c @@ -152,8 +152,7 @@ gst_ladspa_filter_type_prepare_output_buffer (GstBaseTransform * base, } static gboolean -gst_ladspa_filter_type_setup (GstAudioFilter * audio, - const GstAudioInfo * info) +gst_ladspa_filter_type_setup (GstAudioFilter * audio, const GstAudioInfo * info) { GstLADSPAFilter *ladspa = GST_LADSPA_FILTER (audio); @@ -169,8 +168,7 @@ gst_ladspa_filter_type_cleanup (GstBaseTransform * base) } static GstFlowReturn -gst_ladspa_filter_type_transform_ip (GstBaseTransform * base, - GstBuffer * buf) +gst_ladspa_filter_type_transform_ip (GstBaseTransform * base, GstBuffer * buf) { GstLADSPAFilter *ladspa = GST_LADSPA_FILTER (base); GstMapInfo map; @@ -193,6 +191,8 @@ gst_ladspa_filter_type_transform (GstBaseTransform * base, GstMapInfo inmap, outmap; guint samples; + gst_object_sync_values (GST_OBJECT (ladspa), GST_BUFFER_TIMESTAMP (inbuf)); + gst_buffer_map (inbuf, &inmap, GST_MAP_READ); gst_buffer_map (outbuf, &outmap, GST_MAP_WRITE); samples = @@ -225,8 +225,7 @@ gst_ladspa_filter_type_get_property (GObject * object, guint prop_id, } static void -gst_ladspa_filter_type_init (GstLADSPAFilter * ladspa, - LADSPA_Descriptor * desc) +gst_ladspa_filter_type_init (GstLADSPAFilter * ladspa, LADSPA_Descriptor * desc) { GstBaseTransform *base = GST_BASE_TRANSFORM (ladspa); GstLADSPAFilterClass *ladspa_class = GST_LADSPA_FILTER_GET_CLASS (ladspa); @@ -237,8 +236,8 @@ gst_ladspa_filter_type_init (GstLADSPAFilter * ladspa, gst_base_transform_set_in_place (base, ladspa_class->ladspa.count.audio.in == ladspa_class->ladspa.count.audio.out - && !LADSPA_IS_INPLACE_BROKEN (ladspa_class->ladspa.descriptor-> - Properties)); + && !LADSPA_IS_INPLACE_BROKEN (ladspa_class->ladspa. + descriptor->Properties)); } @@ -304,13 +303,10 @@ gst_ladspa_filter_type_class_init (GstLADSPAFilterClass * ladspa_class, GST_DEBUG ("LADSPA filter class %p", ladspa_class); - gst_ladspa_filter_type_parent_class = - g_type_class_peek_parent (ladspa_class); + gst_ladspa_filter_type_parent_class = g_type_class_peek_parent (ladspa_class); - object_class->dispose = - GST_DEBUG_FUNCPTR (gst_ladspa_filter_type_dispose); - object_class->finalize = - GST_DEBUG_FUNCPTR (gst_ladspa_filter_type_finalize); + object_class->dispose = GST_DEBUG_FUNCPTR (gst_ladspa_filter_type_dispose); + object_class->finalize = GST_DEBUG_FUNCPTR (gst_ladspa_filter_type_finalize); object_class->set_property = GST_DEBUG_FUNCPTR (gst_ladspa_filter_type_set_property); object_class->get_property = @@ -322,8 +318,7 @@ gst_ladspa_filter_type_class_init (GstLADSPAFilterClass * ladspa_class, GST_DEBUG_FUNCPTR (gst_ladspa_filter_type_transform_caps); base_class->prepare_output_buffer = GST_DEBUG_FUNCPTR (gst_ladspa_filter_type_prepare_output_buffer); - base_class->transform = - GST_DEBUG_FUNCPTR (gst_ladspa_filter_type_transform); + base_class->transform = GST_DEBUG_FUNCPTR (gst_ladspa_filter_type_transform); base_class->transform_ip = GST_DEBUG_FUNCPTR (gst_ladspa_filter_type_transform_ip); diff --git a/ext/ladspa/gstladspasink.c b/ext/ladspa/gstladspasink.c index db91b0146d..620379aac1 100644 --- a/ext/ladspa/gstladspasink.c +++ b/ext/ladspa/gstladspasink.c @@ -138,6 +138,8 @@ gst_ladspa_sink_type_render (GstBaseSink * base, GstBuffer * buf) if (ladspa->num_buffers_left != -1) ladspa->num_buffers_left--; + gst_object_sync_values (GST_OBJECT (ladspa), GST_BUFFER_TIMESTAMP (buf)); + gst_buffer_map (buf, &info, GST_MAP_READ); gst_ladspa_transform (&ladspa->ladspa, NULL, info.size / sizeof (LADSPA_Data) / ladspa->ladspa.klass->count.audio.in, @@ -302,12 +304,10 @@ gst_ladspa_sink_type_class_init (GstLADSPASinkClass * ladspa_class, GstBaseSinkClass *base_class = base_class = GST_BASE_SINK_CLASS (ladspa_class); - gst_ladspa_sink_type_parent_class = - g_type_class_peek_parent (ladspa_class); + gst_ladspa_sink_type_parent_class = g_type_class_peek_parent (ladspa_class); object_class->dispose = GST_DEBUG_FUNCPTR (gst_ladspa_sink_type_dispose); - object_class->finalize = - GST_DEBUG_FUNCPTR (gst_ladspa_sink_type_finalize); + object_class->finalize = GST_DEBUG_FUNCPTR (gst_ladspa_sink_type_finalize); object_class->set_property = GST_DEBUG_FUNCPTR (gst_ladspa_sink_type_set_property); object_class->get_property = -- 2.34.1