mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 12:41:05 +00:00
liveadder: Remove plugin, replace by compat subclass of audiomixer
New subclass with a similar behaviour as the old liveadder, but a slightly different API as the latency is in nanoseconds, not milliseconds. Also, the new liveadder has a effective latency that is latency + output-buffer-duration. In practice, just setting a non-zero latency with the new audiomixer gives you the right behavior in 99% of the cases.
This commit is contained in:
parent
11ab8b7965
commit
8cce2ccbf2
1 changed files with 26 additions and 0 deletions
|
@ -781,6 +781,28 @@ gst_audiomixer_child_proxy_init (gpointer g_iface, gpointer iface_data)
|
|||
iface->get_children_count = gst_audiomixer_child_proxy_get_children_count;
|
||||
}
|
||||
|
||||
/* Empty liveadder alias with non-zero latency */
|
||||
|
||||
typedef GstAudioMixer GstLiveAdder;
|
||||
typedef GstAudioMixerClass GstLiveAdderClass;
|
||||
|
||||
static GType gst_live_adder_get_type (void);
|
||||
#define GST_TYPE_LIVE_ADDER gst_live_adder_get_type ()
|
||||
|
||||
G_DEFINE_TYPE (GstLiveAdder, gst_live_adder, GST_TYPE_AUDIO_MIXER);
|
||||
|
||||
static void
|
||||
gst_live_adder_init (GstLiveAdder * self)
|
||||
{
|
||||
g_object_set (self, "latency", 30 * GST_MSECOND, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_live_adder_class_init (GstLiveAdderClass * klass)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
plugin_init (GstPlugin * plugin)
|
||||
{
|
||||
|
@ -791,6 +813,10 @@ plugin_init (GstPlugin * plugin)
|
|||
GST_TYPE_AUDIO_MIXER))
|
||||
return FALSE;
|
||||
|
||||
if (!gst_element_register (plugin, "liveadder", GST_RANK_NONE,
|
||||
GST_TYPE_LIVE_ADDER))
|
||||
return FALSE;
|
||||
|
||||
if (!gst_element_register (plugin, "audiointerleave", GST_RANK_NONE,
|
||||
GST_TYPE_AUDIO_INTERLEAVE))
|
||||
return FALSE;
|
||||
|
|
Loading…
Reference in a new issue