mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
- better detection of audio/video stream for files not produced by real official codec
Original commit message from CVS: - better detection of audio/video stream for files not produced by real official codec - enable parsing of CONT sections (a text field, sort of title for the file) - modify ac3 audio output a bit
This commit is contained in:
parent
48de359944
commit
58fb0b6288
1 changed files with 17 additions and 7 deletions
|
@ -558,7 +558,9 @@ gst_rmdemux_add_stream (GstRMDemux * rmdemux, GstRMDemuxStream * stream)
|
||||||
|
|
||||||
/* DolbyNet (Dolby AC3, low bitrate) */
|
/* DolbyNet (Dolby AC3, low bitrate) */
|
||||||
case GST_RM_AUD_DNET:
|
case GST_RM_AUD_DNET:
|
||||||
stream->caps = gst_caps_new_simple ("audio/x-ac3", NULL);
|
stream->caps =
|
||||||
|
gst_caps_new_simple ("audio/x-ac3", "rate", G_TYPE_INT,
|
||||||
|
(int) stream->rate, NULL);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* MPEG-4 based */
|
/* MPEG-4 based */
|
||||||
|
@ -759,11 +761,18 @@ gst_rmdemux_parse_mdpr (GstRMDemux * rmdemux, void *data, int length)
|
||||||
offset += re_skip_pascal_string (data + offset);
|
offset += re_skip_pascal_string (data + offset);
|
||||||
stream2_type_string = re_get_pascal_string (data + offset);
|
stream2_type_string = re_get_pascal_string (data + offset);
|
||||||
offset += re_skip_pascal_string (data + offset);
|
offset += re_skip_pascal_string (data + offset);
|
||||||
/* It could either be "Video Stream" or "The Video Stream",
|
|
||||||
same thing for Audio */
|
/* stream1_type_string for audio and video stream is a "put_whatever_you_want" field :
|
||||||
if (strstr (stream1_type_string, "Video Stream")) {
|
observed values :
|
||||||
|
- "[The ]Video/Audio Stream" (File produced by an official Real encoder)
|
||||||
|
- "RealVideoPremierePlugIn-VIDEO/AUDIO" (File produced by Abobe Premiere)
|
||||||
|
|
||||||
|
so, we should not rely on it to know which stream type it is
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (strcmp (stream2_type_string, "video/x-pn-realvideo") == 0) {
|
||||||
stream_type = GST_RMDEMUX_STREAM_VIDEO;
|
stream_type = GST_RMDEMUX_STREAM_VIDEO;
|
||||||
} else if (strstr (stream1_type_string, "Audio Stream")) {
|
} else if (strcmp (stream2_type_string, "audio/x-pn-realaudio") == 0) {
|
||||||
stream_type = GST_RMDEMUX_STREAM_AUDIO;
|
stream_type = GST_RMDEMUX_STREAM_AUDIO;
|
||||||
} else if (strcmp (stream1_type_string, "") == 0 &&
|
} else if (strcmp (stream1_type_string, "") == 0 &&
|
||||||
strcmp (stream2_type_string, "logical-fileinfo") == 0) {
|
strcmp (stream2_type_string, "logical-fileinfo") == 0) {
|
||||||
|
@ -1033,9 +1042,10 @@ gst_rmdemux_dump_data (GstRMDemux * rmdemux, void *data, int length)
|
||||||
static void
|
static void
|
||||||
gst_rmdemux_parse_cont (GstRMDemux * rmdemux, void *data, int length)
|
gst_rmdemux_parse_cont (GstRMDemux * rmdemux, void *data, int length)
|
||||||
{
|
{
|
||||||
// int offset = 0;
|
int offset = 0;
|
||||||
|
|
||||||
// offset += re_dump_pascal_string ( data + offset + 3 );
|
GST_DEBUG ("File Content : (CONT)");
|
||||||
|
offset += re_dump_pascal_string (data + offset + 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue