celtenc: port to audioencoder

This commit is contained in:
Mark Nauwelaerts 2011-11-16 19:11:24 +01:00
parent 5efa9ebec8
commit c90f45df00
3 changed files with 303 additions and 735 deletions

View file

@ -1,12 +1,13 @@
plugin_LTLIBRARIES = libgstcelt.la
libgstcelt_la_SOURCES = gstcelt.c gstceltdec.c gstceltenc.c
libgstcelt_la_CFLAGS = \
libgstcelt_la_CFLAGS = -DGST_USE_UNSTABLE_API \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_CFLAGS) \
$(CELT_CFLAGS)
libgstcelt_la_LIBADD = \
$(GST_PLUGINS_BASE_LIBS) -lgsttag-$(GST_MAJORMINOR) \
$(GST_PLUGINS_BASE_LIBS) \
-lgstaudio-$(GST_MAJORMINOR) -lgsttag-$(GST_MAJORMINOR) \
$(GST_BASE_LIBS) \
$(GST_LIBS) \
$(CELT_LIBS)

File diff suppressed because it is too large Load diff

View file

@ -24,7 +24,7 @@
#include <gst/gst.h>
#include <gst/base/gstadapter.h>
#include <gst/audio/gstaudioencoder.h>
#include <celt/celt.h>
#include <celt/celt_header.h>
@ -49,16 +49,11 @@ typedef struct _GstCeltEnc GstCeltEnc;
typedef struct _GstCeltEncClass GstCeltEncClass;
struct _GstCeltEnc {
GstElement element;
/* pads */
GstPad *sinkpad;
GstPad *srcpad;
GstAudioEncoder element;
CELTHeader header;
CELTMode *mode;
CELTEncoder *state;
GstAdapter *adapter;
gint bitrate;
gint frame_size;
@ -72,26 +67,12 @@ struct _GstCeltEnc {
gint channels;
gint rate;
gboolean setup;
gboolean header_sent;
gboolean eos;
guint64 samples_in;
guint64 bytes_out;
guint64 frameno;
guint64 frameno_out;
GstClockTime start_ts;
GstClockTime next_ts;
guint64 granulepos_offset;
GSList *headers;
};
struct _GstCeltEncClass {
GstElementClass parent_class;
/* signals */
void (*frame_encoded) (GstElement *element);
GstAudioEncoderClass parent_class;
};
GType gst_celt_enc_get_type (void);