Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gst-plugins-good
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
George Kiagiadakis
gst-plugins-good
Commits
237ca163
Commit
237ca163
authored
Apr 25, 2011
by
Wim Taymans
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
port some more elements to 0.11
parent
a1894ed3
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
401 additions
and
475 deletions
+401
-475
gst/alpha/gstalpha.c
gst/alpha/gstalpha.c
+19
-23
gst/alpha/gstalphacolor.c
gst/alpha/gstalphacolor.c
+12
-17
gst/apetag/gstapedemux.c
gst/apetag/gstapedemux.c
+12
-16
gst/audiofx/audioamplify.c
gst/audiofx/audioamplify.c
+27
-27
gst/audiofx/audiochebband.c
gst/audiofx/audiochebband.c
+13
-18
gst/audiofx/audiocheblimit.c
gst/audiofx/audiocheblimit.c
+14
-20
gst/audiofx/audiodynamic.c
gst/audiofx/audiodynamic.c
+26
-26
gst/audiofx/audioecho.c
gst/audiofx/audioecho.c
+26
-27
gst/audiofx/audiofirfilter.c
gst/audiofx/audiofirfilter.c
+13
-19
gst/audiofx/audiofxbasefirfilter.c
gst/audiofx/audiofxbasefirfilter.c
+46
-37
gst/audiofx/audiofxbaseiirfilter.c
gst/audiofx/audiofxbaseiirfilter.c
+21
-23
gst/audiofx/audioiirfilter.c
gst/audiofx/audioiirfilter.c
+13
-20
gst/audiofx/audioinvert.c
gst/audiofx/audioinvert.c
+27
-27
gst/audiofx/audiokaraoke.c
gst/audiofx/audiokaraoke.c
+26
-26
gst/audiofx/audiopanorama.c
gst/audiofx/audiopanorama.c
+30
-27
gst/audiofx/audiowsincband.c
gst/audiofx/audiowsincband.c
+16
-23
gst/audiofx/audiowsinclimit.c
gst/audiofx/audiowsinclimit.c
+16
-24
gst/videofilter/gstgamma.c
gst/videofilter/gstgamma.c
+12
-17
gst/videofilter/gstvideobalance.c
gst/videofilter/gstvideobalance.c
+19
-40
gst/videofilter/gstvideoflip.c
gst/videofilter/gstvideoflip.c
+13
-18
No files found.
gst/alpha/gstalpha.c
View file @
237ca163
...
...
@@ -193,7 +193,8 @@ static void gst_alpha_get_property (GObject * object, guint prop_id,
GValue
*
value
,
GParamSpec
*
pspec
);
static
void
gst_alpha_finalize
(
GObject
*
object
);
GST_BOILERPLATE
(
GstAlpha
,
gst_alpha
,
GstVideoFilter
,
GST_TYPE_VIDEO_FILTER
);
#define gst_alpha_parent_class parent_class
G_DEFINE_TYPE
(
GstAlpha
,
gst_alpha
,
GST_TYPE_VIDEO_FILTER
);
#define GST_TYPE_ALPHA_METHOD (gst_alpha_method_get_type())
static
GType
...
...
@@ -214,33 +215,16 @@ gst_alpha_method_get_type (void)
return
alpha_method_type
;
}
static
void
gst_alpha_base_init
(
gpointer
g_class
)
{
GstElementClass
*
element_class
=
GST_ELEMENT_CLASS
(
g_class
);
gst_element_class_set_details_simple
(
element_class
,
"Alpha filter"
,
"Filter/Effect/Video"
,
"Adds an alpha channel to video - uniform or via chroma-keying"
,
"Wim Taymans <wim@fluendo.com>
\n
"
"Edward Hervey <edward.hervey@collabora.co.uk>
\n
"
"Jan Schmidt <thaytan@noraisin.net>"
);
gst_element_class_add_pad_template
(
element_class
,
gst_static_pad_template_get
(
&
gst_alpha_sink_template
));
gst_element_class_add_pad_template
(
element_class
,
gst_static_pad_template_get
(
&
gst_alpha_src_template
));
GST_DEBUG_CATEGORY_INIT
(
gst_alpha_debug
,
"alpha"
,
0
,
"alpha - Element for adding alpha channel to streams"
);
}
static
void
gst_alpha_class_init
(
GstAlphaClass
*
klass
)
{
GObjectClass
*
gobject_class
=
(
GObjectClass
*
)
klass
;
GstElementClass
*
gstelement_class
=
(
GstElementClass
*
)
klass
;
GstBaseTransformClass
*
btrans_class
=
(
GstBaseTransformClass
*
)
klass
;
GST_DEBUG_CATEGORY_INIT
(
gst_alpha_debug
,
"alpha"
,
0
,
"alpha - Element for adding alpha channel to streams"
);
gobject_class
->
set_property
=
gst_alpha_set_property
;
gobject_class
->
get_property
=
gst_alpha_get_property
;
gobject_class
->
finalize
=
gst_alpha_finalize
;
...
...
@@ -290,6 +274,18 @@ gst_alpha_class_init (GstAlphaClass * klass)
DEFAULT_PREFER_PASSTHROUGH
,
G_PARAM_READWRITE
|
GST_PARAM_CONTROLLABLE
|
G_PARAM_STATIC_STRINGS
));
gst_element_class_set_details_simple
(
gstelement_class
,
"Alpha filter"
,
"Filter/Effect/Video"
,
"Adds an alpha channel to video - uniform or via chroma-keying"
,
"Wim Taymans <wim.taymans@gmail.com>
\n
"
"Edward Hervey <edward.hervey@collabora.co.uk>
\n
"
"Jan Schmidt <thaytan@noraisin.net>"
);
gst_element_class_add_pad_template
(
gstelement_class
,
gst_static_pad_template_get
(
&
gst_alpha_sink_template
));
gst_element_class_add_pad_template
(
gstelement_class
,
gst_static_pad_template_get
(
&
gst_alpha_src_template
));
btrans_class
->
start
=
GST_DEBUG_FUNCPTR
(
gst_alpha_start
);
btrans_class
->
transform
=
GST_DEBUG_FUNCPTR
(
gst_alpha_transform
);
btrans_class
->
before_transform
=
...
...
@@ -300,7 +296,7 @@ gst_alpha_class_init (GstAlphaClass * klass)
}
static
void
gst_alpha_init
(
GstAlpha
*
alpha
,
GstAlphaClass
*
klass
)
gst_alpha_init
(
GstAlpha
*
alpha
)
{
alpha
->
alpha
=
DEFAULT_ALPHA
;
alpha
->
method
=
DEFAULT_METHOD
;
...
...
gst/alpha/gstalphacolor.c
View file @
237ca163
...
...
@@ -62,8 +62,7 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
GST_VIDEO_CAPS_YUV
(
"AYUV"
))
);
GST_BOILERPLATE
(
GstAlphaColor
,
gst_alpha_color
,
GstVideoFilter
,
GST_TYPE_VIDEO_FILTER
);
G_DEFINE_TYPE
(
GstAlphaColor
,
gst_alpha_color
,
GST_TYPE_VIDEO_FILTER
);
static
GstCaps
*
gst_alpha_color_transform_caps
(
GstBaseTransform
*
btrans
,
GstPadDirection
direction
,
GstCaps
*
caps
);
...
...
@@ -73,26 +72,24 @@ static GstFlowReturn gst_alpha_color_transform_ip (GstBaseTransform * btrans,
GstBuffer
*
inbuf
);
static
void
gst_alpha_color_
base_init
(
gpointer
g_c
lass
)
gst_alpha_color_
class_init
(
GstAlphaColorClass
*
k
lass
)
{
GstElementClass
*
element_class
=
GST_ELEMENT_CLASS
(
g_class
);
GstElementClass
*
gstelement_class
=
(
GstElementClass
*
)
klass
;
GstBaseTransformClass
*
gstbasetransform_class
=
(
GstBaseTransformClass
*
)
klass
;
GST_DEBUG_CATEGORY_INIT
(
alpha_color_debug
,
"alphacolor"
,
0
,
"ARGB<->AYUV colorspace conversion preserving the alpha channels"
);
gst_element_class_set_details_simple
(
element_class
,
"Alpha color filter"
,
gst_element_class_set_details_simple
(
gst
element_class
,
"Alpha color filter"
,
"Filter/Converter/Video"
,
"ARGB from/to AYUV colorspace conversion preserving the alpha channel"
,
"Wim Taymans <wim@fluendo.com>"
);
gst_element_class_add_pad_template
(
element_class
,
gst_element_class_add_pad_template
(
gst
element_class
,
gst_static_pad_template_get
(
&
sink_template
));
gst_element_class_add_pad_template
(
element_class
,
gst_element_class_add_pad_template
(
gst
element_class
,
gst_static_pad_template_get
(
&
src_template
));
}
static
void
gst_alpha_color_class_init
(
GstAlphaColorClass
*
klass
)
{
GstBaseTransformClass
*
gstbasetransform_class
=
(
GstBaseTransformClass
*
)
klass
;
gstbasetransform_class
->
transform_caps
=
GST_DEBUG_FUNCPTR
(
gst_alpha_color_transform_caps
);
...
...
@@ -101,12 +98,10 @@ gst_alpha_color_class_init (GstAlphaColorClass * klass)
gstbasetransform_class
->
transform_ip
=
GST_DEBUG_FUNCPTR
(
gst_alpha_color_transform_ip
);
GST_DEBUG_CATEGORY_INIT
(
alpha_color_debug
,
"alphacolor"
,
0
,
"ARGB<->AYUV colorspace conversion preserving the alpha channels"
);
}
static
void
gst_alpha_color_init
(
GstAlphaColor
*
alpha
,
GstAlphaColorClass
*
g_class
)
gst_alpha_color_init
(
GstAlphaColor
*
alpha
)
{
GstBaseTransform
*
btrans
=
GST_BASE_TRANSFORM
(
alpha
);
...
...
gst/apetag/gstapedemux.c
View file @
237ca163
...
...
@@ -72,31 +72,27 @@ static GstTagDemuxResult gst_ape_demux_parse_tag (GstTagDemux * demux,
GstBuffer
*
buffer
,
gboolean
start_tag
,
guint
*
tag_size
,
GstTagList
**
tags
);
G
ST_BOILERPLATE
(
GstApeDemux
,
gst_ape_demux
,
GstTagD
emux
,
GST_TYPE_TAG_DEMUX
);
G
_DEFINE_TYPE
(
GstApeDemux
,
gst_ape_d
emux
,
GST_TYPE_TAG_DEMUX
);
static
void
gst_ape_demux_
base_init
(
gpointer
klass
)
gst_ape_demux_
class_init
(
GstApeDemuxClass
*
klass
)
{
GstElementClass
*
element_class
=
GST_ELEMENT_CLASS
(
klass
);
GstElementClass
*
element_class
;
GstTagDemuxClass
*
tagdemux_class
;
gst_element_class_add_pad_template
(
element_class
,
gst_static_pad_template_get
(
&
sink_factory
));
GST_DEBUG_CATEGORY_INIT
(
apedemux_debug
,
"apedemux"
,
0
,
"GStreamer APE tag demuxer"
);
tagdemux_class
=
GST_TAG_DEMUX_CLASS
(
klass
);
element_class
=
GST_ELEMENT_CLASS
(
klass
);
gst_element_class_set_details_simple
(
element_class
,
"APE tag demuxer"
,
"Codec/Demuxer/Metadata"
,
"Read and output APE tags while demuxing the contents"
,
"Tim-Philipp Müller <tim centricular net>"
);
GST_DEBUG_CATEGORY_INIT
(
apedemux_debug
,
"apedemux"
,
0
,
"GStreamer APE tag demuxer"
);
}
static
void
gst_ape_demux_class_init
(
GstApeDemuxClass
*
klass
)
{
GstTagDemuxClass
*
tagdemux_class
;
tagdemux_class
=
GST_TAG_DEMUX_CLASS
(
klass
);
gst_element_class_add_pad_template
(
element_class
,
gst_static_pad_template_get
(
&
sink_factory
));
tagdemux_class
->
identify_tag
=
GST_DEBUG_FUNCPTR
(
gst_ape_demux_identify_tag
);
tagdemux_class
->
parse_tag
=
GST_DEBUG_FUNCPTR
(
gst_ape_demux_parse_tag
);
...
...
@@ -110,7 +106,7 @@ gst_ape_demux_class_init (GstApeDemuxClass * klass)
}
static
void
gst_ape_demux_init
(
GstApeDemux
*
apedemux
,
GstApeDemuxClass
*
gclass
)
gst_ape_demux_init
(
GstApeDemux
*
apedemux
)
{
/* nothing to do here */
}
...
...
gst/audiofx/audioamplify.c
View file @
237ca163
...
...
@@ -125,11 +125,7 @@ gst_audio_amplify_clipping_method_get_type (void)
" rate=(int)[1,MAX]," \
" channels=(int)[1,MAX]"
#define DEBUG_INIT(bla) \
GST_DEBUG_CATEGORY_INIT (gst_audio_amplify_debug, "audioamplify", 0, "audioamplify element");
GST_BOILERPLATE_FULL
(
GstAudioAmplify
,
gst_audio_amplify
,
GstAudioFilter
,
GST_TYPE_AUDIO_FILTER
,
DEBUG_INIT
);
G_DEFINE_TYPE
(
GstAudioAmplify
,
gst_audio_amplify
,
GST_TYPE_AUDIO_FILTER
);
static
gboolean
gst_audio_amplify_set_process_function
(
GstAudioAmplify
*
filter
,
gint
clipping
,
gint
format
,
gint
width
);
...
...
@@ -278,29 +274,19 @@ MAKE_FLOAT_FUNCS (gdouble)
/* GObject vmethod implementations */
static
void
gst_audio_amplify_base_init
(
gpointer
klass
)
{
GstElementClass
*
element_class
=
GST_ELEMENT_CLASS
(
klass
);
GstCaps
*
caps
;
gst_element_class_set_details_simple
(
element_class
,
"Audio amplifier"
,
"Filter/Effect/Audio"
,
"Amplifies an audio stream by a given factor"
,
"Sebastian Dröge <slomo@circular-chaos.org>"
);
caps
=
gst_caps_from_string
(
ALLOWED_CAPS
);
gst_audio_filter_class_add_pad_templates
(
GST_AUDIO_FILTER_CLASS
(
klass
),
caps
);
gst_caps_unref
(
caps
);
}
static
void
gst_audio_amplify_class_init
(
GstAudioAmplifyClass
*
klass
)
{
GObjectClass
*
gobject_class
;
GstElementClass
*
gstelement_class
;
GstCaps
*
caps
;
GST_DEBUG_CATEGORY_INIT
(
gst_audio_amplify_debug
,
"audioamplify"
,
0
,
"audioamplify element"
);
gobject_class
=
(
GObjectClass
*
)
klass
;
gstelement_class
=
(
GstElementClass
*
)
klass
;
gobject_class
->
set_property
=
gst_audio_amplify_set_property
;
gobject_class
->
get_property
=
gst_audio_amplify_get_property
;
...
...
@@ -324,6 +310,16 @@ gst_audio_amplify_class_init (GstAudioAmplifyClass * klass)
GST_TYPE_AUDIO_AMPLIFY_CLIPPING_METHOD
,
METHOD_CLIP
,
G_PARAM_READWRITE
|
G_PARAM_STATIC_STRINGS
));
gst_element_class_set_details_simple
(
gstelement_class
,
"Audio amplifier"
,
"Filter/Effect/Audio"
,
"Amplifies an audio stream by a given factor"
,
"Sebastian Dröge <slomo@circular-chaos.org>"
);
caps
=
gst_caps_from_string
(
ALLOWED_CAPS
);
gst_audio_filter_class_add_pad_templates
(
GST_AUDIO_FILTER_CLASS
(
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
=
...
...
@@ -331,7 +327,7 @@ gst_audio_amplify_class_init (GstAudioAmplifyClass * klass)
}
static
void
gst_audio_amplify_init
(
GstAudioAmplify
*
filter
,
GstAudioAmplifyClass
*
klass
)
gst_audio_amplify_init
(
GstAudioAmplify
*
filter
)
{
filter
->
amplification
=
1
.
0
;
gst_audio_amplify_set_process_function
(
filter
,
METHOD_CLIP
,
...
...
@@ -480,6 +476,8 @@ gst_audio_amplify_transform_ip (GstBaseTransform * base, GstBuffer * buf)
GstAudioAmplify
*
filter
=
GST_AUDIO_AMPLIFY
(
base
);
guint
num_samples
;
GstClockTime
timestamp
,
stream_time
;
guint8
*
data
;
gsize
size
;
timestamp
=
GST_BUFFER_TIMESTAMP
(
buf
);
stream_time
=
...
...
@@ -491,14 +489,16 @@ gst_audio_amplify_transform_ip (GstBaseTransform * base, GstBuffer * buf)
if
(
GST_CLOCK_TIME_IS_VALID
(
stream_time
))
gst_object_sync_values
(
G_OBJECT
(
filter
),
stream_time
);
num_samples
=
GST_BUFFER_SIZE
(
buf
)
/
(
GST_AUDIO_FILTER
(
filter
)
->
format
.
width
/
8
);
if
(
gst_base_transform_is_passthrough
(
base
)
||
G_UNLIKELY
(
GST_BUFFER_FLAG_IS_SET
(
buf
,
GST_BUFFER_FLAG_GAP
)))
return
GST_FLOW_OK
;
filter
->
process
(
filter
,
GST_BUFFER_DATA
(
buf
),
num_samples
);
data
=
gst_buffer_map
(
buf
,
&
size
,
NULL
,
GST_MAP_READWRITE
);
num_samples
=
size
/
(
GST_AUDIO_FILTER
(
filter
)
->
format
.
width
/
8
);
filter
->
process
(
filter
,
data
,
num_samples
);
gst_buffer_unmap
(
buf
,
data
,
size
);
return
GST_FLOW_OK
;
}
gst/audiofx/audiochebband.c
View file @
237ca163
...
...
@@ -96,11 +96,9 @@ enum
PROP_POLES
};
#define DEBUG_INIT(bla) \
GST_DEBUG_CATEGORY_INIT (gst_audio_cheb_band_debug, "audiochebband", 0, "audiochebband element");
GST_BOILERPLATE_FULL
(
GstAudioChebBand
,
gst_audio_cheb_band
,
GstAudioFXBaseIIRFilter
,
GST_TYPE_AUDIO_FX_BASE_IIR_FILTER
,
DEBUG_INIT
);
#define gst_audio_cheb_band_parent_class parent_class
G_DEFINE_TYPE
(
GstAudioChebBand
,
gst_audio_cheb_band
,
GST_TYPE_AUDIO_FX_BASE_IIR_FILTER
);
static
void
gst_audio_cheb_band_set_property
(
GObject
*
object
,
guint
prop_id
,
const
GValue
*
value
,
GParamSpec
*
pspec
);
...
...
@@ -139,23 +137,16 @@ gst_audio_cheb_band_mode_get_type (void)
/* GObject vmethod implementations */
static
void
gst_audio_cheb_band_base_init
(
gpointer
klass
)
{
GstElementClass
*
element_class
=
GST_ELEMENT_CLASS
(
klass
);
gst_element_class_set_details_simple
(
element_class
,
"Band pass & band reject filter"
,
"Filter/Effect/Audio"
,
"Chebyshev band pass and band reject filter"
,
"Sebastian Dröge <sebastian.droege@collabora.co.uk>"
);
}
static
void
gst_audio_cheb_band_class_init
(
GstAudioChebBandClass
*
klass
)
{
GObjectClass
*
gobject_class
=
(
GObjectClass
*
)
klass
;
GstElementClass
*
gstelement_class
=
(
GstElementClass
*
)
klass
;
GstAudioFilterClass
*
filter_class
=
(
GstAudioFilterClass
*
)
klass
;
GST_DEBUG_CATEGORY_INIT
(
gst_audio_cheb_band_debug
,
"audiochebband"
,
0
,
"audiochebband element"
);
gobject_class
->
set_property
=
gst_audio_cheb_band_set_property
;
gobject_class
->
get_property
=
gst_audio_cheb_band_get_property
;
gobject_class
->
finalize
=
gst_audio_cheb_band_finalize
;
...
...
@@ -193,12 +184,16 @@ gst_audio_cheb_band_class_init (GstAudioChebBandClass * klass)
4
,
32
,
4
,
G_PARAM_READWRITE
|
GST_PARAM_CONTROLLABLE
|
G_PARAM_STATIC_STRINGS
));
gst_element_class_set_details_simple
(
gstelement_class
,
"Band pass & band reject filter"
,
"Filter/Effect/Audio"
,
"Chebyshev band pass and band reject filter"
,
"Sebastian Dröge <sebastian.droege@collabora.co.uk>"
);
filter_class
->
setup
=
GST_DEBUG_FUNCPTR
(
gst_audio_cheb_band_setup
);
}
static
void
gst_audio_cheb_band_init
(
GstAudioChebBand
*
filter
,
GstAudioChebBandClass
*
klass
)
gst_audio_cheb_band_init
(
GstAudioChebBand
*
filter
)
{
filter
->
lower_frequency
=
filter
->
upper_frequency
=
0
.
0
;
filter
->
mode
=
MODE_BAND_PASS
;
...
...
gst/audiofx/audiocheblimit.c
View file @
237ca163
...
...
@@ -91,12 +91,9 @@ enum
PROP_POLES
};
#define DEBUG_INIT(bla) \
GST_DEBUG_CATEGORY_INIT (gst_audio_cheb_limit_debug, "audiocheblimit", 0, "audiocheblimit element");
GST_BOILERPLATE_FULL
(
GstAudioChebLimit
,
gst_audio_cheb_limit
,
GstAudioFXBaseIIRFilter
,
GST_TYPE_AUDIO_FX_BASE_IIR_FILTER
,
DEBUG_INIT
);
#define gst_audio_cheb_limit_parent_class parent_class
G_DEFINE_TYPE
(
GstAudioChebLimit
,
gst_audio_cheb_limit
,
GST_TYPE_AUDIO_FX_BASE_IIR_FILTER
);
static
void
gst_audio_cheb_limit_set_property
(
GObject
*
object
,
guint
prop_id
,
const
GValue
*
value
,
GParamSpec
*
pspec
);
...
...
@@ -135,24 +132,16 @@ gst_audio_cheb_limit_mode_get_type (void)
/* GObject vmethod implementations */
static
void
gst_audio_cheb_limit_base_init
(
gpointer
klass
)
{
GstElementClass
*
element_class
=
GST_ELEMENT_CLASS
(
klass
);
gst_element_class_set_details_simple
(
element_class
,
"Low pass & high pass filter"
,
"Filter/Effect/Audio"
,
"Chebyshev low pass and high pass filter"
,
"Sebastian Dröge <sebastian.droege@collabora.co.uk>"
);
}
static
void
gst_audio_cheb_limit_class_init
(
GstAudioChebLimitClass
*
klass
)
{
GObjectClass
*
gobject_class
=
(
GObjectClass
*
)
klass
;
GstElementClass
*
gstelement_class
=
(
GstElementClass
*
)
klass
;
GstAudioFilterClass
*
filter_class
=
(
GstAudioFilterClass
*
)
klass
;
GST_DEBUG_CATEGORY_INIT
(
gst_audio_cheb_limit_debug
,
"audiocheblimit"
,
0
,
"audiocheblimit element"
);
gobject_class
->
set_property
=
gst_audio_cheb_limit_set_property
;
gobject_class
->
get_property
=
gst_audio_cheb_limit_get_property
;
gobject_class
->
finalize
=
gst_audio_cheb_limit_finalize
;
...
...
@@ -186,12 +175,17 @@ gst_audio_cheb_limit_class_init (GstAudioChebLimitClass * klass)
2
,
32
,
4
,
G_PARAM_READWRITE
|
GST_PARAM_CONTROLLABLE
|
G_PARAM_STATIC_STRINGS
));
gst_element_class_set_details_simple
(
gstelement_class
,
"Low pass & high pass filter"
,
"Filter/Effect/Audio"
,
"Chebyshev low pass and high pass filter"
,
"Sebastian Dröge <sebastian.droege@collabora.co.uk>"
);
filter_class
->
setup
=
GST_DEBUG_FUNCPTR
(
gst_audio_cheb_limit_setup
);
}
static
void
gst_audio_cheb_limit_init
(
GstAudioChebLimit
*
filter
,
GstAudioChebLimitClass
*
klass
)
gst_audio_cheb_limit_init
(
GstAudioChebLimit
*
filter
)
{
filter
->
cutoff
=
0
.
0
;
filter
->
mode
=
MODE_LOW_PASS
;
...
...
gst/audiofx/audiodynamic.c
View file @
237ca163
...
...
@@ -83,11 +83,7 @@ enum
" rate=(int)[1,MAX]," \
" channels=(int)[1,MAX]"
#define DEBUG_INIT(bla) \
GST_DEBUG_CATEGORY_INIT (gst_audio_dynamic_debug, "audiodynamic", 0, "audiodynamic element");
GST_BOILERPLATE_FULL
(
GstAudioDynamic
,
gst_audio_dynamic
,
GstAudioFilter
,
GST_TYPE_AUDIO_FILTER
,
DEBUG_INIT
);
G_DEFINE_TYPE
(
GstAudioDynamic
,
gst_audio_dynamic
,
GST_TYPE_AUDIO_FILTER
);
static
void
gst_audio_dynamic_set_property
(
GObject
*
object
,
guint
prop_id
,
const
GValue
*
value
,
GParamSpec
*
pspec
);
...
...
@@ -212,28 +208,19 @@ gst_audio_dynamic_set_process_function (GstAudioDynamic * filter)
/* GObject vmethod implementations */
static
void
gst_audio_dynamic_base_init
(
gpointer
klass
)
{
GstElementClass
*
element_class
=
GST_ELEMENT_CLASS
(
klass
);
GstCaps
*
caps
;
gst_element_class_set_details_simple
(
element_class
,
"Dynamic range controller"
,
"Filter/Effect/Audio"
,
"Compressor and Expander"
,
"Sebastian Dröge <slomo@circular-chaos.org>"
);
caps
=
gst_caps_from_string
(
ALLOWED_CAPS
);
gst_audio_filter_class_add_pad_templates
(
GST_AUDIO_FILTER_CLASS
(
klass
),
caps
);
gst_caps_unref
(
caps
);
}
static
void
gst_audio_dynamic_class_init
(
GstAudioDynamicClass
*
klass
)
{
GObjectClass
*
gobject_class
;
GstElementClass
*
gstelement_class
;
GstCaps
*
caps
;
GST_DEBUG_CATEGORY_INIT
(
gst_audio_dynamic_debug
,
"audiodynamic"
,
0
,
"audiodynamic element"
);
gobject_class
=
(
GObjectClass
*
)
klass
;
gstelement_class
=
(
GstElementClass
*
)
klass
;
gobject_class
->
set_property
=
gst_audio_dynamic_set_property
;
gobject_class
->
get_property
=
gst_audio_dynamic_get_property
;
...
...
@@ -263,6 +250,15 @@ gst_audio_dynamic_class_init (GstAudioDynamicClass * klass)
1
.
0
,
G_PARAM_READWRITE
|
GST_PARAM_CONTROLLABLE
|
G_PARAM_STATIC_STRINGS
));
gst_element_class_set_details_simple
(
gstelement_class
,
"Dynamic range controller"
,
"Filter/Effect/Audio"
,
"Compressor and Expander"
,
"Sebastian Dröge <slomo@circular-chaos.org>"
);
caps
=
gst_caps_from_string
(
ALLOWED_CAPS
);
gst_audio_filter_class_add_pad_templates
(
GST_AUDIO_FILTER_CLASS
(
klass
),
caps
);
gst_caps_unref
(
caps
);
GST_AUDIO_FILTER_CLASS
(
klass
)
->
setup
=
GST_DEBUG_FUNCPTR
(
gst_audio_dynamic_setup
);
GST_BASE_TRANSFORM_CLASS
(
klass
)
->
transform_ip
=
...
...
@@ -270,7 +266,7 @@ gst_audio_dynamic_class_init (GstAudioDynamicClass * klass)
}
static
void
gst_audio_dynamic_init
(
GstAudioDynamic
*
filter
,
GstAudioDynamicClass
*
klass
)
gst_audio_dynamic_init
(
GstAudioDynamic
*
filter
)
{
filter
->
ratio
=
1
.
0
;
filter
->
threshold
=
0
.
0
;
...
...
@@ -696,6 +692,8 @@ gst_audio_dynamic_transform_ip (GstBaseTransform * base, GstBuffer * buf)
GstAudioDynamic
*
filter
=
GST_AUDIO_DYNAMIC
(
base
);
guint
num_samples
;
GstClockTime
timestamp
,
stream_time
;
guint8
*
data
;
gsize
size
;
timestamp
=
GST_BUFFER_TIMESTAMP
(
buf
);
stream_time
=
...
...
@@ -707,14 +705,16 @@ gst_audio_dynamic_transform_ip (GstBaseTransform * base, GstBuffer * buf)
if
(
GST_CLOCK_TIME_IS_VALID
(
stream_time
))
gst_object_sync_values
(
G_OBJECT
(
filter
),
stream_time
);
num_samples
=
GST_BUFFER_SIZE
(
buf
)
/
(
GST_AUDIO_FILTER
(
filter
)
->
format
.
width
/
8
);
if
(
gst_base_transform_is_passthrough
(
base
)
||
G_UNLIKELY
(
GST_BUFFER_FLAG_IS_SET
(
buf
,
GST_BUFFER_FLAG_GAP
)))
return
GST_FLOW_OK
;
filter
->
process
(
filter
,
GST_BUFFER_DATA
(
buf
),
num_samples
);
data
=
gst_buffer_map
(
buf
,
&
size
,
NULL
,
GST_MAP_READWRITE
);
num_samples
=
size
/
(
GST_AUDIO_FILTER
(
filter
)
->
format
.
width
/
8
);
filter
->
process
(
filter
,
data
,
num_samples
);
gst_buffer_unmap
(
buf
,
data
,
size
);
return
GST_FLOW_OK
;
}
gst/audiofx/audioecho.c
View file @
237ca163
...
...
@@ -73,11 +73,8 @@ enum
" rate=(int)[1,MAX]," \
" channels=(int)[1,MAX]"
#define DEBUG_INIT(bla) \
GST_DEBUG_CATEGORY_INIT (gst_audio_echo_debug, "audioecho", 0, "audioecho element");
GST_BOILERPLATE_FULL
(
GstAudioEcho
,
gst_audio_echo
,
GstAudioFilter
,
GST_TYPE_AUDIO_FILTER
,
DEBUG_INIT
);
#define gst_audio_echo_parent_class parent_class
G_DEFINE_TYPE
(
GstAudioEcho
,
gst_audio_echo
,
GST_TYPE_AUDIO_FILTER
);
static
void
gst_audio_echo_set_property
(
GObject
*
object
,
guint
prop_id
,
const
GValue
*
value
,
GParamSpec
*
pspec
);
...
...
@@ -98,29 +95,17 @@ static void gst_audio_echo_transform_double (GstAudioEcho * self,
/* GObject vmethod implementations */
static
void
gst_audio_echo_base_init
(
gpointer
klass
)
{
GstElementClass
*
element_class
=
GST_ELEMENT_CLASS
(
klass
);
GstCaps
*
caps
;
gst_element_class_set_details_simple
(
element_class
,
"Audio echo"
,
"Filter/Effect/Audio"
,
"Adds an echo or reverb effect to an audio stream"
,
"Sebastian Dröge <sebastian.droege@collabora.co.uk>"
);
caps
=
gst_caps_from_string
(
ALLOWED_CAPS
);
gst_audio_filter_class_add_pad_templates
(
GST_AUDIO_FILTER_CLASS
(
klass
),
caps
);
gst_caps_unref
(
caps
);
}
static
void
gst_audio_echo_class_init
(
GstAudioEchoClass
*
klass
)
{
GObjectClass
*
gobject_class
=
(
GObjectClass
*
)
klass
;
GstElementClass
*
gstelement_class
=
(
GstElementClass
*
)
klass
;
GstBaseTransformClass
*
basetransform_class
=
(
GstBaseTransformClass
*
)
klass
;
GstAudioFilterClass
*
audioself_class
=
(
GstAudioFilterClass
*
)
klass
;
GstCaps
*
caps
;
GST_DEBUG_CATEGORY_INIT
(
gst_audio_echo_debug
,
"audioecho"
,
0
,
"audioecho element"
);
gobject_class
->
set_property
=
gst_audio_echo_set_property
;
gobject_class
->
get_property
=
gst_audio_echo_get_property
;
...
...
@@ -151,6 +136,16 @@ gst_audio_echo_class_init (GstAudioEchoClass * klass)
0
.
0
,
G_PARAM_READWRITE
|
G_PARAM_STATIC_STRINGS
|
GST_PARAM_CONTROLLABLE
));
gst_element_class_set_details_simple
(
gstelement_class
,
"Audio echo"
,
"Filter/Effect/Audio"
,
"Adds an echo or reverb effect to an audio stream"
,
"Sebastian Dröge <sebastian.droege@collabora.co.uk>"
);
caps
=
gst_caps_from_string
(
ALLOWED_CAPS
);
gst_audio_filter_class_add_pad_templates
(
GST_AUDIO_FILTER_CLASS
(
klass
),
caps
);
gst_caps_unref
(
caps
);
audioself_class
->
setup
=
GST_DEBUG_FUNCPTR
(
gst_audio_echo_setup
);
basetransform_class
->
transform_ip
=
GST_DEBUG_FUNCPTR
(
gst_audio_echo_transform_ip
);
...
...
@@ -158,7 +153,7 @@ gst_audio_echo_class_init (GstAudioEchoClass * klass)
}
static
void
gst_audio_echo_init
(
GstAudioEcho
*
self
,
GstAudioEchoClass
*
klass
)
gst_audio_echo_init
(
GstAudioEcho
*
self
)
{
self
->
delay
=
1
;
self
->
max_delay
=
1
;
...
...
@@ -359,6 +354,8 @@ gst_audio_echo_transform_ip (GstBaseTransform * base, GstBuffer * buf)
GstAudioEcho
*
self
=
GST_AUDIO_ECHO
(
base
);
guint
num_samples
;
GstClockTime
timestamp
,
stream_time
;
guint8
*
data
;
gsize
size
;
timestamp
=
GST_BUFFER_TIMESTAMP
(
buf
);
stream_time
=
...
...
@@ -370,9 +367,6 @@ gst_audio_echo_transform_ip (GstBaseTransform * base, GstBuffer * buf)
if
(
GST_CLOCK_TIME_IS_VALID
(
stream_time
))
gst_object_sync_values
(
G_OBJECT
(
self
),
stream_time
);
num_samples
=
GST_BUFFER_SIZE
(
buf
)
/
(
GST_AUDIO_FILTER
(
self
)
->
format
.
width
/
8
);
if
(
self
->
buffer
==
NULL
)
{
guint
width
,
rate
,
channels
;
...
...
@@ -395,7 +389,12 @@ gst_audio_echo_transform_ip (GstBaseTransform * base, GstBuffer * buf)
}
}
self
->
process
(
self
,
GST_BUFFER_DATA
(
buf
),
num_samples
);
data
=
gst_buffer_map
(
buf
,
&
size
,
NULL
,
GST_MAP_READWRITE
);
num_samples
=
size
/
(
GST_AUDIO_FILTER
(
self
)
->
format
.
width
/
8
);
self
->
process
(
self
,
data
,
num_samples
);
gst_buffer_unmap
(
buf
,
data
,
size
);
return
GST_FLOW_OK
;
}
gst/audiofx/audiofirfilter.c
View file @
237ca163
...
...
@@ -75,12 +75,9 @@ enum