mad: port to audiodecoder
This commit is contained in:
parent
220b88fcc1
commit
260824b278
@ -3,10 +3,10 @@ plugin_LTLIBRARIES = libgstmad.la
|
|||||||
libgstmad_la_SOURCES = gstmad.c
|
libgstmad_la_SOURCES = gstmad.c
|
||||||
|
|
||||||
libgstmad_la_CFLAGS = \
|
libgstmad_la_CFLAGS = \
|
||||||
$(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) \
|
$(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) \
|
||||||
$(MAD_CFLAGS)
|
$(MAD_CFLAGS)
|
||||||
libgstmad_la_LIBADD = \
|
libgstmad_la_LIBADD = \
|
||||||
$(GST_PLUGINS_BASE_LIBS) -lgsttag-$(GST_MAJORMINOR) \
|
$(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) $(GST_LIBS) \
|
||||||
-lgstaudio-$(GST_MAJORMINOR) $(MAD_LIBS)
|
-lgstaudio-$(GST_MAJORMINOR) $(MAD_LIBS)
|
||||||
libgstmad_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
libgstmad_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
||||||
libgstmad_la_LIBTOOLFLAGS = --tag=disable-static
|
libgstmad_la_LIBTOOLFLAGS = --tag=disable-static
|
||||||
|
1984
ext/mad/gstmad.c
1984
ext/mad/gstmad.c
File diff suppressed because it is too large
Load Diff
@ -23,7 +23,10 @@
|
|||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#include <gst/tag/tag.h>
|
#include <gst/tag/tag.h>
|
||||||
|
#include <gst/audio/gstaudiodecoder.h>
|
||||||
|
|
||||||
#include <mad.h>
|
#include <mad.h>
|
||||||
|
#include <id3tag.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
@ -44,70 +47,34 @@ typedef struct _GstMadClass GstMadClass;
|
|||||||
|
|
||||||
struct _GstMad
|
struct _GstMad
|
||||||
{
|
{
|
||||||
GstElement element;
|
GstAudioDecoder element;
|
||||||
|
|
||||||
/* pads */
|
|
||||||
GstPad *sinkpad, *srcpad;
|
|
||||||
|
|
||||||
/* state */
|
/* state */
|
||||||
struct mad_stream stream;
|
struct mad_stream stream;
|
||||||
struct mad_frame frame;
|
struct mad_frame frame;
|
||||||
struct mad_synth synth;
|
struct mad_synth synth;
|
||||||
guchar *tempbuffer; /* temporary buffer to serve to mad */
|
|
||||||
glong tempsize; /* running count of temp buffer size */
|
|
||||||
GstClockTime last_ts;
|
|
||||||
guint64 base_byte_offset;
|
|
||||||
guint64 bytes_consumed; /* since the base_byte_offset */
|
|
||||||
guint64 total_samples; /* the number of samples since the sync point */
|
|
||||||
|
|
||||||
gboolean in_error; /* set when mad's in an error state */
|
|
||||||
gboolean restart;
|
|
||||||
gboolean discont;
|
|
||||||
guint64 segment_start;
|
|
||||||
GstSegment segment;
|
|
||||||
gboolean need_newsegment;
|
|
||||||
|
|
||||||
/* info */
|
/* info */
|
||||||
struct mad_header header;
|
struct mad_header header;
|
||||||
gboolean new_header;
|
|
||||||
guint framecount;
|
|
||||||
gint vbr_average; /* average bitrate */
|
|
||||||
guint64 vbr_rate; /* average * framecount */
|
|
||||||
|
|
||||||
gboolean half;
|
|
||||||
gboolean ignore_crc;
|
|
||||||
|
|
||||||
GstTagList *tags;
|
|
||||||
|
|
||||||
/* negotiated format */
|
/* negotiated format */
|
||||||
gint rate, pending_rate;
|
gint rate, pending_rate;
|
||||||
gint channels, pending_channels;
|
gint channels, pending_channels;
|
||||||
gint times_pending;
|
gint times_pending;
|
||||||
|
|
||||||
gboolean caps_set; /* used to keep track of whether to change/update caps */
|
gboolean caps_set; /* used to keep track of whether to change/update caps */
|
||||||
GstIndex *index;
|
|
||||||
gint index_id;
|
|
||||||
|
|
||||||
gboolean check_for_xing;
|
/* properties */
|
||||||
gboolean xing_found;
|
gboolean half;
|
||||||
|
gboolean ignore_crc;
|
||||||
gboolean framed; /* whether there is a demuxer in front of us */
|
|
||||||
|
|
||||||
GList *pending_events;
|
|
||||||
|
|
||||||
/* reverse playback */
|
|
||||||
GList *decode;
|
|
||||||
GList *gather;
|
|
||||||
GList *queued;
|
|
||||||
gboolean process;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstMadClass
|
struct _GstMadClass
|
||||||
{
|
{
|
||||||
GstElementClass parent_class;
|
GstAudioDecoderClass parent_class;
|
||||||
};
|
};
|
||||||
|
|
||||||
GType gst_mad_get_type (void);
|
GType gst_mad_get_type (void);
|
||||||
|
gboolean gst_mad_register (GstPlugin * plugin);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user