Tremolo is an ARM-optimised version of xiph's tremor library.
gst/audiorate/Android.mk \
gst/volume/Android.mk \
tools/Android.mk \
gst/audiorate/Android.mk \
gst/volume/Android.mk \
tools/Android.mk \
+ ext/vorbis/Android.mk \
ext/ogg/Android.mk
GST_PLUGINS_BASE_BUILT_SOURCES := $(patsubst %, $(abspath $(GST_PLUGINS_BASE_TOP))/%, $(GST_PLUGINS_BASE_BUILT_SOURCES))
ext/ogg/Android.mk
GST_PLUGINS_BASE_BUILT_SOURCES := $(patsubst %, $(abspath $(GST_PLUGINS_BASE_TOP))/%, $(GST_PLUGINS_BASE_BUILT_SOURCES))
CPPFLAGS="$(CONFIGURE_CPPFLAGS)" \
PKG_CONFIG_LIBDIR="$(CONFIGURE_PKG_CONFIG_LIBDIR)" \
PKG_CONFIG_TOP_BUILD_DIR=/ \
CPPFLAGS="$(CONFIGURE_CPPFLAGS)" \
PKG_CONFIG_LIBDIR="$(CONFIGURE_PKG_CONFIG_LIBDIR)" \
PKG_CONFIG_TOP_BUILD_DIR=/ \
+ IVORBIS_CFLAGS="-I$(TOP)/external/tremolo -DTREMOR" \
+ IVORBIS_LIBS="-lvorbisidec" \
$(abspath $(GST_PLUGINS_BASE_TOP))/$(CONFIGURE) --host=arm-linux-androideabi \
$(abspath $(GST_PLUGINS_BASE_TOP))/$(CONFIGURE) --host=arm-linux-androideabi \
- --prefix=/system --disable-orc --disable-gio \
+ --prefix=/system --disable-orc --disable-gio --enable-ivorbis \
--disable-valgrind --disable-gtk-doc && \
for file in $(GST_PLUGINS_BASE_BUILT_SOURCES); do \
rm -f $$file && \
--disable-valgrind --disable-gtk-doc && \
for file in $(GST_PLUGINS_BASE_BUILT_SOURCES); do \
rm -f $$file && \
-include $(GST_PLUGINS_BASE_TOP)/gst/audiorate/Android.mk
-include $(GST_PLUGINS_BASE_TOP)/gst/volume/Android.mk
-include $(GST_PLUGINS_BASE_TOP)/ext/ogg/Android.mk
-include $(GST_PLUGINS_BASE_TOP)/gst/audiorate/Android.mk
-include $(GST_PLUGINS_BASE_TOP)/gst/volume/Android.mk
-include $(GST_PLUGINS_BASE_TOP)/ext/ogg/Android.mk
+-include $(GST_PLUGINS_BASE_TOP)/ext/vorbis/Android.mk
-include $(GST_PLUGINS_BASE_TOP)/tools/Android.mk
-include $(GST_PLUGINS_BASE_TOP)/tools/Android.mk
HAVE_IVORBIS=no)
AC_SUBST(IVORBIS_LIBS)
AC_SUBST(IVORBIS_CFLAGS)
HAVE_IVORBIS=no)
AC_SUBST(IVORBIS_LIBS)
AC_SUBST(IVORBIS_CFLAGS)
+ else
+ AC_CHECK_LIB(vorbisidec, vorbis_dsp_pcmout,
+ AC_DEFINE([USE_TREMOLO],1, "Define if building for android"),
+ USE_TREMOLO=no)
gstvorbistag.h \
gstvorbiscommon.h
gstvorbistag.h \
gstvorbiscommon.h
+Android.mk: Makefile.am $(BUILT_SOURCES)
+ androgenizer \
+ -:PROJECT libgstivorbisdec -:SHARED libgstivorbisdec \
+ -:TAGS eng debug \
+ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
+ -:SOURCES $(libgstivorbisdec_la_SOURCES) \
+ -:CFLAGS $(DEFS) $(DEFAULT_INCLUDES) $(libgstivorbisdec_la_CFLAGS) \
+ -:LDFLAGS $(libgstivorbisdec_la_LDFLAGS) \
+ $(libgstivorbisdec_la_LIBADD) \
+ -lvorbisidec \
+ -ldl \
+ -:PASSTHROUGH LOCAL_ARM_MODE:=arm \
+ LOCAL_MODULE_PATH:='$$(TARGET_OUT)/lib/gstreamer-0.10' \
+ > $@
*/
GstVorbisDec *vd = GST_VORBIS_DEC (object);
*/
GstVorbisDec *vd = GST_VORBIS_DEC (object);
vorbis_block_clear (&vd->vb);
vorbis_block_clear (&vd->vb);
vorbis_dsp_clear (&vd->vd);
vorbis_comment_clear (&vd->vc);
vorbis_info_clear (&vd->vi);
vorbis_dsp_clear (&vd->vd);
vorbis_comment_clear (&vd->vc);
vorbis_info_clear (&vd->vi);
g_assert (vd->initialized == FALSE);
g_assert (vd->initialized == FALSE);
+#ifdef USE_TREMOLO
+ if (G_UNLIKELY ((res = vorbis_dsp_init (&vd->vd, &vd->vi))))
+ goto synthesis_init_error;
+#else
if (G_UNLIKELY ((res = vorbis_synthesis_init (&vd->vd, &vd->vi))))
goto synthesis_init_error;
if (G_UNLIKELY ((res = vorbis_block_init (&vd->vd, &vd->vb))))
goto block_init_error;
if (G_UNLIKELY ((res = vorbis_synthesis_init (&vd->vd, &vd->vi))))
goto synthesis_init_error;
if (G_UNLIKELY ((res = vorbis_block_init (&vd->vd, &vd->vb))))
goto block_init_error;
/* Packetno = 0 if the first byte is exactly 0x01 */
packet->b_o_s = ((gst_ogg_packet_data (packet))[0] == 0x1) ? 1 : 0;
/* Packetno = 0 if the first byte is exactly 0x01 */
packet->b_o_s = ((gst_ogg_packet_data (packet))[0] == 0x1) ? 1 : 0;
+#ifdef USE_TREMOLO
+ if ((ret = vorbis_dsp_headerin (&vd->vi, &vd->vc, packet)))
+#else
if ((ret = vorbis_synthesis_headerin (&vd->vi, &vd->vc, packet)))
if ((ret = vorbis_synthesis_headerin (&vd->vi, &vd->vc, packet)))
goto header_read_error;
switch ((gst_ogg_packet_data (packet))[0]) {
goto header_read_error;
switch ((gst_ogg_packet_data (packet))[0]) {
vorbis_handle_data_packet (GstVorbisDec * vd, ogg_packet * packet,
GstClockTime timestamp, GstClockTime duration)
{
vorbis_handle_data_packet (GstVorbisDec * vd, ogg_packet * packet,
GstClockTime timestamp, GstClockTime duration)
{
+#ifdef USE_TREMOLO
+ vorbis_sample_t *pcm;
+#else
guint sample_count;
GstBuffer *out = NULL;
GstFlowReturn result;
guint sample_count;
GstBuffer *out = NULL;
GstFlowReturn result;
* packet to decode the current one so we must be carefull not to
* throw away too much. For now we decode everything and clip right
* before pushing data. */
* packet to decode the current one so we must be carefull not to
* throw away too much. For now we decode everything and clip right
* before pushing data. */
+
+#ifdef USE_TREMOLO
+ if (G_UNLIKELY (vorbis_dsp_synthesis (&vd->vd, packet, 1)))
+ goto could_not_read;
+#else
if (G_UNLIKELY (vorbis_synthesis (&vd->vb, packet)))
goto could_not_read;
if (G_UNLIKELY (vorbis_synthesis_blockin (&vd->vd, &vd->vb) < 0))
goto not_accepted;
if (G_UNLIKELY (vorbis_synthesis (&vd->vb, packet)))
goto could_not_read;
if (G_UNLIKELY (vorbis_synthesis_blockin (&vd->vd, &vd->vb) < 0))
goto not_accepted;
/* assume all goes well here */
result = GST_FLOW_OK;
/* count samples ready for reading */
/* assume all goes well here */
result = GST_FLOW_OK;
/* count samples ready for reading */
+#ifdef USE_TREMOLO
+ if ((sample_count = vorbis_dsp_pcmout (&vd->vd, NULL, 0)) == 0)
+#else
if ((sample_count = vorbis_synthesis_pcmout (&vd->vd, NULL)) == 0)
if ((sample_count = vorbis_synthesis_pcmout (&vd->vd, NULL)) == 0)
goto done;
size = sample_count * vd->vi.channels * vd->width;
goto done;
size = sample_count * vd->vi.channels * vd->width;
goto done;
/* get samples ready for reading now, should be sample_count */
goto done;
/* get samples ready for reading now, should be sample_count */
+#ifdef USE_TREMOLO
+ pcm = GST_BUFFER_DATA (out);
+ if (G_UNLIKELY ((vorbis_dsp_pcmout (&vd->vd, pcm, sample_count)) != sample_count))
+#else
if (G_UNLIKELY ((vorbis_synthesis_pcmout (&vd->vd, &pcm)) != sample_count))
if (G_UNLIKELY ((vorbis_synthesis_pcmout (&vd->vd, &pcm)) != sample_count))
/* copy samples in buffer */
vd->copy_samples ((vorbis_sample_t *) GST_BUFFER_DATA (out), pcm,
sample_count, vd->vi.channels, vd->width);
/* copy samples in buffer */
vd->copy_samples ((vorbis_sample_t *) GST_BUFFER_DATA (out), pcm,
sample_count, vd->vi.channels, vd->width);
GST_LOG_OBJECT (vd, "setting output size to %d", size);
GST_BUFFER_SIZE (out) = size;
GST_LOG_OBJECT (vd, "setting output size to %d", size);
GST_BUFFER_SIZE (out) = size;
/* no output, still keep track of timestamps */
vorbis_do_timestamps (vd, NULL, FALSE, timestamp, duration);
}
/* no output, still keep track of timestamps */
vorbis_do_timestamps (vd, NULL, FALSE, timestamp, duration);
}
+
+#ifdef USE_TREMOLO
+ vorbis_dsp_read (&vd->vd, sample_count);
+#else
vorbis_synthesis_read (&vd->vd, sample_count);
vorbis_synthesis_read (&vd->vd, sample_count);
case GST_STATE_CHANGE_PAUSED_TO_READY:
GST_DEBUG_OBJECT (vd, "PAUSED -> READY, clearing vorbis structures");
vd->initialized = FALSE;
case GST_STATE_CHANGE_PAUSED_TO_READY:
GST_DEBUG_OBJECT (vd, "PAUSED -> READY, clearing vorbis structures");
vd->initialized = FALSE;
vorbis_block_clear (&vd->vb);
vorbis_block_clear (&vd->vb);
vorbis_dsp_clear (&vd->vd);
vorbis_comment_clear (&vd->vc);
vorbis_info_clear (&vd->vi);
vorbis_dsp_clear (&vd->vd);
vorbis_comment_clear (&vd->vc);
vorbis_info_clear (&vd->vi);
#ifndef __GST_VORBIS_DEC_H__
#define __GST_VORBIS_DEC_H__
#ifndef __GST_VORBIS_DEC_H__
#define __GST_VORBIS_DEC_H__
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
#include <gst/gst.h>
#include "gstvorbisdeclib.h"
#include <gst/gst.h>
#include "gstvorbisdeclib.h"
vorbis_dsp_state vd;
vorbis_info vi;
vorbis_comment vc;
vorbis_dsp_state vd;
vorbis_info vi;
vorbis_comment vc;
gboolean initialized;
guint width;
gboolean initialized;
guint width;
-#include <tremor/ivorbiscodec.h>
+#ifdef USE_TREMOLO
+ #include <Tremolo/ivorbiscodec.h>
+ #include <Tremolo/codec_internal.h>
+ typedef ogg_int16_t vorbis_sample_t;
+#else
+ #include <tremor/ivorbiscodec.h>
+ typedef ogg_int32_t vorbis_sample_t;
+#endif
-typedef ogg_int32_t vorbis_sample_t;
typedef struct _ogg_packet_wrapper ogg_packet_wrapper;
struct _ogg_packet_wrapper {
typedef struct _ogg_packet_wrapper ogg_packet_wrapper;
struct _ogg_packet_wrapper {