demuxers: Add more debugging

This commit is contained in:
Edward Hervey 2009-03-09 13:45:22 +01:00
parent b75a3f325a
commit 3f34bf8ef4
3 changed files with 11 additions and 0 deletions

View file

@ -1581,9 +1581,12 @@ gst_ffmpegdemux_chain (GstPad * sinkpad, GstBuffer * buffer)
if (G_UNLIKELY (ffpipe->srcresult != GST_FLOW_OK))
goto ignore;
GST_DEBUG ("Giving a buffer of %d bytes", GST_BUFFER_SIZE (buffer));
gst_adapter_push (ffpipe->adapter, buffer);
buffer = NULL;
while (gst_adapter_available (ffpipe->adapter) >= ffpipe->needed) {
GST_DEBUG ("Adapter has more that requested (ffpipe->needed:%d)",
ffpipe->needed);
GST_FFMPEG_PIPE_SIGNAL (ffpipe);
GST_FFMPEG_PIPE_WAIT (ffpipe);
/* may have become flushing */

View file

@ -22,6 +22,7 @@
#define __GST_FFMPEGPIPE_H__
#include <gst/base/gstadapter.h>
#include "gstffmpeg.h"
G_BEGIN_DECLS

View file

@ -337,8 +337,12 @@ gst_ffmpeg_pipe_read (URLContext * h, unsigned char *buf, int size)
GST_LOG ("requested size %d", size);
GST_FFMPEG_PIPE_MUTEX_LOCK (ffpipe);
GST_LOG ("requested size %d", size);
while ((available = gst_adapter_available (ffpipe->adapter)) < size
&& !ffpipe->eos) {
GST_DEBUG ("Available:%d, requested:%d", available, size);
ffpipe->needed = size;
GST_FFMPEG_PIPE_SIGNAL (ffpipe);
GST_FFMPEG_PIPE_WAIT (ffpipe);
@ -346,9 +350,12 @@ gst_ffmpeg_pipe_read (URLContext * h, unsigned char *buf, int size)
size = MIN (available, size);
if (size) {
GST_LOG ("Getting %d bytes", size);
data = gst_adapter_peek (ffpipe->adapter, size);
memcpy (buf, data, size);
gst_adapter_flush (ffpipe->adapter, size);
GST_LOG ("%d bytes left in adapter",
gst_adapter_available (ffpipe->adapter));
ffpipe->needed = 0;
}
GST_FFMPEG_PIPE_MUTEX_UNLOCK (ffpipe);