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:
Olivier Crête 2015-10-05 00:55:36 +01:00
parent 657f1913c6
commit 305e5c7ac3
9 changed files with 27 additions and 1686 deletions

View file

@ -466,7 +466,6 @@ AG_GST_CHECK_PLUGIN(ivtc)
AG_GST_CHECK_PLUGIN(jp2kdecimator)
AG_GST_CHECK_PLUGIN(jpegformat)
AG_GST_CHECK_PLUGIN(librfb)
AG_GST_CHECK_PLUGIN(liveadder)
AG_GST_CHECK_PLUGIN(midi)
AG_GST_CHECK_PLUGIN(mpegdemux)
AG_GST_CHECK_PLUGIN(mpegtsdemux)
@ -3412,7 +3411,6 @@ gst/ivtc/Makefile
gst/jp2kdecimator/Makefile
gst/jpegformat/Makefile
gst/librfb/Makefile
gst/liveadder/Makefile
gst/midi/Makefile
gst/mpegdemux/Makefile
gst/mpegtsdemux/Makefile

View file

@ -150,7 +150,6 @@ EXTRA_HFILES = \
$(top_srcdir)/gst/geometrictransform/gstwaterripple.h \
$(top_srcdir)/gst/ivfparse/gstivfparse.h \
$(top_srcdir)/gst/jpegformat/gstjpegparse.h \
$(top_srcdir)/gst/liveadder/liveadder.h \
$(top_srcdir)/gst/mxf/mxfdemux.h \
$(top_srcdir)/gst/mxf/mxfmux.h \
$(top_srcdir)/gst/nuvdemux/gstnuvdemux.h \

View file

@ -132,7 +132,6 @@
<xi:include href="xml/plugin-geometrictransform.xml" />
<xi:include href="xml/plugin-gsm.xml" />
<xi:include href="xml/plugin-jpegformat.xml" />
<xi:include href="xml/plugin-liveadder.xml" />
<xi:include href="xml/plugin-mimic.xml" />
<xi:include href="xml/plugin-mms.xml" />
<xi:include href="xml/plugin-modplug.xml" />

View file

@ -720,15 +720,7 @@ gst_jpeg_parse_get_type
GstLiveAdder
<SUBSECTION Standard>
GstLiveAdderClass
GST_IS_LIVE_ADDER
GST_IS_LIVE_ADDER_CLASS
GST_IS_MXF_DEMUX_PAD
GST_LIVE_ADDER
GST_LIVE_ADDER_CLASS
GST_LIVE_ADDER_GET_CLASS
GST_TYPE_LIVE_ADDER
GstLiveAdderFormat
GstLiveAdderFunction
gst_live_adder_get_type
</SECTION>
@ -1008,6 +1000,7 @@ GST_MXF_DEMUX
GST_MXF_DEMUX_CLASS
GST_TYPE_MXF_DEMUX
gst_mxf_demux_get_type
GST_IS_MXF_DEMUX_PAD
</SECTION>
<SECTION>

View file

@ -1,34 +0,0 @@
<plugin>
<name>liveadder</name>
<description>Adds multiple live discontinuous streams</description>
<filename>../../gst/liveadder/.libs/libgstliveadder.so</filename>
<basename>libgstliveadder.so</basename>
<version>1.6.0</version>
<license>LGPL</license>
<source>gst-plugins-bad</source>
<package>GStreamer Bad Plug-ins source release</package>
<origin>Unknown package origin</origin>
<elements>
<element>
<name>liveadder</name>
<longname>Live Adder element</longname>
<class>Generic/Audio</class>
<description>Mixes live/discontinuous audio streams</description>
<author>Olivier Crete &lt;olivier.crete@collabora.co.uk&gt;</author>
<pads>
<caps>
<name>sink_%u</name>
<direction>sink</direction>
<presence>request</presence>
<details>audio/x-raw, format=(string){ S8, U8, S16LE, U16LE, S32LE, U32LE, F32LE, F64LE }, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ]</details>
</caps>
<caps>
<name>src</name>
<direction>source</direction>
<presence>always</presence>
<details>audio/x-raw, format=(string){ S8, U8, S16LE, U16LE, S32LE, U32LE, F32LE, F64LE }, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ]</details>
</caps>
</pads>
</element>
</elements>
</plugin>

View file

@ -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;

View file

@ -1,11 +0,0 @@
plugin_LTLIBRARIES = libgstliveadder.la
libgstliveadder_la_SOURCES = liveadder.c
libgstliveadder_la_CFLAGS = $(GST_PLUGINS_BAD_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS)
libgstliveadder_la_LIBADD = \
$(GST_PLUGINS_BASE_LIBS) -lgstaudio-@GST_API_VERSION@ \
$(GST_BASE_LIBS) $(GST_LIBS)
libgstliveadder_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstliveadder_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)
noinst_HEADERS = liveadder.h

File diff suppressed because it is too large Load diff

View file

@ -1,91 +0,0 @@
/*
* GStreamer
*
* Copyright 2008 Collabora Ltd
* Copyright 2008 Nokia Corporation
* @author: Olivier Crete <olivier.crete@collabora.co.uk>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#ifndef __GST_LIVE_ADDER_H__
#define __GST_LIVE_ADDER_H__
#include <gst/gst.h>
#include <gst/audio/audio.h>
G_BEGIN_DECLS
#define GST_TYPE_LIVE_ADDER (gst_live_adder_get_type())
#define GST_LIVE_ADDER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_LIVE_ADDER,GstLiveAdder))
#define GST_IS_LIVE_ADDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_LIVE_ADDER))
#define GST_LIVE_ADDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_LIVE_ADDER,GstLiveAdderClass))
#define GST_IS_LIVE_ADDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_LIVE_ADDER))
#define GST_LIVE_ADDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_LIVE_ADDER,GstLiveAdderClass))
typedef struct _GstLiveAdder GstLiveAdder;
typedef struct _GstLiveAdderClass GstLiveAdderClass;
typedef void (*GstLiveAdderFunction) (gpointer out, gpointer in, guint size);
/**
* GstLiveAdder:
*
* The adder object structure.
*/
struct _GstLiveAdder
{
/*< private >*/
GstElement element;
GstPad *srcpad;
/* pad counter, used for creating unique request pads */
gint padcount;
GList *sinkpads;
GstFlowReturn srcresult;
GstClockID clock_id;
/* the queue is ordered head to tail */
GQueue *buffers;
GCond not_empty_cond;
GstClockTime next_timestamp;
/* the next are valid for both int and float */
GstAudioInfo info;
/* function to add samples */
GstLiveAdderFunction func;
GstClockTime latency_ms;
GstClockTime peer_latency;
gboolean segment_pending;
gboolean playing;
};
struct _GstLiveAdderClass
{
GstElementClass parent_class;
};
GType gst_live_adder_get_type (void);
G_END_DECLS
#endif /* __GST_LIVE_ADDER_H__ */