mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-29 12:25:37 +00:00
mad: replace with 0.10 version ported to GstAudioDecoder
Taken from commit 6e7e3657396454fe95fbd89170281865d4d1cec3 of Mark's baseaudio branch. Would probably be too risky to drop this into 0.10 given all the things mad is doing.
This commit is contained in:
parent
d0cdcd8473
commit
ced55bf549
2 changed files with 350 additions and 1693 deletions
1992
ext/mad/gstmad.c
1992
ext/mad/gstmad.c
File diff suppressed because it is too large
Load diff
|
@ -23,7 +23,10 @@
|
|||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/tag/tag.h>
|
||||
#include <gst/audio/gstbaseaudiodecoder.h>
|
||||
|
||||
#include <mad.h>
|
||||
#include <id3tag.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
@ -44,70 +47,34 @@ typedef struct _GstMadClass GstMadClass;
|
|||
|
||||
struct _GstMad
|
||||
{
|
||||
GstElement element;
|
||||
|
||||
/* pads */
|
||||
GstPad *sinkpad, *srcpad;
|
||||
GstBaseAudioDecoder element;
|
||||
|
||||
/* state */
|
||||
struct mad_stream stream;
|
||||
struct mad_frame frame;
|
||||
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 */
|
||||
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 */
|
||||
gint rate, pending_rate;
|
||||
gint channels, pending_channels;
|
||||
gint times_pending;
|
||||
|
||||
gboolean caps_set; /* used to keep track of whether to change/update caps */
|
||||
GstIndex *index;
|
||||
gint index_id;
|
||||
|
||||
gboolean check_for_xing;
|
||||
gboolean xing_found;
|
||||
|
||||
gboolean framed; /* whether there is a demuxer in front of us */
|
||||
|
||||
GList *pending_events;
|
||||
|
||||
/* reverse playback */
|
||||
GList *decode;
|
||||
GList *gather;
|
||||
GList *queued;
|
||||
gboolean process;
|
||||
/* properties */
|
||||
gboolean half;
|
||||
gboolean ignore_crc;
|
||||
};
|
||||
|
||||
struct _GstMadClass
|
||||
{
|
||||
GstElementClass parent_class;
|
||||
GstBaseAudioDecoderClass parent_class;
|
||||
};
|
||||
|
||||
GType gst_mad_get_type (void);
|
||||
gboolean gst_mad_register (GstPlugin * plugin);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
|
Loading…
Reference in a new issue