mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
speexenc: port to audioencoder
This commit is contained in:
parent
e8bcd41d73
commit
c1909c32c5
3 changed files with 221 additions and 688 deletions
|
@ -1,13 +1,14 @@
|
||||||
plugin_LTLIBRARIES = libgstspeex.la
|
plugin_LTLIBRARIES = libgstspeex.la
|
||||||
|
|
||||||
libgstspeex_la_SOURCES = gstspeex.c gstspeexdec.c gstspeexenc.c
|
libgstspeex_la_SOURCES = gstspeex.c gstspeexdec.c gstspeexenc.c
|
||||||
libgstspeex_la_CFLAGS = \
|
libgstspeex_la_CFLAGS = -DGST_USE_UNSTABLE_API \
|
||||||
$(GST_PLUGINS_BASE_CFLAGS) \
|
$(GST_PLUGINS_BASE_CFLAGS) \
|
||||||
$(GST_BASE_CFLAGS) \
|
$(GST_BASE_CFLAGS) \
|
||||||
$(GST_CFLAGS) \
|
$(GST_CFLAGS) \
|
||||||
$(SPEEX_CFLAGS)
|
$(SPEEX_CFLAGS)
|
||||||
libgstspeex_la_LIBADD = \
|
libgstspeex_la_LIBADD = \
|
||||||
$(GST_PLUGINS_BASE_LIBS) -lgsttag-$(GST_MAJORMINOR) \
|
$(GST_PLUGINS_BASE_LIBS) \
|
||||||
|
-lgsttag-$(GST_MAJORMINOR) -lgstaudio-$(GST_MAJORMINOR) \
|
||||||
$(GST_BASE_LIBS) \
|
$(GST_BASE_LIBS) \
|
||||||
$(GST_LIBS) \
|
$(GST_LIBS) \
|
||||||
$(SPEEX_LIBS)
|
$(SPEEX_LIBS)
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#include <gst/base/gstadapter.h>
|
#include <gst/audio/gstaudioencoder.h>
|
||||||
|
|
||||||
#include <speex/speex.h>
|
#include <speex/speex.h>
|
||||||
#include <speex/speex_header.h>
|
#include <speex/speex_header.h>
|
||||||
|
@ -53,14 +53,7 @@ typedef struct _GstSpeexEnc GstSpeexEnc;
|
||||||
typedef struct _GstSpeexEncClass GstSpeexEncClass;
|
typedef struct _GstSpeexEncClass GstSpeexEncClass;
|
||||||
|
|
||||||
struct _GstSpeexEnc {
|
struct _GstSpeexEnc {
|
||||||
GstElement element;
|
GstAudioEncoder element;
|
||||||
|
|
||||||
/* pads */
|
|
||||||
GstPad *sinkpad,
|
|
||||||
*srcpad;
|
|
||||||
|
|
||||||
gint packet_count;
|
|
||||||
gint n_packets;
|
|
||||||
|
|
||||||
SpeexBits bits;
|
SpeexBits bits;
|
||||||
SpeexHeader header;
|
SpeexHeader header;
|
||||||
|
@ -70,9 +63,9 @@ struct _GstSpeexEnc {
|
||||||
const SpeexMode *speex_mode;
|
const SpeexMode *speex_mode;
|
||||||
#endif
|
#endif
|
||||||
void *state;
|
void *state;
|
||||||
GstSpeexMode mode;
|
|
||||||
GstAdapter *adapter;
|
|
||||||
|
|
||||||
|
/* properties */
|
||||||
|
GstSpeexMode mode;
|
||||||
gfloat quality;
|
gfloat quality;
|
||||||
gint bitrate;
|
gint bitrate;
|
||||||
gboolean vbr;
|
gboolean vbr;
|
||||||
|
@ -81,37 +74,24 @@ struct _GstSpeexEnc {
|
||||||
gboolean dtx;
|
gboolean dtx;
|
||||||
gint complexity;
|
gint complexity;
|
||||||
gint nframes;
|
gint nframes;
|
||||||
|
gchar *last_message;
|
||||||
gint lookahead;
|
|
||||||
|
|
||||||
gint channels;
|
gint channels;
|
||||||
gint rate;
|
gint rate;
|
||||||
|
|
||||||
gboolean setup;
|
|
||||||
gboolean header_sent;
|
gboolean header_sent;
|
||||||
|
|
||||||
guint64 samples_in;
|
|
||||||
guint64 bytes_out;
|
|
||||||
|
|
||||||
GstTagList *tags;
|
GstTagList *tags;
|
||||||
|
|
||||||
gchar *last_message;
|
|
||||||
|
|
||||||
gint frame_size;
|
gint frame_size;
|
||||||
guint64 frameno;
|
gint lookahead;
|
||||||
guint64 frameno_out;
|
|
||||||
|
|
||||||
guint8 *comments;
|
guint8 *comments;
|
||||||
gint comment_len;
|
gint comment_len;
|
||||||
|
|
||||||
/* Timestamp and granulepos tracking */
|
|
||||||
GstClockTime start_ts;
|
|
||||||
GstClockTime next_ts;
|
|
||||||
guint64 granulepos_offset;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstSpeexEncClass {
|
struct _GstSpeexEncClass {
|
||||||
GstElementClass parent_class;
|
GstAudioEncoderClass parent_class;
|
||||||
|
|
||||||
/* signals */
|
/* signals */
|
||||||
void (*frame_encoded) (GstElement *element);
|
void (*frame_encoded) (GstElement *element);
|
||||||
|
|
Loading…
Reference in a new issue