audio-converter: move audio converter to audio libs

Move the audio-converter helper to the audio library.
This commit is contained in:
Wim Taymans 2015-11-06 17:49:00 +01:00
parent dfa25a40fc
commit e3f0f3b91e
10 changed files with 32 additions and 23 deletions

View file

@ -67,7 +67,6 @@ EXTRA_HFILES = \
$(top_srcdir)/ext/vorbis/gstvorbisparse.h \
$(top_srcdir)/ext/vorbis/gstvorbistag.h \
$(top_srcdir)/gst/adder/gstadder.h \
$(top_srcdir)/gst/audioconvert/audioconvert.h \
$(top_srcdir)/gst/audioconvert/gstaudioconvert.h \
$(top_srcdir)/gst/audiotestsrc/gstaudiotestsrc.h \
$(top_srcdir)/gst/encoding/gstencodebin.h \

View file

@ -7,6 +7,7 @@ glib_enum_headers= \
audio-format.h \
audio-channels.h \
audio-channel-mix.h \
audio-converter.h \
audio-info.h \
audio-quantize.h \
gstaudioringbuffer.h
@ -29,6 +30,7 @@ libgstaudio_@GST_API_VERSION@_la_SOURCES = \
audio-format.c \
audio-channels.c \
audio-channel-mix.c \
audio-converter.c \
audio-info.c \
audio-quantize.c \
gstaudioringbuffer.c \
@ -54,6 +56,7 @@ libgstaudio_@GST_API_VERSION@include_HEADERS = \
audio-format.h \
audio-channels.h \
audio-channel-mix.h \
audio-converter.h \
audio-info.h \
audio-quantize.h \
gstaudioringbuffer.h \

View file

@ -27,8 +27,8 @@
#include <math.h>
#include <string.h>
#include "audioconvert.h"
#include "gstaudioconvertorc.h"
#include "audio-converter.h"
#include "gstaudiopack.h"
/**
* SECTION:audioconverter
@ -278,7 +278,7 @@ gst_audio_converter_new (GstAudioInfo * in, GstAudioInfo * out,
/* step 2, optional convert from S32 to F64 for channel mix */
if (in_int && !out_int) {
GST_INFO ("convert S32 to F64");
convert->convert_in = (AudioConvertFunc) audio_convert_orc_s32_to_double;
convert->convert_in = (AudioConvertFunc) audio_orc_s32_to_double;
format = GST_AUDIO_FORMAT_F64;
}
@ -295,7 +295,7 @@ gst_audio_converter_new (GstAudioInfo * in, GstAudioInfo * out,
/* step 4, optional convert for quantize */
if (!in_int && out_int) {
GST_INFO ("convert F64 to S32");
convert->convert_out = (AudioConvertFunc) audio_convert_orc_double_to_s32;
convert->convert_out = (AudioConvertFunc) audio_orc_double_to_s32;
format = GST_AUDIO_FORMAT_S32;
}
/* step 5, optional quantize */

View file

@ -29,6 +29,7 @@
#include <gst/audio/audio-channel-mix.h>
#include <gst/audio/audio-info.h>
#include <gst/audio/audio-quantize.h>
#include <gst/audio/audio-converter.h>
G_BEGIN_DECLS

View file

@ -407,4 +407,19 @@ andl d1, t1, mask
mulll t, r, 1103515245
addl r, t, 12345
.function audio_orc_s32_to_double
.dest 8 d1 gdouble
.source 4 s1 gint32
.temp 8 t1
convld t1, s1
divd d1, t1, 2147483648.0L
.function audio_orc_double_to_s32
.dest 4 d1 gint32
.source 8 s1 gdouble
.temp 8 t1
muld t1, s1, 2147483648.0L
convdl d1, t1

View file

@ -1,22 +1,16 @@
plugin_LTLIBRARIES = libgstaudioconvert.la
ORC_SOURCE=gstaudioconvertorc
include $(top_srcdir)/common/orc.mak
libgstaudioconvert_la_SOURCES = \
gstaudioconvert.c \
audioconvert.c \
plugin.c
nodist_libgstaudioconvert_la_SOURCES = $(ORC_NODIST_SOURCES)
libgstaudioconvert_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(ORC_CFLAGS)
libgstaudioconvert_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS)
libgstaudioconvert_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstaudioconvert_la_LIBADD = \
$(top_builddir)/gst-libs/gst/audio/libgstaudio-@GST_API_VERSION@.la \
$(GST_BASE_LIBS) $(GST_LIBS) $(ORC_LIBS) $(LIBM)
$(GST_BASE_LIBS) $(GST_LIBS) $(LIBM)
libgstaudioconvert_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)
noinst_HEADERS = \
gstaudioconvert.h \
audioconvert.h \
plugin.h

View file

@ -26,8 +26,6 @@
#include <gst/base/gstbasetransform.h>
#include <gst/audio/audio.h>
#include "audioconvert.h"
#define GST_TYPE_AUDIO_CONVERT (gst_audio_convert_get_type())
#define GST_AUDIO_CONVERT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_CONVERT,GstAudioConvert))
#define GST_AUDIO_CONVERT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIO_CONVERT,GstAudioConvertClass))

View file

@ -140,7 +140,7 @@ check_adder =
endif
if HAVE_ORC
check_orc = orc/video orc/audio orc/adder orc/audioconvert orc/volume orc/videotestsrc
check_orc = orc/video orc/audio orc/adder orc/volume orc/videotestsrc
else
check_orc =
endif
@ -663,9 +663,6 @@ nodist_orc_audio_SOURCES = orc/audio.c
orc_adder_CFLAGS = $(ORC_CFLAGS)
orc_adder_LDADD = $(ORC_LIBS) -lorc-test-0.4
nodist_orc_adder_SOURCES = orc/adder.c
orc_audioconvert_CFLAGS = $(ORC_CFLAGS)
orc_audioconvert_LDADD = $(ORC_LIBS) -lorc-test-0.4
nodist_orc_audioconvert_SOURCES = orc/audioconvert.c
orc_volume_CFLAGS = $(ORC_CFLAGS)
orc_volume_LDADD = $(ORC_LIBS) -lorc-test-0.4
nodist_orc_volume_SOURCES = orc/volume.c
@ -685,10 +682,6 @@ orc/adder.c: $(top_srcdir)/gst/adder/gstadderorc.orc
$(MKDIR_P) orc/
$(ORCC) --test -o $@ $<
orc/audioconvert.c: $(top_srcdir)/gst/audioconvert/gstaudioconvertorc.orc
$(MKDIR_P) orc/
$(ORCC) --test -o $@ $<
orc/volume.c: $(top_srcdir)/gst/volume/gstvolumeorc.orc
$(MKDIR_P) orc/
$(ORCC) --test -o $@ $<

View file

@ -46,6 +46,12 @@ EXPORTS
gst_audio_clock_invalidate
gst_audio_clock_new
gst_audio_clock_reset
gst_audio_converter_flags_get_type
gst_audio_converter_free
gst_audio_converter_get_config
gst_audio_converter_new
gst_audio_converter_samples
gst_audio_converter_set_config
gst_audio_decoder_allocate_output_buffer
gst_audio_decoder_finish_frame
gst_audio_decoder_get_allocator