mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-06 14:32:31 +00:00
celtenc: port to audioencoder
This commit is contained in:
parent
5efa9ebec8
commit
c90f45df00
3 changed files with 303 additions and 735 deletions
|
@ -1,12 +1,13 @@
|
||||||
plugin_LTLIBRARIES = libgstcelt.la
|
plugin_LTLIBRARIES = libgstcelt.la
|
||||||
|
|
||||||
libgstcelt_la_SOURCES = gstcelt.c gstceltdec.c gstceltenc.c
|
libgstcelt_la_SOURCES = gstcelt.c gstceltdec.c gstceltenc.c
|
||||||
libgstcelt_la_CFLAGS = \
|
libgstcelt_la_CFLAGS = -DGST_USE_UNSTABLE_API \
|
||||||
$(GST_PLUGINS_BASE_CFLAGS) \
|
$(GST_PLUGINS_BASE_CFLAGS) \
|
||||||
$(GST_CFLAGS) \
|
$(GST_CFLAGS) \
|
||||||
$(CELT_CFLAGS)
|
$(CELT_CFLAGS)
|
||||||
libgstcelt_la_LIBADD = \
|
libgstcelt_la_LIBADD = \
|
||||||
$(GST_PLUGINS_BASE_LIBS) -lgsttag-$(GST_MAJORMINOR) \
|
$(GST_PLUGINS_BASE_LIBS) \
|
||||||
|
-lgstaudio-$(GST_MAJORMINOR) -lgsttag-$(GST_MAJORMINOR) \
|
||||||
$(GST_BASE_LIBS) \
|
$(GST_BASE_LIBS) \
|
||||||
$(GST_LIBS) \
|
$(GST_LIBS) \
|
||||||
$(CELT_LIBS)
|
$(CELT_LIBS)
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#include <gst/base/gstadapter.h>
|
#include <gst/audio/gstaudioencoder.h>
|
||||||
|
|
||||||
#include <celt/celt.h>
|
#include <celt/celt.h>
|
||||||
#include <celt/celt_header.h>
|
#include <celt/celt_header.h>
|
||||||
|
@ -49,16 +49,11 @@ typedef struct _GstCeltEnc GstCeltEnc;
|
||||||
typedef struct _GstCeltEncClass GstCeltEncClass;
|
typedef struct _GstCeltEncClass GstCeltEncClass;
|
||||||
|
|
||||||
struct _GstCeltEnc {
|
struct _GstCeltEnc {
|
||||||
GstElement element;
|
GstAudioEncoder element;
|
||||||
|
|
||||||
/* pads */
|
|
||||||
GstPad *sinkpad;
|
|
||||||
GstPad *srcpad;
|
|
||||||
|
|
||||||
CELTHeader header;
|
CELTHeader header;
|
||||||
CELTMode *mode;
|
CELTMode *mode;
|
||||||
CELTEncoder *state;
|
CELTEncoder *state;
|
||||||
GstAdapter *adapter;
|
|
||||||
|
|
||||||
gint bitrate;
|
gint bitrate;
|
||||||
gint frame_size;
|
gint frame_size;
|
||||||
|
@ -72,26 +67,12 @@ struct _GstCeltEnc {
|
||||||
gint channels;
|
gint channels;
|
||||||
gint rate;
|
gint rate;
|
||||||
|
|
||||||
gboolean setup;
|
|
||||||
gboolean header_sent;
|
gboolean header_sent;
|
||||||
gboolean eos;
|
GSList *headers;
|
||||||
|
|
||||||
guint64 samples_in;
|
|
||||||
guint64 bytes_out;
|
|
||||||
|
|
||||||
guint64 frameno;
|
|
||||||
guint64 frameno_out;
|
|
||||||
|
|
||||||
GstClockTime start_ts;
|
|
||||||
GstClockTime next_ts;
|
|
||||||
guint64 granulepos_offset;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstCeltEncClass {
|
struct _GstCeltEncClass {
|
||||||
GstElementClass parent_class;
|
GstAudioEncoderClass parent_class;
|
||||||
|
|
||||||
/* signals */
|
|
||||||
void (*frame_encoded) (GstElement *element);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
GType gst_celt_enc_get_type (void);
|
GType gst_celt_enc_get_type (void);
|
||||||
|
|
Loading…
Reference in a new issue