static void gst_mp3parse_class_init (GstMPEGAudioParseClass * klass);
-
static void gst_mp3parse_base_init (gpointer klass);
-
static void gst_mp3parse_init (GstMPEGAudioParse * mp3parse,
GstMPEGAudioParseClass * klass);
static gboolean gst_mp3parse_sink_event (GstPad * pad, GstEvent * event);
-
static GstFlowReturn gst_mp3parse_chain (GstPad * pad, GstBuffer * buffer);
-
static gboolean mp3parse_src_query (GstPad * pad, GstQuery * query);
-
static const GstQueryType *mp3parse_get_query_types (GstPad * pad);
-
static gboolean mp3parse_src_event (GstPad * pad, GstEvent * event);
static int head_check (GstMPEGAudioParse * mp3parse, unsigned long head);
static void gst_mp3parse_dispose (GObject * object);
-
static void gst_mp3parse_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
static void gst_mp3parse_get_property (GObject * object, guint prop_id,
gst_mp3_channel_mode_get_type (void)
{
static GType mp3_channel_mode_type = 0;
-
static GEnumValue mp3_channel_mode[] = {
{MP3_CHANNEL_MODE_UNKNOWN, "Unknown", "unknown"},
{MP3_CHANNEL_MODE_MONO, "Mono", "mono"},
gulong mode, samplerate, bitrate, layer, channels, padding, crc;
gulong version;
gint lsf, mpg25;
-
GEnumValue *mode_enum;
if (header & (1 << 20)) {
gst_mp3parse_class_init (GstMPEGAudioParseClass * klass)
{
GObjectClass *gobject_class;
-
GstElementClass *gstelement_class;
gobject_class = (GObjectClass *) klass;
gst_mp3parse_sink_event (GstPad * pad, GstEvent * event)
{
gboolean res = TRUE;
-
GstMPEGAudioParse *mp3parse;
-
GstEvent **eventp;
mp3parse = GST_MP3PARSE (gst_pad_get_parent (pad));
case GST_EVENT_NEWSEGMENT:
{
gdouble rate, applied_rate;
-
GstFormat format;
-
gint64 start, stop, pos;
-
gboolean update;
gst_event_parse_new_segment_full (event, &update, &rate, &applied_rate,
g_mutex_lock (mp3parse->pending_accurate_seeks_lock);
if (format == GST_FORMAT_BYTES && mp3parse->pending_accurate_seeks) {
MPEGAudioPendingAccurateSeek *seek = NULL;
-
GSList *node;
for (node = mp3parse->pending_accurate_seeks; node; node = node->next) {
guint mode, guint crc)
{
GstBuffer *outbuf;
-
guint bitrate;
-
GstFlowReturn ret = GST_FLOW_OK;
-
GstClockTime push_start;
-
GstTagList *taglist;
outbuf = gst_adapter_take_buffer (mp3parse->adapter, size);
gst_mp3parse_handle_first_frame (GstMPEGAudioParse * mp3parse)
{
GstTagList *taglist;
-
gchar *codec;
-
const guint32 xing_id = 0x58696e67; /* 'Xing' in hex */
-
const guint32 info_id = 0x496e666f; /* 'Info' in hex - found in LAME CBR files */
-
const guint32 vbri_id = 0x56425249; /* 'VBRI' in hex */
gint offset;
guint64 avail;
-
guint32 read_id;
-
const guint8 *data;
/* Output codec tag */
read_id = GST_READ_UINT32_BE (data);
if (read_id == xing_id || read_id == info_id) {
guint32 xing_flags;
-
guint bytes_needed = offset + 8;
-
gint64 total_bytes;
-
GstClockTime total_time;
GST_DEBUG_OBJECT (mp3parse, "Found Xing header marker 0x%x", xing_id);
if (xing_flags & XING_TOC_FLAG) {
int i, percent = 0;
-
guchar *table = mp3parse->xing_seek_table;
-
guchar old = 0;
if (data[0] != 0) {
mp3parse->xing_seek_table_inverse[i] = percent * 100;
} else if (table[percent] < i && percent < 99) {
gdouble fa, fb, fx;
-
gint a = percent, b = percent + 1;
fa = table[a];
mp3parse->xing_seek_table_inverse[i] = (guint16) (fx * 100);
} else if (percent == 98 && table[percent + 1] <= i) {
gdouble fa, fb, fx;
-
gint a = percent + 1, b = 100;
fa = table[a];
mp3parse->xing_vbr_scale);
} else if (read_id == vbri_id) {
gint64 total_bytes, total_frames;
-
GstClockTime total_time;
-
guint16 nseek_points;
GST_DEBUG_OBJECT (mp3parse, "Found VBRI header marker 0x%x", vbri_id);
if (nseek_points > 0) {
guint scale, seek_bytes, seek_frames;
-
gint i;
mp3parse->vbri_seek_points = nseek_points;
gst_mp3parse_chain (GstPad * pad, GstBuffer * buf)
{
GstFlowReturn flow = GST_FLOW_OK;
-
GstMPEGAudioParse *mp3parse;
-
const guchar *data;
-
guint32 header;
-
int bpf;
-
guint available;
-
GstClockTime timestamp;
mp3parse = GST_MP3PARSE (GST_PAD_PARENT (pad));
*************************************************************************/
if (mp3parse->resyncing) {
guint32 header2;
-
const guint8 *data2;
/* wait until we have the the entire current frame as well as the next
gst_mp3parse_change_state (GstElement * element, GstStateChange transition)
{
GstMPEGAudioParse *mp3parse;
-
GstStateChangeReturn result;
mp3parse = GST_MP3PARSE (element);
gint64 * bytepos)
{
gint64 total_bytes;
-
GstClockTime total_time;
/* -1 always maps to -1 */
mp3parse_total_bytes (mp3parse, &total_bytes) &&
mp3parse_total_time (mp3parse, &total_time)) {
gdouble fa, fb, fx;
-
gdouble percent =
CLAMP ((100.0 * gst_util_guint64_to_gdouble (ts)) /
gst_util_guint64_to_gdouble (total_time), 0.0, 100.0);
mp3parse_total_bytes (mp3parse, &total_bytes) &&
mp3parse_total_time (mp3parse, &total_time)) {
gint i, j;
-
gdouble a, b, fa, fb;
i = gst_util_uint64_scale (ts, mp3parse->vbri_seek_points - 1, total_time);
gint64 bytepos, GstClockTime * ts, gboolean from_total_time)
{
gint64 total_bytes;
-
GstClockTime total_time;
if (bytepos == -1) {
mp3parse_total_bytes (mp3parse, &total_bytes) &&
mp3parse_total_time (mp3parse, &total_time)) {
gdouble fa, fb, fx;
-
gdouble pos = CLAMP ((bytepos * 256.0) / total_bytes, 0.0, 256.0);
-
gint index = CLAMP (pos, 0, 255);
fa = mp3parse->xing_seek_table_inverse[index];
mp3parse_total_bytes (mp3parse, &total_bytes) &&
mp3parse_total_time (mp3parse, &total_time)) {
gint i = 0;
-
guint64 sum = 0;
-
gdouble a, b, fa, fb;
mp3parse_handle_seek (GstMPEGAudioParse * mp3parse, GstEvent * event)
{
GstFormat format;
-
gdouble rate;
-
GstSeekFlags flags;
-
GstSeekType cur_type, stop_type;
-
gint64 cur, stop;
-
gint64 byte_cur, byte_stop;
gst_event_parse_seek (event, &rate, &format, &flags, &cur_type, &cur,
start = 0;
} else {
MPEGAudioSeekEntry *entry = NULL, *start_entry = NULL, *stop_entry = NULL;
-
GList *start_node, *stop_node;
gint64 seek_ts = (cur > mp3parse->max_bitreservoir) ?
(cur - mp3parse->max_bitreservoir) : 0;
mp3parse_src_event (GstPad * pad, GstEvent * event)
{
GstMPEGAudioParse *mp3parse = GST_MP3PARSE (gst_pad_get_parent (pad));
-
gboolean res = FALSE;
g_return_val_if_fail (mp3parse != NULL, FALSE);
mp3parse_src_query (GstPad * pad, GstQuery * query)
{
GstFormat format;
-
GstClockTime total;
-
GstMPEGAudioParse *mp3parse = GST_MP3PARSE (gst_pad_get_parent (pad));
-
gboolean res = FALSE;
-
GstPad *peer;
g_return_val_if_fail (mp3parse != NULL, FALSE);