Fixes . Make speex plugin compatible with both 1.0 and 1.1.

Original commit message from CVS:

* configure.ac:
* ext/speex/gstspeexdec.h:
* ext/speex/gstspeexenc.h:
Fixes .  Make speex plugin compatible with both 1.0 and 1.1.
Fix detection code in configure.ac
This commit is contained in:
Thomas Vander Stichele 2004-12-23 14:45:25 +00:00
parent 3b494824c0
commit 5701e846db
4 changed files with 74 additions and 54 deletions

View file

@ -1,3 +1,11 @@
2004-12-23 Thomas Vander Stichele <thomas at apestaart dot org>
* configure.ac:
* ext/speex/gstspeexdec.h:
* ext/speex/gstspeexenc.h:
Fixes #158382. Make speex plugin compatible with both 1.0 and 1.1.
Fix detection code in configure.ac
2004-12-23 Ronald S. Bultje <rbultje@ronald.bitfreak.net> 2004-12-23 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/matroska/matroska-demux.c: * gst/matroska/matroska-demux.c:

View file

@ -1575,10 +1575,10 @@ GST_CHECK_FEATURE(SPEEX, [speex plug-in], speex, [
AC_SUBST(SPEEX_CFLAGS) AC_SUBST(SPEEX_CFLAGS)
AC_SUBST(SPEEX_LIBS) AC_SUBST(SPEEX_LIBS)
], [ ], [
GST_CHECK_LIBHEADER(SPEEX, speex, speex_bits_init, , speex.h, [ GST_CHECK_LIBHEADER(SPEEX, speex, speex_bits_init, , speex/speex.h, [
AC_CHECK_HEADER(speex_jitter.h, [ AC_CHECK_HEADER(speex/speex_jitter.h, [
dnl speex 1.1.x : dnl speex 1.1.x :
GST_CHECK_LIBHEADER(SPEEX, speex, speex_encode_int, , speex.h, [ GST_CHECK_LIBHEADER(SPEEX, speex, speex_encode_int, , speex/speex.h, [
dnl speex 1.1.5 or + : dnl speex 1.1.5 or + :
HAVE_SPEEX="yes" HAVE_SPEEX="yes"
SPEEX_LIBS="-lspeex" SPEEX_LIBS="-lspeex"
@ -1595,9 +1595,14 @@ GST_CHECK_FEATURE(SPEEX, [speex plug-in], speex, [
SPEEX_LIBS="-lspeex" SPEEX_LIBS="-lspeex"
AC_SUBST(SPEEX_CFLAGS) AC_SUBST(SPEEX_CFLAGS)
AC_SUBST(SPEEX_LIBS) AC_SUBST(SPEEX_LIBS)
AC_DEFINE_UNQUOTED(SPEEX_1_0, 1,
[defined if speex 1.0.x API detected])
],[ ],[
HAVE_SPEEX="no" HAVE_SPEEX="no"
AC_MSG_NOTICE(You need at least 1.0.4 to compile the speex plugin) AC_MSG_NOTICE(You need at least 1.0.4 to compile the speex plugin)
], [
#include <speex/speex.h>
]) ])
]) ])
]) ])

View file

@ -21,7 +21,6 @@
#ifndef __GST_SPEEXDEC_H__ #ifndef __GST_SPEEXDEC_H__
#define __GST_SPEEXDEC_H__ #define __GST_SPEEXDEC_H__
#include <gst/gst.h> #include <gst/gst.h>
#include <speex/speex.h> #include <speex/speex.h>
#include <speex/speex_callbacks.h> #include <speex/speex_callbacks.h>
@ -32,7 +31,6 @@
extern "C" { extern "C" {
#endif /* __cplusplus */ #endif /* __cplusplus */
#define GST_TYPE_SPEEXDEC \ #define GST_TYPE_SPEEXDEC \
(gst_speex_dec_get_type()) (gst_speex_dec_get_type())
#define GST_SPEEXDEC(obj) \ #define GST_SPEEXDEC(obj) \
@ -50,25 +48,30 @@ typedef struct _GstSpeexDecClass GstSpeexDecClass;
#define DEC_MAX_FRAME_SIZE 2000 #define DEC_MAX_FRAME_SIZE 2000
struct _GstSpeexDec { struct _GstSpeexDec {
GstElement element; GstElement element;
/* pads */ /* pads */
GstPad *sinkpad,*srcpad; GstPad *sinkpad,
*srcpad;
void *state; void *state;
SpeexStereoState stereo; SpeexStereoState stereo;
const SpeexMode * mode; #ifdef SPEEX_1_0
SpeexHeader *header; SpeexMode *mode;
SpeexCallback callback; #else
SpeexBits bits; const SpeexMode *mode;
#endif
gfloat output[DEC_MAX_FRAME_SIZE]; SpeexHeader *header;
SpeexCallback callback;
SpeexBits bits;
gboolean enh; gfloat output[DEC_MAX_FRAME_SIZE];
gint frame_size; gboolean enh;
guint64 samples_out;
guint64 packetno; gint frame_size;
guint64 samples_out;
guint64 packetno;
}; };
struct _GstSpeexDecClass { struct _GstSpeexDecClass {

View file

@ -59,54 +59,58 @@ typedef struct _GstSpeexEnc GstSpeexEnc;
typedef struct _GstSpeexEncClass GstSpeexEncClass; typedef struct _GstSpeexEncClass GstSpeexEncClass;
struct _GstSpeexEnc { struct _GstSpeexEnc {
GstElement element; GstElement element;
/* pads */ /* pads */
GstPad *sinkpad, GstPad *sinkpad,
*srcpad; *srcpad;
gint packet_count; gint packet_count;
gint n_packets; gint n_packets;
SpeexBits bits; SpeexBits bits;
SpeexHeader header; SpeexHeader header;
const SpeexMode *speex_mode; #if SPEEX_1_0
void *state; SpeexMode *speex_mode;
GstSpeexMode mode; #else
GstAdapter *adapter; const SpeexMode *speex_mode;
#endif
void *state;
GstSpeexMode mode;
GstAdapter *adapter;
gfloat quality; gfloat quality;
gint bitrate; gint bitrate;
gboolean vbr; gboolean vbr;
gint abr; gint abr;
gboolean vad; gboolean vad;
gboolean dtx; gboolean dtx;
gint complexity; gint complexity;
gint nframes; gint nframes;
gint lookahead; gint lookahead;
gint channels; gint channels;
gint rate; gint rate;
gboolean setup; gboolean setup;
gboolean header_sent; gboolean header_sent;
gboolean eos; gboolean eos;
guint64 samples_in; guint64 samples_in;
guint64 bytes_out; guint64 bytes_out;
GstTagList *tags; GstTagList *tags;
gchar *last_message; gchar *last_message;
gint frame_size; gint frame_size;
guint64 frameno; guint64 frameno;
gchar *comments; gchar *comments;
gint comment_len; gint comment_len;
gfloat input[MAX_FRAME_SIZE]; gfloat input[MAX_FRAME_SIZE];
}; };
struct _GstSpeexEncClass { struct _GstSpeexEncClass {