mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
gst/realmedia/rmdemux.c: Don't hang on length=0 chunks. Some negotiation fixes. Signal no-more-pads.
Original commit message from CVS: * gst/realmedia/rmdemux.c: (gst_rmdemux_handle_sink_event), (gst_rmdemux_loop), (gst_rmdemux_add_stream), (gst_rmdemux_parse_mdpr), (gst_rmdemux_dump_mdpr): Don't hang on length=0 chunks. Some negotiation fixes. Signal no-more-pads.
This commit is contained in:
parent
14edee3251
commit
c6a3c7730a
2 changed files with 25 additions and 9 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2004-10-04 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
|
||||||
|
* gst/realmedia/rmdemux.c: (gst_rmdemux_handle_sink_event),
|
||||||
|
(gst_rmdemux_loop), (gst_rmdemux_add_stream),
|
||||||
|
(gst_rmdemux_parse_mdpr), (gst_rmdemux_dump_mdpr):
|
||||||
|
Don't hang on length=0 chunks. Some negotiation fixes. Signal
|
||||||
|
no-more-pads.
|
||||||
|
|
||||||
2004-10-04 Thomas Vander Stichele <thomas at apestaart dot org>
|
2004-10-04 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
* configure.ac:
|
* configure.ac:
|
||||||
|
|
|
@ -37,6 +37,7 @@ struct _GstRMDemuxStream
|
||||||
{
|
{
|
||||||
guint32 subtype;
|
guint32 subtype;
|
||||||
guint32 fourcc;
|
guint32 fourcc;
|
||||||
|
guint32 subid;
|
||||||
int id;
|
int id;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
GstPad *pad;
|
GstPad *pad;
|
||||||
|
@ -253,9 +254,7 @@ GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case GST_EVENT_EOS:
|
case GST_EVENT_EOS:
|
||||||
gst_bytestream_flush (rmdemux->bs, remaining);
|
gst_pad_event_default (rmdemux->sinkpad, event);
|
||||||
gst_event_unref (event);
|
|
||||||
//gst_pad_event_default(rmdemux->sinkpad, event);
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
case GST_EVENT_INTERRUPT:
|
case GST_EVENT_INTERRUPT:
|
||||||
gst_event_unref (event);
|
gst_event_unref (event);
|
||||||
|
@ -394,7 +393,7 @@ gst_rmdemux_loop (GstElement * element)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
rmdemux->offset += length;
|
rmdemux->offset += length ? length : 8;
|
||||||
if (rmdemux->offset < rmdemux->length) {
|
if (rmdemux->offset < rmdemux->length) {
|
||||||
ret = gst_bytestream_seek (rmdemux->bs, rmdemux->offset,
|
ret = gst_bytestream_seek (rmdemux->bs, rmdemux->offset,
|
||||||
GST_SEEK_METHOD_SET);
|
GST_SEEK_METHOD_SET);
|
||||||
|
@ -403,8 +402,10 @@ gst_rmdemux_loop (GstElement * element)
|
||||||
rmdemux->state = RMDEMUX_STATE_PLAYING;
|
rmdemux->state = RMDEMUX_STATE_PLAYING;
|
||||||
ret = gst_bytestream_seek (rmdemux->bs, rmdemux->offset,
|
ret = gst_bytestream_seek (rmdemux->bs, rmdemux->offset,
|
||||||
GST_SEEK_METHOD_SET);
|
GST_SEEK_METHOD_SET);
|
||||||
}
|
|
||||||
|
|
||||||
|
GST_DEBUG ("no more pads to come");
|
||||||
|
gst_element_no_more_pads (element);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case RMDEMUX_STATE_SEEKING_EOS:
|
case RMDEMUX_STATE_SEEKING_EOS:
|
||||||
|
@ -423,7 +424,6 @@ gst_rmdemux_loop (GstElement * element)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_pad_event_default (rmdemux->sinkpad, gst_event_new (GST_EVENT_EOS));
|
|
||||||
rmdemux->state = RMDEMUX_STATE_EOS;
|
rmdemux->state = RMDEMUX_STATE_EOS;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -459,8 +459,10 @@ gst_rmdemux_loop (GstElement * element)
|
||||||
gst_bytestream_read (rmdemux->bs, &buffer, length - 12);
|
gst_bytestream_read (rmdemux->bs, &buffer, length - 12);
|
||||||
stream = gst_rmdemux_get_stream_by_id (rmdemux, id);
|
stream = gst_rmdemux_get_stream_by_id (rmdemux, id);
|
||||||
|
|
||||||
if (stream->pad) {
|
if (stream && stream->pad && GST_PAD_IS_USABLE (stream->pad)) {
|
||||||
gst_pad_push (stream->pad, GST_DATA (buffer));
|
gst_pad_push (stream->pad, GST_DATA (buffer));
|
||||||
|
} else {
|
||||||
|
gst_buffer_unref (buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
rmdemux->chunk_index++;
|
rmdemux->chunk_index++;
|
||||||
|
@ -530,7 +532,7 @@ gst_rmdemux_add_stream (GstRMDemux * rmdemux, GstRMDemuxStream * stream)
|
||||||
if (version) {
|
if (version) {
|
||||||
stream->caps =
|
stream->caps =
|
||||||
gst_caps_new_simple ("video/x-pn-realvideo", "rmversion", G_TYPE_INT,
|
gst_caps_new_simple ("video/x-pn-realvideo", "rmversion", G_TYPE_INT,
|
||||||
(int) version, NULL);
|
(int) version, "rmsubid", GST_TYPE_FOURCC, stream->subid, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stream->caps) {
|
if (stream->caps) {
|
||||||
|
@ -548,6 +550,8 @@ gst_rmdemux_add_stream (GstRMDemux * rmdemux, GstRMDemuxStream * stream)
|
||||||
/* Older RealAudio Codecs */
|
/* Older RealAudio Codecs */
|
||||||
case GST_RM_AUD_14_4:
|
case GST_RM_AUD_14_4:
|
||||||
version = 1;
|
version = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
case GST_RM_AUD_28_8:
|
case GST_RM_AUD_28_8:
|
||||||
version = 2;
|
version = 2;
|
||||||
break;
|
break;
|
||||||
|
@ -578,7 +582,9 @@ gst_rmdemux_add_stream (GstRMDemux * rmdemux, GstRMDemuxStream * stream)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
GST_WARNING ("Unknown audio FOURCC code");
|
GST_WARNING ("Unknown audio FOURCC code " GST_FOURCC_FORMAT,
|
||||||
|
stream->fourcc);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (version) {
|
if (version) {
|
||||||
|
@ -782,6 +788,7 @@ gst_rmdemux_parse_mdpr (GstRMDemux * rmdemux, void *data, int length)
|
||||||
stream->width = RMDEMUX_GUINT16_GET (data + offset + 12);
|
stream->width = RMDEMUX_GUINT16_GET (data + offset + 12);
|
||||||
stream->height = RMDEMUX_GUINT16_GET (data + offset + 14);
|
stream->height = RMDEMUX_GUINT16_GET (data + offset + 14);
|
||||||
stream->rate = RMDEMUX_GUINT16_GET (data + offset + 16);
|
stream->rate = RMDEMUX_GUINT16_GET (data + offset + 16);
|
||||||
|
stream->subid = RMDEMUX_GUINT32_GET (data + offset + 30);
|
||||||
break;
|
break;
|
||||||
case GST_RMDEMUX_STREAM_AUDIO:{
|
case GST_RMDEMUX_STREAM_AUDIO:{
|
||||||
int audio_fourcc_offset;
|
int audio_fourcc_offset;
|
||||||
|
@ -884,6 +891,7 @@ gst_rmdemux_dump_mdpr (GstRMDemux * rmdemux, void *data, int length)
|
||||||
GST_LOG ("width: %d", RMDEMUX_GUINT16_GET (data + offset + 12));
|
GST_LOG ("width: %d", RMDEMUX_GUINT16_GET (data + offset + 12));
|
||||||
GST_LOG ("height: %d", RMDEMUX_GUINT16_GET (data + offset + 14));
|
GST_LOG ("height: %d", RMDEMUX_GUINT16_GET (data + offset + 14));
|
||||||
GST_LOG ("rate: %d", RMDEMUX_GUINT16_GET (data + offset + 16));
|
GST_LOG ("rate: %d", RMDEMUX_GUINT16_GET (data + offset + 16));
|
||||||
|
GST_LOG ("subid: 0x%08x", RMDEMUX_GUINT32_GET (data + offset + 30));
|
||||||
offset += 18;
|
offset += 18;
|
||||||
} else if (strstr (stream_type, "Audio Stream")) {
|
} else if (strstr (stream_type, "Audio Stream")) {
|
||||||
GST_LOG ("unknown: 0x%08x", RMDEMUX_GUINT32_GET (data + offset + 0));
|
GST_LOG ("unknown: 0x%08x", RMDEMUX_GUINT32_GET (data + offset + 0));
|
||||||
|
|
Loading…
Reference in a new issue