speexenc: port to audioencoder

This commit is contained in:
Mark Nauwelaerts 2011-09-29 17:32:23 +02:00
parent e8bcd41d73
commit c1909c32c5
3 changed files with 221 additions and 688 deletions

View file

@ -1,13 +1,14 @@
plugin_LTLIBRARIES = libgstspeex.la
libgstspeex_la_SOURCES = gstspeex.c gstspeexdec.c gstspeexenc.c
libgstspeex_la_CFLAGS = \
libgstspeex_la_CFLAGS = -DGST_USE_UNSTABLE_API \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
$(GST_CFLAGS) \
$(SPEEX_CFLAGS)
libgstspeex_la_LIBADD = \
$(GST_PLUGINS_BASE_LIBS) -lgsttag-$(GST_MAJORMINOR) \
$(GST_PLUGINS_BASE_LIBS) \
-lgsttag-$(GST_MAJORMINOR) -lgstaudio-$(GST_MAJORMINOR) \
$(GST_BASE_LIBS) \
$(GST_LIBS) \
$(SPEEX_LIBS)

File diff suppressed because it is too large Load diff

View file

@ -23,7 +23,7 @@
#include <gst/gst.h>
#include <gst/base/gstadapter.h>
#include <gst/audio/gstaudioencoder.h>
#include <speex/speex.h>
#include <speex/speex_header.h>
@ -53,14 +53,7 @@ typedef struct _GstSpeexEnc GstSpeexEnc;
typedef struct _GstSpeexEncClass GstSpeexEncClass;
struct _GstSpeexEnc {
GstElement element;
/* pads */
GstPad *sinkpad,
*srcpad;
gint packet_count;
gint n_packets;
GstAudioEncoder element;
SpeexBits bits;
SpeexHeader header;
@ -70,9 +63,9 @@ struct _GstSpeexEnc {
const SpeexMode *speex_mode;
#endif
void *state;
GstSpeexMode mode;
GstAdapter *adapter;
/* properties */
GstSpeexMode mode;
gfloat quality;
gint bitrate;
gboolean vbr;
@ -81,37 +74,24 @@ struct _GstSpeexEnc {
gboolean dtx;
gint complexity;
gint nframes;
gint lookahead;
gchar *last_message;
gint channels;
gint rate;
gboolean setup;
gboolean header_sent;
guint64 samples_in;
guint64 bytes_out;
GstTagList *tags;
gchar *last_message;
gint frame_size;
guint64 frameno;
guint64 frameno_out;
gint lookahead;
guint8 *comments;
gint comment_len;
/* Timestamp and granulepos tracking */
GstClockTime start_ts;
GstClockTime next_ts;
guint64 granulepos_offset;
};
struct _GstSpeexEncClass {
GstElementClass parent_class;
GstAudioEncoderClass parent_class;
/* signals */
void (*frame_encoded) (GstElement *element);