Commit 55eac5b0 authored by Wim Taymans's avatar Wim Taymans

ext/ffmpeg/gstffmpegdemux.c: Rework the demuxer, implement all seeking stuff...

ext/ffmpeg/gstffmpegdemux.c: Rework the demuxer, implement all seeking stuff including seek in ready.

Original commit message from CVS:
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_base_init),
(gst_ffmpegdemux_class_init), (gst_ffmpegdemux_init),
(gst_ffmpegdemux_close), (gst_ffmpegdemux_push_event),
(gst_ffmpegdemux_set_flags), (gst_ffmpegdemux_is_eos),
(gst_ffmpegdemux_do_seek), (gst_ffmpegdemux_perform_seek),
(gst_ffmpegdemux_src_event), (gst_ffmpegdemux_send_event),
(gst_ffmpegdemux_src_query), (gst_ffmpegdemux_src_convert),
(gst_ffmpegdemux_get_stream), (my_safe_copy),
(gst_ffmpegdemux_read_tags), (gst_ffmpegdemux_open),
(gst_ffmpegdemux_loop), (gst_ffmpegdemux_sink_activate),
(gst_ffmpegdemux_sink_activate_pull),
(gst_ffmpegdemux_change_state), (gst_ffmpegdemux_register):
Rework the demuxer, implement all seeking stuff including
seek in ready.
* ext/ffmpeg/gstffmpegprotocol.c: (gst_ffmpegdata_peek),
(gst_ffmpegdata_close):
Handle some more cases.
parent 0c66583e
2006-04-13 Wim Taymans <wim@fluendo.com>
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_base_init),
(gst_ffmpegdemux_class_init), (gst_ffmpegdemux_init),
(gst_ffmpegdemux_close), (gst_ffmpegdemux_push_event),
(gst_ffmpegdemux_set_flags), (gst_ffmpegdemux_is_eos),
(gst_ffmpegdemux_do_seek), (gst_ffmpegdemux_perform_seek),
(gst_ffmpegdemux_src_event), (gst_ffmpegdemux_send_event),
(gst_ffmpegdemux_src_query), (gst_ffmpegdemux_src_convert),
(gst_ffmpegdemux_get_stream), (my_safe_copy),
(gst_ffmpegdemux_read_tags), (gst_ffmpegdemux_open),
(gst_ffmpegdemux_loop), (gst_ffmpegdemux_sink_activate),
(gst_ffmpegdemux_sink_activate_pull),
(gst_ffmpegdemux_change_state), (gst_ffmpegdemux_register):
Rework the demuxer, implement all seeking stuff including
seek in ready.
* ext/ffmpeg/gstffmpegprotocol.c: (gst_ffmpegdata_peek),
(gst_ffmpegdata_close):
Handle some more cases.
2006-04-11 Wim Taymans <wim@fluendo.com>
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_sink_event):
......
This diff is collapsed.
......@@ -103,18 +103,30 @@ gst_ffmpegdata_peek (URLContext * h, unsigned char *buf, int size)
g_return_val_if_fail (h->flags == URL_RDONLY, AVERROR_IO);
info = (GstProtocolInfo *) h->priv_data;
GST_DEBUG ("Pulling %d bytes at position %lld", size, info->offset);
ret = gst_pad_pull_range(info->pad, info->offset, (guint) size, &inbuf);
if ((ret == GST_FLOW_OK) || (ret == GST_FLOW_UNEXPECTED)) {
if (inbuf) {
switch (ret) {
case GST_FLOW_OK:
total = (gint) GST_BUFFER_SIZE (inbuf);
memcpy (buf, GST_BUFFER_DATA (inbuf), total);
gst_buffer_unref (inbuf);
}
} else {
return -1;
break;
case GST_FLOW_UNEXPECTED:
total = 0;
break;
case GST_FLOW_WRONG_STATE:
total = -1;
break;
default:
case GST_FLOW_ERROR:
total = -2;
break;
}
GST_DEBUG ("Got %d (%s) return result %d", ret, gst_flow_get_name (ret), total);
return total;
}
......@@ -227,21 +239,25 @@ gst_ffmpegdata_close (URLContext * h)
GstProtocolInfo *info;
info = (GstProtocolInfo *) h->priv_data;
if (info == NULL)
return 0;
GST_LOG ("Closing file");
switch (h->flags) {
case URL_WRONLY:{
/* send EOS - that closes down the stream */
gst_pad_push_event (info->pad, gst_event_new_eos());
}
break;
default:
break;
case URL_WRONLY:
{
/* send EOS - that closes down the stream */
gst_pad_push_event (info->pad, gst_event_new_eos());
break;
}
default:
break;
}
/* clean up data */
g_free (info);
h->priv_data = NULL;
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment