2004-12-19 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
+ * ext/ffmpeg/gstffmpegprotocol.c: (gst_ffmpegdata_open),
+ (gst_ffmpegdata_peek), (gst_ffmpegdata_read),
+ (gst_ffmpegdata_write), (gst_ffmpegdata_seek),
+ (gst_ffmpegdata_close):
+ Add debug. Don't EOS unless all data was read.
+
+2004-12-19 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
+
* ext/ffmpeg/gstffmpegprotocol.c: (gst_ffmpegdata_peek),
(gst_ffmpegdata_read), (gst_ffmpegdata_seek):
Some "seeking" hacks, and separate peek from read (read = peek +
GstProtocolInfo *info;
GstPad *pad;
+ GST_LOG ("Opening %s", filename);
+
info = g_new0 (GstProtocolInfo, 1);
info->flags = flags;
guint32 total, request;
guint8 *data;
GstProtocolInfo *info;
- gboolean have_event;
+ gboolean have_event, will_get_eos;
info = (GstProtocolInfo *) h->priv_data;
return 0;
do {
- have_event = FALSE;
+ have_event = FALSE, will_get_eos = FALSE;
/* prevent EOS */
- if (gst_bytestream_tell (bs) + size > gst_bytestream_length (bs)) {
+ if (gst_bytestream_tell (bs) + size >= gst_bytestream_length (bs)) {
request = (int) (gst_bytestream_length (bs) - gst_bytestream_tell (bs));
- info->eos = TRUE;
+ will_get_eos = TRUE;
} else {
request = size;
}
g_warning ("gstffmpegprotocol: no bytestream event");
return total;
}
+ GST_LOG ("Reading (req %d, got %d) gave event of type %d",
+ request, total, GST_EVENT_TYPE (event));
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_DISCONTINUOUS:
gst_event_unref (event);
gst_pad_event_default (info->pad, event);
break;
}
+ } else {
+ GST_DEBUG ("got data (%d bytes)", request);
+ if (will_get_eos)
+ info->eos = TRUE;
}
} while ((!info->eos && total != request) || have_event);
GstByteStream *bs;
GstProtocolInfo *info;
+ GST_DEBUG ("Reading %d bytes of data", size);
+
info = (GstProtocolInfo *) h->priv_data;
bs = info->bs;
res = gst_ffmpegdata_peek (h, buf, size);
gst_bytestream_flush_fast (bs, res);
}
+ GST_DEBUG ("Returning %d bytes", res);
+
return res;
}
GstProtocolInfo *info;
GstBuffer *outbuf;
+ GST_DEBUG ("Writing %d bytes", size);
+
info = (GstProtocolInfo *) h->priv_data;
g_return_val_if_fail (info->flags == URL_WRONLY, -EIO);
GstProtocolInfo *info;
guint64 newpos;
+ GST_DEBUG ("Seeking to %" G_GINT64_FORMAT ", whence=%d", pos, whence);
+
info = (GstProtocolInfo *) h->priv_data;
/* get data (typefind hack) */
info = (GstProtocolInfo *) h->priv_data;
+ GST_LOG ("Closing file");
+
switch (info->flags) {
case URL_WRONLY:{
/* send EOS - that closes down the stream */