mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
case ranges is a gcc extension, removing them
Original commit message from CVS: case ranges is a gcc extension, removing them
This commit is contained in:
parent
2fccb3457c
commit
ce19421a31
1 changed files with 118 additions and 158 deletions
|
@ -404,38 +404,31 @@ gst_mpeg_demux_parse_syshead (GstMPEGParse *mpeg_parse, GstBuffer *buffer)
|
||||||
buf_byte_size_bound = STD_buffer_size_bound * 1024;
|
buf_byte_size_bound = STD_buffer_size_bound * 1024;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (stream_id) {
|
if (stream_id == 0xBD) {
|
||||||
/* private_stream_1 */
|
/* private_stream_1 */
|
||||||
case 0xBD:
|
|
||||||
name = NULL;
|
name = NULL;
|
||||||
outstream = NULL;
|
outstream = NULL;
|
||||||
break;
|
} else if (stream_id == 0xBF) {
|
||||||
/* private_stream_2 */
|
/* private_stream_2 */
|
||||||
case 0xBF:
|
|
||||||
name = g_strdup_printf ("private_stream_2");
|
name = g_strdup_printf ("private_stream_2");
|
||||||
outstream = &mpeg_demux->private_2_stream;
|
outstream = &mpeg_demux->private_2_stream;
|
||||||
newtemp = GST_PAD_TEMPLATE_GET (private2_factory);
|
newtemp = GST_PAD_TEMPLATE_GET (private2_factory);
|
||||||
break;
|
} else if (stream_id >= 0xC0 && stream_id < 0xE0) {
|
||||||
/* Audio */
|
/* Audio */
|
||||||
case 0xC0 ... 0xDF:
|
|
||||||
name = g_strdup_printf ("audio_%02d", stream_id & 0x1F);
|
name = g_strdup_printf ("audio_%02d", stream_id & 0x1F);
|
||||||
outstream = &mpeg_demux->audio_stream[stream_id & 0x1F];
|
outstream = &mpeg_demux->audio_stream[stream_id & 0x1F];
|
||||||
newtemp = GST_PAD_TEMPLATE_GET (audio_factory);
|
newtemp = GST_PAD_TEMPLATE_GET (audio_factory);
|
||||||
break;
|
} else if (stream_id >= 0xE0 && stream_id < 0xF0) {
|
||||||
/* Video */
|
/* Video */
|
||||||
case 0xE0 ... 0xEF:
|
|
||||||
name = g_strdup_printf ("video_%02d", stream_id & 0x0F);
|
name = g_strdup_printf ("video_%02d", stream_id & 0x0F);
|
||||||
outstream = &mpeg_demux->video_stream[stream_id & 0x0F];
|
outstream = &mpeg_demux->video_stream[stream_id & 0x0F];
|
||||||
if (!GST_MPEG_PARSE_IS_MPEG2 (mpeg_demux)) {
|
if (!GST_MPEG_PARSE_IS_MPEG2 (mpeg_demux)) {
|
||||||
newtemp = GST_PAD_TEMPLATE_GET (video_mpeg1_factory);
|
newtemp = GST_PAD_TEMPLATE_GET (video_mpeg1_factory);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
newtemp = GST_PAD_TEMPLATE_GET (video_mpeg2_factory);
|
newtemp = GST_PAD_TEMPLATE_GET (video_mpeg2_factory);
|
||||||
}
|
}
|
||||||
break;
|
} else {
|
||||||
default:
|
|
||||||
GST_DEBUG (0, "unkown stream id %d", stream_id);
|
GST_DEBUG (0, "unkown stream id %d", stream_id);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG (0, "stream ID 0x%02X (%s)", stream_id, name);
|
GST_DEBUG (0, "stream ID 0x%02X (%s)", stream_id, name);
|
||||||
|
@ -615,43 +608,32 @@ done:
|
||||||
GST_DEBUG (0, "headerlen is %d, datalen is %d",
|
GST_DEBUG (0, "headerlen is %d, datalen is %d",
|
||||||
headerlen,datalen);
|
headerlen,datalen);
|
||||||
|
|
||||||
switch (id) {
|
if (id == 0xBD) {
|
||||||
/* private_stream_1 */
|
/* private_stream_1 */
|
||||||
case 0xBD:
|
|
||||||
/* first find the track code */
|
/* first find the track code */
|
||||||
ps_id_code = *(basebuf + headerlen);
|
ps_id_code = *(basebuf + headerlen);
|
||||||
|
|
||||||
switch (ps_id_code) {
|
if (ps_id_code >= 0x80 && ps_id_code <= 0x87) {
|
||||||
/* make sure it's valid */
|
/* make sure it's valid */
|
||||||
case 0x80 ... 0x87:
|
|
||||||
GST_DEBUG (0, "0x%02X: we have a private_stream_1 (AC3) packet, track %d",
|
GST_DEBUG (0, "0x%02X: we have a private_stream_1 (AC3) packet, track %d",
|
||||||
id, ps_id_code - 0x80);
|
id, ps_id_code - 0x80);
|
||||||
outstream = &mpeg_demux->private_1_stream[ps_id_code - 0x80];
|
outstream = &mpeg_demux->private_1_stream[ps_id_code - 0x80];
|
||||||
/* scrap first 4 bytes (so-called "mystery AC3 tag") */
|
/* scrap first 4 bytes (so-called "mystery AC3 tag") */
|
||||||
headerlen += 4;
|
headerlen += 4;
|
||||||
datalen -= 4;
|
datalen -= 4;
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
break;
|
} else if (id == 0xBF) {
|
||||||
/* private_stream_2 */
|
/* private_stream_2 */
|
||||||
case 0xBF:
|
|
||||||
GST_DEBUG (0, "0x%02X: we have a private_stream_2 packet", id);
|
GST_DEBUG (0, "0x%02X: we have a private_stream_2 packet", id);
|
||||||
outstream = &mpeg_demux->private_2_stream;
|
outstream = &mpeg_demux->private_2_stream;
|
||||||
break;
|
} else if (id >= 0xC0 && id <= 0xDF) {
|
||||||
/* audio */
|
/* audio */
|
||||||
case 0xC0 ... 0xDF:
|
|
||||||
GST_DEBUG (0, "0x%02X: we have an audio packet", id);
|
GST_DEBUG (0, "0x%02X: we have an audio packet", id);
|
||||||
outstream = &mpeg_demux->audio_stream[id & 0x1F];
|
outstream = &mpeg_demux->audio_stream[id & 0x1F];
|
||||||
break;
|
} else if (id >= 0xE0 && id <= 0xEF) {
|
||||||
/* video */
|
/* video */
|
||||||
case 0xE0 ... 0xEF:
|
|
||||||
GST_DEBUG (0, "0x%02X: we have a video packet", id);
|
GST_DEBUG (0, "0x%02X: we have a video packet", id);
|
||||||
outstream = &mpeg_demux->video_stream[id & 0x0F];
|
outstream = &mpeg_demux->video_stream[id & 0x0F];
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if we don't know what it is, bail */
|
/* if we don't know what it is, bail */
|
||||||
|
@ -792,22 +774,19 @@ gst_mpeg_demux_parse_pes (GstMPEGParse *mpeg_parse, GstBuffer *buffer)
|
||||||
GST_DEBUG (0, "headerlen is %d, datalen is %d",
|
GST_DEBUG (0, "headerlen is %d, datalen is %d",
|
||||||
headerlen, datalen);
|
headerlen, datalen);
|
||||||
|
|
||||||
switch (id) {
|
if (id == 0xBD) {
|
||||||
/* private_stream_1 */
|
/* private_stream_1 */
|
||||||
case 0xBD:
|
|
||||||
/* first find the track code */
|
/* first find the track code */
|
||||||
ps_id_code = *(basebuf + headerlen + 4);
|
ps_id_code = *(basebuf + headerlen + 4);
|
||||||
|
|
||||||
switch (ps_id_code) {
|
if (ps_id_code >= 0x80 && ps_id_code <= 0x87) {
|
||||||
case 0x80 ... 0x87:
|
|
||||||
GST_DEBUG (0, "we have a private_stream_1 (AC3) packet, track %d",
|
GST_DEBUG (0, "we have a private_stream_1 (AC3) packet, track %d",
|
||||||
ps_id_code - 0x80);
|
ps_id_code - 0x80);
|
||||||
outstream = &mpeg_demux->private_1_stream[ps_id_code - 0x80];
|
outstream = &mpeg_demux->private_1_stream[ps_id_code - 0x80];
|
||||||
/* scrap first 4 bytes (so-called "mystery AC3 tag") */
|
/* scrap first 4 bytes (so-called "mystery AC3 tag") */
|
||||||
headerlen += 4;
|
headerlen += 4;
|
||||||
datalen -= 4;
|
datalen -= 4;
|
||||||
break;
|
} else if (ps_id_code >= 0xA0 && ps_id_code <= 0xA7) {
|
||||||
case 0xA0 ... 0xA7:
|
|
||||||
GST_DEBUG (0, "we have a pcm_stream packet, track %d",
|
GST_DEBUG (0, "we have a pcm_stream packet, track %d",
|
||||||
ps_id_code - 0xA0);
|
ps_id_code - 0xA0);
|
||||||
outstream = &mpeg_demux->pcm_stream[ps_id_code - 0xA0];
|
outstream = &mpeg_demux->pcm_stream[ps_id_code - 0xA0];
|
||||||
|
@ -827,38 +806,30 @@ gst_mpeg_demux_parse_pes (GstMPEGParse *mpeg_parse, GstBuffer *buffer)
|
||||||
/* Get rid of the LPCM header. */
|
/* Get rid of the LPCM header. */
|
||||||
headerlen += 7;
|
headerlen += 7;
|
||||||
datalen -= 7;
|
datalen -= 7;
|
||||||
break;
|
} else if (ps_id_code >= 0x20 && ps_id_code <= 0x2F) {
|
||||||
case 0x20 ... 0x2f:
|
|
||||||
GST_DEBUG (0, "we have a subtitle_stream packet, track %d",
|
GST_DEBUG (0, "we have a subtitle_stream packet, track %d",
|
||||||
ps_id_code - 0x20);
|
ps_id_code - 0x20);
|
||||||
outstream = &mpeg_demux->subtitle_stream[ps_id_code - 0x20];
|
outstream = &mpeg_demux->subtitle_stream[ps_id_code - 0x20];
|
||||||
headerlen += 1;
|
headerlen += 1;
|
||||||
datalen -= 1;
|
datalen -= 1;
|
||||||
break;
|
} else {
|
||||||
default:
|
|
||||||
GST_DEBUG (0, "0x%02X: unkonwn id %x",
|
GST_DEBUG (0, "0x%02X: unkonwn id %x",
|
||||||
id, ps_id_code);
|
id, ps_id_code);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
break;
|
} else if (id == 0xBF) {
|
||||||
/* private_stream_2 */
|
/* private_stream_2 */
|
||||||
case 0xBF:
|
|
||||||
GST_DEBUG (0, "we have a private_stream_2 packet");
|
GST_DEBUG (0, "we have a private_stream_2 packet");
|
||||||
outstream = &mpeg_demux->private_2_stream;
|
outstream = &mpeg_demux->private_2_stream;
|
||||||
break;
|
} else if (id >= 0xC0 && id <= 0xDF) {
|
||||||
/* audio */
|
/* audio */
|
||||||
case 0xC0 ... 0xDF:
|
|
||||||
GST_DEBUG (0, "we have an audio packet");
|
GST_DEBUG (0, "we have an audio packet");
|
||||||
outstream = &mpeg_demux->audio_stream[id - 0xC0];
|
outstream = &mpeg_demux->audio_stream[id - 0xC0];
|
||||||
break;
|
} else if (id >= 0xE0 && id <= 0xEF) {
|
||||||
/* video */
|
/* video */
|
||||||
case 0xE0 ... 0xEF:
|
|
||||||
GST_DEBUG (0, "we have a video packet");
|
GST_DEBUG (0, "we have a video packet");
|
||||||
outstream = &mpeg_demux->video_stream[id - 0xE0];
|
outstream = &mpeg_demux->video_stream[id - 0xE0];
|
||||||
break;
|
} else {
|
||||||
default:
|
|
||||||
GST_DEBUG (0, "we have a unkown packet");
|
GST_DEBUG (0, "we have a unkown packet");
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if we don't know what it is, bail */
|
/* if we don't know what it is, bail */
|
||||||
|
@ -872,52 +843,41 @@ gst_mpeg_demux_parse_pes (GstMPEGParse *mpeg_parse, GstBuffer *buffer)
|
||||||
gchar *name = NULL;
|
gchar *name = NULL;
|
||||||
|
|
||||||
/* we have to name the stream approriately */
|
/* we have to name the stream approriately */
|
||||||
switch (id) {
|
if (id == 0xBD) {
|
||||||
/* private_stream_1 */
|
/* private_stream_1 */
|
||||||
case 0xBD:
|
if (ps_id_code >= 0x80 && ps_id_code <= 0x87) {
|
||||||
switch (ps_id_code) {
|
|
||||||
case 0x80 ... 0x87:
|
|
||||||
/* Erase any DVD audio pads. */
|
/* Erase any DVD audio pads. */
|
||||||
gst_mpeg_demux_dvd_audio_clear (mpeg_demux, ps_id_code - 0x80);
|
gst_mpeg_demux_dvd_audio_clear (mpeg_demux, ps_id_code - 0x80);
|
||||||
|
|
||||||
name = g_strdup_printf ("private_stream_1_%d",ps_id_code - 0x80);
|
name = g_strdup_printf ("private_stream_1_%d",ps_id_code - 0x80);
|
||||||
newtemp = GST_PAD_TEMPLATE_GET (private1_factory);
|
newtemp = GST_PAD_TEMPLATE_GET (private1_factory);
|
||||||
break;
|
} else if (ps_id_code >= 0xA0 && ps_id_code <= 0xA7) {
|
||||||
case 0xA0 ... 0xA7:
|
|
||||||
/* Erase any DVD audio pads. */
|
/* Erase any DVD audio pads. */
|
||||||
gst_mpeg_demux_dvd_audio_clear (mpeg_demux, ps_id_code - 0xA0);
|
gst_mpeg_demux_dvd_audio_clear (mpeg_demux, ps_id_code - 0xA0);
|
||||||
|
|
||||||
name = g_strdup_printf ("pcm_stream_%d", ps_id_code - 0xA0);
|
name = g_strdup_printf ("pcm_stream_%d", ps_id_code - 0xA0);
|
||||||
newtemp = GST_PAD_TEMPLATE_GET (pcm_factory);
|
newtemp = GST_PAD_TEMPLATE_GET (pcm_factory);
|
||||||
break;
|
} else if (ps_id_code >= 0x20 && ps_id_code <= 0x2F) {
|
||||||
case 0x20 ... 0x2F:
|
|
||||||
name = g_strdup_printf ("subtitle_stream_%d",ps_id_code - 0x20);
|
name = g_strdup_printf ("subtitle_stream_%d",ps_id_code - 0x20);
|
||||||
newtemp = GST_PAD_TEMPLATE_GET (subtitle_factory);
|
newtemp = GST_PAD_TEMPLATE_GET (subtitle_factory);
|
||||||
break;
|
} else {
|
||||||
default:
|
|
||||||
name = g_strdup_printf ("unknown_stream_%d",ps_id_code);
|
name = g_strdup_printf ("unknown_stream_%d",ps_id_code);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
break;
|
} else if (id == 0xBF) {
|
||||||
/* private_stream_2 */
|
/* private_stream_2 */
|
||||||
case 0xBF:
|
|
||||||
name = g_strdup ("private_stream_2");
|
name = g_strdup ("private_stream_2");
|
||||||
newtemp = GST_PAD_TEMPLATE_GET (private2_factory);
|
newtemp = GST_PAD_TEMPLATE_GET (private2_factory);
|
||||||
break;
|
} else if (id >= 0xC0 && id <= 0xDF) {
|
||||||
/* audio */
|
/* audio */
|
||||||
case 0xC0 ... 0xDF:
|
|
||||||
name = g_strdup_printf ("audio_%02d", id - 0xC0);
|
name = g_strdup_printf ("audio_%02d", id - 0xC0);
|
||||||
newtemp = GST_PAD_TEMPLATE_GET (audio_factory);
|
newtemp = GST_PAD_TEMPLATE_GET (audio_factory);
|
||||||
break;
|
} else if (id >= 0xE0 && id <= 0xEF) {
|
||||||
/* video */
|
/* video */
|
||||||
case 0xE0 ... 0xEF:
|
|
||||||
name = g_strdup_printf ("video_%02d", id - 0xE0);
|
name = g_strdup_printf ("video_%02d", id - 0xE0);
|
||||||
newtemp = GST_PAD_TEMPLATE_GET (video_mpeg2_factory);
|
newtemp = GST_PAD_TEMPLATE_GET (video_mpeg2_factory);
|
||||||
break;
|
} else {
|
||||||
/* unkown */
|
/* unkown */
|
||||||
default:
|
|
||||||
name = g_strdup_printf ("unknown");
|
name = g_strdup_printf ("unknown");
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newtemp) {
|
if (newtemp) {
|
||||||
|
|
Loading…
Reference in a new issue