summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2010-11-03 19:04:55 +0100
committerWim Taymans <wim.taymans@collabora.co.uk>2011-02-17 11:43:14 +0100
commit118b9075fa5ee0bb61a376ad603fee778df81574 (patch)
tree20c9936eae8873e3520407c1a0064a915c5e441c
parent57c438b33b089e70f75af703b1eec6593f7b41c5 (diff)
bufferpool: use new poll methodsbufferpool-scratch
-rw-r--r--gst/gstbufferpool.c25
-rw-r--r--gst/gstbufferpool.h2
2 files changed, 9 insertions, 18 deletions
diff --git a/gst/gstbufferpool.c b/gst/gstbufferpool.c
index 35a7e929c..c52284bcd 100644
--- a/gst/gstbufferpool.c
+++ b/gst/gstbufferpool.c
@@ -77,18 +77,11 @@ gst_buffer_pool_class_init (GstBufferPoolClass * klass)
static void
gst_buffer_pool_init (GstBufferPool * pool)
{
- GstPollFD fd;
-
pool->config.align = 1;
- pool->pipe = gst_pipe_new ();
- pool->poll = gst_poll_new (FALSE);
+ pool->poll = gst_poll_new_timer ();
pool->queue = gst_lf_queue_new (10);
default_set_flushing (pool, TRUE);
- gst_pipe_get_read_gstpollfd (pool->pipe, &fd);;
- gst_poll_add_fd (pool->poll, &fd);
- gst_poll_fd_ctl_read (pool->poll, &fd, TRUE);
-
GST_DEBUG_OBJECT (pool, "created");
}
@@ -125,7 +118,7 @@ flush_buffers (GstBufferPool * pool)
pclass = GST_BUFFER_POOL_GET_CLASS (pool);
while ((buffer = gst_lf_queue_pop (pool->queue))) {
- gst_pipe_release (pool->pipe);
+ gst_poll_read_control (pool->poll);
if (G_LIKELY (pclass->free_buffer))
pclass->free_buffer (pool, buffer);
}
@@ -137,12 +130,12 @@ default_set_flushing (GstBufferPool * pool, gboolean flushing)
g_atomic_int_set (&pool->flushing, flushing);
if (flushing) {
- /* raise the pipe so that waiters get woken up and can check the flushing
- * flag we set above */
- gst_pipe_raise (pool->pipe);
+ /* write the control socket so that waiters get woken up and can check the
+ * flushing flag we set above */
+ gst_poll_write_control (pool->poll);
flush_buffers (pool);
} else {
- gst_pipe_release (pool->pipe);
+ gst_poll_read_control (pool->poll);
}
}
@@ -187,7 +180,7 @@ default_set_config (GstBufferPool * pool, GstBufferPoolConfig * config)
/* store in the queue */
gst_lf_queue_push (pool->queue, buffer);
- gst_pipe_raise (pool->pipe);
+ gst_poll_write_control (pool->poll);
}
return TRUE;
@@ -282,7 +275,7 @@ default_acquire_buffer (GstBufferPool * pool, GstBuffer ** buffer,
*buffer = gst_lf_queue_pop (pool->queue);
if (*buffer) {
/* FIXME check the size of the buffer */
- gst_pipe_release (pool->pipe);
+ gst_poll_read_control (pool->poll);
result = GST_FLOW_OK;
break;
}
@@ -352,7 +345,7 @@ default_release_buffer (GstBufferPool * pool, GstBuffer * buffer)
/* keep it around in our queue, we might be flushing but that's ok because we
* handle that unlikely case below. */
gst_lf_queue_push (pool->queue, buffer);
- gst_pipe_raise (pool->pipe);
+ gst_poll_write_control (pool->poll);
if (G_UNLIKELY (g_atomic_int_get (&pool->flushing))) {
/* we are flushing, remove the buffers again */
diff --git a/gst/gstbufferpool.h b/gst/gstbufferpool.h
index 341b4b38f..7bd094755 100644
--- a/gst/gstbufferpool.h
+++ b/gst/gstbufferpool.h
@@ -26,7 +26,6 @@
#include <gst/gstminiobject.h>
#include <gst/gstlfqueue.h>
#include <gst/gstpoll.h>
-#include <gst/gstpipe.h>
#include <gst/gstclock.h>
#include <gst/gstpad.h>
#include <gst/gstbuffer.h>
@@ -121,7 +120,6 @@ struct _GstBufferPool {
gboolean flushing;
GstLFQueue *queue;
GstPoll *poll;
- GstPipe *pipe;
GstBufferPoolConfig config;