mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
ext/ffmpeg/gstffmpegdemux.c: Signal no_more_pads.
Original commit message from CVS: * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_loop): Signal no_more_pads. * ext/ffmpeg/gstffmpegprotocol.c: (gst_ffmpegdata_read), (gst_ffmpegdata_seek): Handle events.
This commit is contained in:
parent
79d1288887
commit
530ec15806
3 changed files with 25 additions and 3 deletions
|
@ -1,3 +1,11 @@
|
|||
2004-10-02 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||
|
||||
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_loop):
|
||||
Signal no_more_pads.
|
||||
* ext/ffmpeg/gstffmpegprotocol.c: (gst_ffmpegdata_read),
|
||||
(gst_ffmpegdata_seek):
|
||||
Handle events.
|
||||
|
||||
2004-10-02 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||
|
||||
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_pixfmt_to_caps),
|
||||
|
|
|
@ -570,6 +570,7 @@ gst_ffmpegdemux_loop (GstElement * element)
|
|||
if (!demux->opened) {
|
||||
if (!gst_ffmpegdemux_open (demux))
|
||||
return;
|
||||
gst_element_no_more_pads (element);
|
||||
}
|
||||
|
||||
/* read a package */
|
||||
|
@ -622,9 +623,10 @@ gst_ffmpegdemux_loop (GstElement * element)
|
|||
memcpy (GST_BUFFER_DATA (outbuf), pkt.data, pkt.size);
|
||||
GST_BUFFER_SIZE (outbuf) = pkt.size;
|
||||
|
||||
if (pkt.pts != AV_NOPTS_VALUE && demux->context->pts_den)
|
||||
if (pkt.pts != AV_NOPTS_VALUE && demux->context->pts_den) {
|
||||
GST_BUFFER_TIMESTAMP (outbuf) = (double) pkt.pts * GST_SECOND *
|
||||
demux->context->pts_num / demux->context->pts_den;
|
||||
}
|
||||
|
||||
if (pkt.flags & PKT_FLAG_KEY) {
|
||||
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_KEY_UNIT);
|
||||
|
|
|
@ -145,6 +145,13 @@ gst_ffmpegdata_read (URLContext * h, unsigned char *buf, int size)
|
|||
have_event = FALSE;
|
||||
gst_event_unref (event);
|
||||
break;
|
||||
case GST_EVENT_FLUSH:
|
||||
gst_event_unref (event);
|
||||
break;
|
||||
case GST_EVENT_INTERRUPT:
|
||||
have_event = FALSE;
|
||||
gst_event_unref (event);
|
||||
break;
|
||||
default:
|
||||
gst_pad_event_default (info->pad, event);
|
||||
break;
|
||||
|
@ -219,6 +226,7 @@ gst_ffmpegdata_seek (URLContext * h, offset_t pos, int whence)
|
|||
|
||||
/* handle discont */
|
||||
gst_bytestream_seek (info->bs, pos, seek_type);
|
||||
|
||||
/* prevent eos */
|
||||
if (gst_bytestream_tell (info->bs) ==
|
||||
gst_bytestream_length (info->bs)) {
|
||||
|
@ -239,11 +247,15 @@ gst_ffmpegdata_seek (URLContext * h, offset_t pos, int whence)
|
|||
g_warning ("unexpected/unwanted EOS event after seek");
|
||||
info->eos = TRUE;
|
||||
gst_event_unref (event);
|
||||
break;
|
||||
return -1;
|
||||
case GST_EVENT_DISCONTINUOUS:
|
||||
gst_bytestream_flush_fast (info->bs, remaining);
|
||||
gst_event_unref (event); /* we expect this */
|
||||
break;
|
||||
case GST_EVENT_FLUSH:
|
||||
break;
|
||||
case GST_EVENT_INTERRUPT:
|
||||
gst_event_unref (event);
|
||||
return -1;
|
||||
default:
|
||||
gst_pad_event_default (info->pad, event);
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue