mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 13:41:48 +00:00
gst/mpegstream/: get rid of non-standard "..." ranges in case statements.
Original commit message from CVS: * gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_private): * gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_parse_syshead), (gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes): get rid of non-standard "..." ranges in case statements.
This commit is contained in:
parent
40b740126e
commit
a6b45475b2
3 changed files with 113 additions and 148 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2004-03-28 Benjamin Otte <otte@gnome.org>
|
||||||
|
|
||||||
|
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_private):
|
||||||
|
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_parse_syshead),
|
||||||
|
(gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes):
|
||||||
|
get rid of non-standard "..." ranges in case statements.
|
||||||
|
|
||||||
2004-03-27 Martin Soto <martinsoto@users.sourceforge.net>
|
2004-03-27 Martin Soto <martinsoto@users.sourceforge.net>
|
||||||
|
|
||||||
* gst/mpegstream/gstmpegdemux.c:
|
* gst/mpegstream/gstmpegdemux.c:
|
||||||
|
|
|
@ -636,8 +636,7 @@ gst_dvd_demux_process_private (GstMPEGDemux * mpeg_demux,
|
||||||
case 0:
|
case 0:
|
||||||
/* Private stream 1. */
|
/* Private stream 1. */
|
||||||
|
|
||||||
switch (ps_id_code) {
|
if (ps_id_code >= 0x80 && ps_id_code <= 0x87) {
|
||||||
case 0x80...0x87:
|
|
||||||
GST_LOG_OBJECT (dvd_demux,
|
GST_LOG_OBJECT (dvd_demux,
|
||||||
"we have an audio (AC3) packet, track %d", ps_id_code - 0x80);
|
"we have an audio (AC3) packet, track %d", ps_id_code - 0x80);
|
||||||
outstream = DEMUX_CLASS (dvd_demux)->get_audio_stream (mpeg_demux,
|
outstream = DEMUX_CLASS (dvd_demux)->get_audio_stream (mpeg_demux,
|
||||||
|
@ -650,9 +649,7 @@ gst_dvd_demux_process_private (GstMPEGDemux * mpeg_demux,
|
||||||
|
|
||||||
headerlen += 4;
|
headerlen += 4;
|
||||||
datalen -= 4;
|
datalen -= 4;
|
||||||
break;
|
} else if (ps_id_code >= 0xA0 && ps_id_code <= 0xA7) {
|
||||||
|
|
||||||
case 0xA0...0xA7:
|
|
||||||
GST_LOG_OBJECT (dvd_demux,
|
GST_LOG_OBJECT (dvd_demux,
|
||||||
"we have an audio (LPCM) packet, track %d", ps_id_code - 0xA0);
|
"we have an audio (LPCM) packet, track %d", ps_id_code - 0xA0);
|
||||||
lpcm_sample_info = basebuf[headerlen + 9];
|
lpcm_sample_info = basebuf[headerlen + 9];
|
||||||
|
@ -666,9 +663,7 @@ gst_dvd_demux_process_private (GstMPEGDemux * mpeg_demux,
|
||||||
/* 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 <= 0x3F) {
|
||||||
|
|
||||||
case 0x20...0x3f:
|
|
||||||
GST_LOG_OBJECT (dvd_demux,
|
GST_LOG_OBJECT (dvd_demux,
|
||||||
"we have a subpicture packet, track %d", ps_id_code - 0x20);
|
"we have a subpicture packet, track %d", ps_id_code - 0x20);
|
||||||
outstream = CLASS (dvd_demux)->get_subpicture_stream (mpeg_demux,
|
outstream = CLASS (dvd_demux)->get_subpicture_stream (mpeg_demux,
|
||||||
|
@ -676,12 +671,9 @@ gst_dvd_demux_process_private (GstMPEGDemux * mpeg_demux,
|
||||||
|
|
||||||
headerlen += 1;
|
headerlen += 1;
|
||||||
datalen -= 1;
|
datalen -= 1;
|
||||||
break;
|
} else {
|
||||||
|
|
||||||
default:
|
|
||||||
GST_ERROR_OBJECT (dvd_demux,
|
GST_ERROR_OBJECT (dvd_demux,
|
||||||
"unknown DVD (private 1) id 0x%02x", ps_id_code);
|
"unknown DVD (private 1) id 0x%02x", ps_id_code);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -551,38 +551,26 @@ 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) {
|
||||||
case 0xBD:
|
|
||||||
/* Private stream 1. */
|
/* Private stream 1. */
|
||||||
outstream = CLASS (mpeg_demux)->get_private_stream (mpeg_demux,
|
outstream = CLASS (mpeg_demux)->get_private_stream (mpeg_demux,
|
||||||
0, GST_MPEG_DEMUX_PRIVATE_UNKNOWN, NULL);
|
0, GST_MPEG_DEMUX_PRIVATE_UNKNOWN, NULL);
|
||||||
break;
|
} else if (stream_id == 0xBF) {
|
||||||
|
|
||||||
case 0xBF:
|
|
||||||
/* Private stream 2. */
|
/* Private stream 2. */
|
||||||
outstream = CLASS (mpeg_demux)->get_private_stream (mpeg_demux,
|
outstream = CLASS (mpeg_demux)->get_private_stream (mpeg_demux,
|
||||||
1, GST_MPEG_DEMUX_PRIVATE_UNKNOWN, NULL);
|
1, GST_MPEG_DEMUX_PRIVATE_UNKNOWN, NULL);
|
||||||
break;
|
} else if (stream_id >= 0xC0 && stream_id <= 0xDF) {
|
||||||
|
|
||||||
case 0xC0...0xDF:
|
|
||||||
/* Audio. */
|
/* Audio. */
|
||||||
outstream = CLASS (mpeg_demux)->get_audio_stream (mpeg_demux,
|
outstream = CLASS (mpeg_demux)->get_audio_stream (mpeg_demux,
|
||||||
stream_id - 0xC0, GST_MPEG_DEMUX_AUDIO_MPEG, NULL);
|
stream_id - 0xC0, GST_MPEG_DEMUX_AUDIO_MPEG, NULL);
|
||||||
break;
|
} else if (stream_id >= 0xE0 && stream_id <= 0xEF) {
|
||||||
|
|
||||||
case 0xE0...0xEF:
|
|
||||||
/* Video. */
|
/* Video. */
|
||||||
{
|
|
||||||
gint mpeg_version = !GST_MPEG_PARSE_IS_MPEG2 (mpeg_demux) ? 1 : 2;
|
gint mpeg_version = !GST_MPEG_PARSE_IS_MPEG2 (mpeg_demux) ? 1 : 2;
|
||||||
|
|
||||||
outstream = CLASS (mpeg_demux)->get_video_stream (mpeg_demux,
|
outstream = CLASS (mpeg_demux)->get_video_stream (mpeg_demux,
|
||||||
stream_id - 0xE0, GST_MPEG_DEMUX_VIDEO_MPEG, &mpeg_version);
|
stream_id - 0xE0, GST_MPEG_DEMUX_VIDEO_MPEG, &mpeg_version);
|
||||||
}
|
} else {
|
||||||
break;
|
GST_WARNING_OBJECT (mpeg_demux, "unkown stream id 0x%02x", stream_id);
|
||||||
|
|
||||||
default:
|
|
||||||
GST_WARNING ("unkown stream id 0x%02x", stream_id);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (mpeg_demux, "STD_buffer_bound_scale %d",
|
GST_DEBUG_OBJECT (mpeg_demux, "STD_buffer_bound_scale %d",
|
||||||
|
@ -736,46 +724,35 @@ done:
|
||||||
timestamp = GST_CLOCK_TIME_NONE;
|
timestamp = GST_CLOCK_TIME_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (id) {
|
if (id == 0xBD) {
|
||||||
case 0xBD:
|
|
||||||
/* Private stream 1. */
|
/* Private stream 1. */
|
||||||
GST_DEBUG_OBJECT (mpeg_demux, "we have a private 1 packet");
|
GST_DEBUG_OBJECT (mpeg_demux, "we have a private 1 packet");
|
||||||
CLASS (mpeg_demux)->process_private (mpeg_demux, buffer, 0, timestamp,
|
CLASS (mpeg_demux)->process_private (mpeg_demux, buffer, 0, timestamp,
|
||||||
headerlen, datalen);
|
headerlen, datalen);
|
||||||
break;
|
} else if (id == 0xBF) {
|
||||||
|
|
||||||
case 0xBF:
|
|
||||||
/* Private stream 2. */
|
/* Private stream 2. */
|
||||||
GST_DEBUG_OBJECT (mpeg_demux, "we have a private 2 packet");
|
GST_DEBUG_OBJECT (mpeg_demux, "we have a private 2 packet");
|
||||||
CLASS (mpeg_demux)->process_private (mpeg_demux, buffer, 1, timestamp,
|
CLASS (mpeg_demux)->process_private (mpeg_demux, buffer, 1, timestamp,
|
||||||
headerlen, datalen);
|
headerlen, datalen);
|
||||||
break;
|
} else if (id >= 0xC0 && id <= 0xDF) {
|
||||||
|
|
||||||
case 0xC0...0xDF:
|
|
||||||
/* Audio. */
|
/* Audio. */
|
||||||
GST_DEBUG_OBJECT (mpeg_demux, "we have an audio packet");
|
GST_DEBUG_OBJECT (mpeg_demux, "we have an audio packet");
|
||||||
outstream = CLASS (mpeg_demux)->get_audio_stream (mpeg_demux,
|
outstream = CLASS (mpeg_demux)->get_audio_stream (mpeg_demux,
|
||||||
id - 0xC0, GST_MPEG_DEMUX_AUDIO_MPEG, NULL);
|
id - 0xC0, GST_MPEG_DEMUX_AUDIO_MPEG, NULL);
|
||||||
CLASS (mpeg_demux)->send_subbuffer (mpeg_demux, outstream, buffer,
|
CLASS (mpeg_demux)->send_subbuffer (mpeg_demux, outstream, buffer,
|
||||||
timestamp, headerlen + 4, datalen);
|
timestamp, headerlen + 4, datalen);
|
||||||
break;
|
} else if (id >= 0xE0 && id <= 0xEF) {
|
||||||
|
|
||||||
case 0xE0...0xEF:
|
|
||||||
/* Video. */
|
/* Video. */
|
||||||
GST_DEBUG_OBJECT (mpeg_demux, "we have a video packet");
|
|
||||||
{
|
|
||||||
gint mpeg_version = !GST_MPEG_PARSE_IS_MPEG2 (mpeg_demux) ? 1 : 2;
|
gint mpeg_version = !GST_MPEG_PARSE_IS_MPEG2 (mpeg_demux) ? 1 : 2;
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT (mpeg_demux, "we have a video packet");
|
||||||
|
|
||||||
outstream = CLASS (mpeg_demux)->get_video_stream (mpeg_demux,
|
outstream = CLASS (mpeg_demux)->get_video_stream (mpeg_demux,
|
||||||
id - 0xE0, GST_MPEG_DEMUX_VIDEO_MPEG, &mpeg_version);
|
id - 0xE0, GST_MPEG_DEMUX_VIDEO_MPEG, &mpeg_version);
|
||||||
}
|
|
||||||
CLASS (mpeg_demux)->send_subbuffer (mpeg_demux, outstream, buffer,
|
CLASS (mpeg_demux)->send_subbuffer (mpeg_demux, outstream, buffer,
|
||||||
timestamp, headerlen + 4, datalen);
|
timestamp, headerlen + 4, datalen);
|
||||||
break;
|
} else {
|
||||||
|
GST_WARNING_OBJECT (mpeg_demux, "unkown stream id 0x%02x", id);
|
||||||
default:
|
|
||||||
GST_WARNING ("unkown stream id 0x%02x", id);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -876,46 +853,35 @@ gst_mpeg_demux_parse_pes (GstMPEGParse * mpeg_parse, GstBuffer * buffer)
|
||||||
GST_DEBUG_OBJECT (mpeg_demux, "headerlen is %d, datalen is %d",
|
GST_DEBUG_OBJECT (mpeg_demux, "headerlen is %d, datalen is %d",
|
||||||
headerlen, datalen);
|
headerlen, datalen);
|
||||||
|
|
||||||
switch (id) {
|
if (id == 0xBD) {
|
||||||
case 0xBD:
|
|
||||||
/* Private stream 1. */
|
/* Private stream 1. */
|
||||||
GST_DEBUG_OBJECT (mpeg_demux, "we have a private 1 packet");
|
GST_DEBUG_OBJECT (mpeg_demux, "we have a private 1 packet");
|
||||||
CLASS (mpeg_demux)->process_private (mpeg_demux, buffer, 0, timestamp,
|
CLASS (mpeg_demux)->process_private (mpeg_demux, buffer, 0, timestamp,
|
||||||
headerlen, datalen);
|
headerlen, datalen);
|
||||||
break;
|
} else if (id == 0xBF) {
|
||||||
|
|
||||||
case 0xBF:
|
|
||||||
/* Private stream 2. */
|
/* Private stream 2. */
|
||||||
GST_DEBUG_OBJECT (mpeg_demux, "we have a private 2 packet");
|
GST_DEBUG_OBJECT (mpeg_demux, "we have a private 2 packet");
|
||||||
CLASS (mpeg_demux)->process_private (mpeg_demux, buffer, 1, timestamp,
|
CLASS (mpeg_demux)->process_private (mpeg_demux, buffer, 1, timestamp,
|
||||||
headerlen, datalen);
|
headerlen, datalen);
|
||||||
break;
|
} else if (id >= 0xC0 && id <= 0xDF) {
|
||||||
|
|
||||||
case 0xC0...0xDF:
|
|
||||||
/* Audio. */
|
/* Audio. */
|
||||||
GST_DEBUG_OBJECT (mpeg_demux, "we have an audio packet");
|
GST_DEBUG_OBJECT (mpeg_demux, "we have an audio packet");
|
||||||
outstream = CLASS (mpeg_demux)->get_audio_stream (mpeg_demux,
|
outstream = CLASS (mpeg_demux)->get_audio_stream (mpeg_demux,
|
||||||
id - 0xC0, GST_MPEG_DEMUX_AUDIO_MPEG, NULL);
|
id - 0xC0, GST_MPEG_DEMUX_AUDIO_MPEG, NULL);
|
||||||
CLASS (mpeg_demux)->send_subbuffer (mpeg_demux, outstream, buffer,
|
CLASS (mpeg_demux)->send_subbuffer (mpeg_demux, outstream, buffer,
|
||||||
timestamp, headerlen + 4, datalen);
|
timestamp, headerlen + 4, datalen);
|
||||||
break;
|
} else if (id >= 0xE0 && id <= 0xEF) {
|
||||||
|
|
||||||
case 0xE0...0xEF:
|
|
||||||
/* Video. */
|
/* Video. */
|
||||||
GST_DEBUG_OBJECT (mpeg_demux, "we have a video packet");
|
|
||||||
{
|
|
||||||
gint mpeg_version = !GST_MPEG_PARSE_IS_MPEG2 (mpeg_demux) ? 1 : 2;
|
gint mpeg_version = !GST_MPEG_PARSE_IS_MPEG2 (mpeg_demux) ? 1 : 2;
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT (mpeg_demux, "we have a video packet");
|
||||||
|
|
||||||
outstream = CLASS (mpeg_demux)->get_video_stream (mpeg_demux,
|
outstream = CLASS (mpeg_demux)->get_video_stream (mpeg_demux,
|
||||||
id - 0xE0, GST_MPEG_DEMUX_VIDEO_MPEG, &mpeg_version);
|
id - 0xE0, GST_MPEG_DEMUX_VIDEO_MPEG, &mpeg_version);
|
||||||
}
|
|
||||||
CLASS (mpeg_demux)->send_subbuffer (mpeg_demux, outstream, buffer,
|
CLASS (mpeg_demux)->send_subbuffer (mpeg_demux, outstream, buffer,
|
||||||
timestamp, headerlen + 4, datalen);
|
timestamp, headerlen + 4, datalen);
|
||||||
break;
|
} else {
|
||||||
|
GST_WARNING_OBJECT (mpeg_demux, "unkown stream id 0x%02x", id);
|
||||||
default:
|
|
||||||
GST_WARNING ("unkown stream id 0x%02x", id);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Reference in a new issue