AS_HELP_STRING([--disable-alsa], [disable use of ALSA]))
AC_ARG_ENABLE(external-libs,
- AS_HELP_STRING([--disable-external-libs], [disable use of FLAC, Ogg and Vorbis [[default=no]]]))
+ AS_HELP_STRING([--disable-external-libs], [disable use of Ogg and Vorbis [[default=no]]]))
AC_ARG_ENABLE(octave,
AS_HELP_STRING([--enable-octave], [disable building of GNU Octave module]))
fi
#====================================================================================
-# Check for Ogg, Vorbis and FLAC.
+# Check for Ogg, Vorbis.
HAVE_EXTERNAL_XIPH_LIBS=0
EXTERNAL_XIPH_CFLAGS=""
if test -n "$PKG_CONFIG" ; then
if test x$enable_external_libs = xno ; then
- AC_MSG_WARN([[*** External libs (FLAC, Ogg, Vorbis) disabled. ***]])
+ AC_MSG_WARN([[*** External libs (Ogg, Vorbis) disabled. ***]])
else
- PKG_CHECK_MOD_VERSION(FLAC, flac >= 1.3.1, ac_cv_flac=yes, ac_cv_flac=no)
-
- # Make sure the FLAC_CFLAGS value is sane.
- FLAC_CFLAGS=`echo $FLAC_CFLAGS | $SED "s|include/FLAC|include|"`
-
PKG_CHECK_MOD_VERSION(OGG, ogg >= 1.1.3, ac_cv_ogg=yes, ac_cv_ogg=no)
if test x$enable_experimental = xyes ; then
enable_external_libs=yes
fi
- if test x$ac_cv_flac$ac_cv_ogg$ac_cv_vorbis$ac_cv_vorbisenc = "xyesyesyesyes" ; then
+ if test x$ac_cv_ogg$ac_cv_vorbis$ac_cv_vorbisenc = "xyesyesyes" ; then
HAVE_EXTERNAL_XIPH_LIBS=1
enable_external_libs=yes
- EXTERNAL_XIPH_CFLAGS="$FLAC_CFLAGS $OGG_CFLAGS $VORBIS_CFLAGS $VORBISENC_CFLAGS $SPEEX_CFLAGS"
- EXTERNAL_XIPH_LIBS="$FLAC_LIBS $OGG_LIBS $VORBIS_LIBS $VORBISENC_LIBS $SPEEX_LIBS "
+ EXTERNAL_XIPH_CFLAGS="$OGG_CFLAGS $VORBIS_CFLAGS $VORBISENC_CFLAGS $SPEEX_CFLAGS"
+ EXTERNAL_XIPH_LIBS="$OGG_LIBS $VORBIS_LIBS $VORBISENC_LIBS $SPEEX_LIBS "
else
echo
AC_MSG_WARN([[*** One or more of the external libraries (ie libflac, libogg and]])
fi
fi
-AC_DEFINE_UNQUOTED([HAVE_EXTERNAL_XIPH_LIBS], $HAVE_EXTERNAL_XIPH_LIBS, [Will be set to 1 if flac, ogg and vorbis are available.])
+AC_DEFINE_UNQUOTED([HAVE_EXTERNAL_XIPH_LIBS], $HAVE_EXTERNAL_XIPH_LIBS, [Will be set to 1 if ogg and vorbis are available.])
#====================================================================================
# Check for libsqlite3 (only used in regtest).
Experimental code : ................... ${enable_experimental:-no}
Using ALSA in example programs : ...... ${enable_alsa:-no}
- External FLAC/Ogg/Vorbis : ............ ${enable_external_libs:-no}
+ External Ogg/Vorbis : .................. ${enable_external_libs:-no}
])
if test -z "$PKG_CONFIG" ; then
echo " *****************************************************************"
echo " *** The pkg-config program is missing. ***"
- echo " *** External FLAC/Ogg/Vorbis libs cannot be found without it. ***"
+ echo " *** External Ogg/Vorbis libs cannot be found without it. ***"
echo " *** http://pkg-config.freedesktop.org/wiki/ ***"
echo " *****************************************************************"
echo
encode_file (argv [1], "imaadpcm.wav", SF_FORMAT_WAV | SF_FORMAT_MS_ADPCM) ;
encode_file (argv [1], "msadpcm.wav", SF_FORMAT_WAV | SF_FORMAT_IMA_ADPCM) ;
encode_file (argv [1], "gsm610.wav" , SF_FORMAT_WAV | SF_FORMAT_GSM610) ;
+#if 0 /* For temporal testing of encoding ogg/vorbis functionality */
+ encode_file (argv [1], "pcm16.ogg" , SF_FORMAT_OGG | SF_FORMAT_VORBIS) ;
+#endif
/* Soundforge W64. */
encode_file (argv [1], "pcmu8.w64" , SF_FORMAT_W64 | SF_FORMAT_PCM_U8) ;
#if HAVE_EXTERNAL_XIPH_LIBS
+
#include <ogg/ogg.h>
#include <vorbis/codec.h>
+
+#ifdef __TIZEN__
+#include <dlfcn.h> /* for dlopen */
+#else
#include <vorbis/vorbisenc.h>
+#endif
#include "ogg.h"
/* Encoding quality in range [0.0, 1.0]. */
double quality ;
+
+#ifdef __TIZEN__
+ /* func ptr for encoder */
+ void *dl;
+#endif
} VORBIS_PRIVATE ;
static int
return 0 ;
} /* vorbis_read_header */
+
+#ifdef __TIZEN__
+#define VORBIS_ENC_SO_NAME "/usr/lib/libvorbisenc.so.2" /* FIXME : Any good way to avoid hardcoding? */
+#define VORBIS_ENC_INIT_VBR "vorbis_encode_init_vbr"
+
+static int
+_vorbis_encode_init(SF_PRIVATE *psf)
+{
+ int (*fn) (vorbis_info *, long, long, float);
+ void *dl = NULL;
+ VORBIS_PRIVATE *vdata = (VORBIS_PRIVATE *) psf->codec_data ;
+
+ /* load so */
+ dl = dlopen(VORBIS_ENC_SO_NAME, RTLD_GLOBAL | RTLD_NOW);
+ if (!dl) {
+ psf_log_printf (psf, "failed to dlopen [%s], error [%s]\n", VORBIS_ENC_SO_NAME, dlerror());
+ return -1;
+ }
+ dlerror();
+
+ vdata->dl = dl;
+
+ /* load symbol */
+ fn = dlsym(dl, VORBIS_ENC_INIT_VBR);
+ if (!fn) {
+ psf_log_printf (psf, "failed to dlsym [%s], error [%s]\n", VORBIS_ENC_INIT_VBR, dlerror());
+ return -1;
+ }
+ dlerror();
+
+ /* call function */
+ return fn(&vdata->vinfo, psf->sf.channels, psf->sf.samplerate, vdata->quality);
+}
+#endif /* __TIZEN__ */
+
static int
vorbis_write_header (SF_PRIVATE *psf, int UNUSED (calc_length))
{
vorbis_info_init (&vdata->vinfo) ;
/* The style of encoding should be selectable here, VBR quality mode. */
+#ifdef __TIZEN__
+ ret = _vorbis_encode_init(psf);
+#else
ret = vorbis_encode_init_vbr (&vdata->vinfo, psf->sf.channels, psf->sf.samplerate, vdata->quality) ;
+#endif
#if 0
ret = vorbis_encode_init (&vdata->vinfo, psf->sf.channels, psf->sf.samplerate, -1, 128000, -1) ; /* average bitrate mode */
vorbis_comment_clear (&vdata->vcomment) ;
vorbis_info_clear (&vdata->vinfo) ;
+#ifdef __TIZEN__
+ if (vdata->dl) {
+ dlclose(vdata->dl);
+ vdata->dl = NULL;
+ }
+#endif
+
return 0 ;
} /* vorbis_close */