Commit 697c5293 authored by David Schleef's avatar David Schleef

Remove bufferpools (but keep implementations)

Original commit message from CVS:
Remove bufferpools (but keep implementations)
parent 93af709d
......@@ -40,7 +40,6 @@ struct _GstMonoscope {
/* pads */
GstPad *sinkpad,*srcpad;
GstBufferPool *peerpool;
/* the timestamp of the next frame */
guint64 next_time;
......@@ -174,7 +173,6 @@ gst_monoscope_init (GstMonoscope *monoscope)
gst_pad_set_link_function (monoscope->srcpad, gst_monoscope_srcconnect);
monoscope->next_time = 0;
monoscope->peerpool = NULL;
/* reset the initial video state */
monoscope->first_buffer = TRUE;
......
......@@ -124,20 +124,6 @@ gst_osssink_get_type (void)
return osssink_type;
}
static GstBufferPool*
gst_osssink_get_bufferpool (GstPad *pad)
{
GstOssSink *oss;
oss = GST_OSSSINK (gst_pad_get_parent(pad));
/* 6 buffers per chunk by default */
if (!oss->sinkpool)
oss->sinkpool = gst_buffer_pool_get_default (oss->bufsize, 6);
return oss->sinkpool;
}
static void
gst_osssink_dispose (GObject *object)
{
......@@ -207,7 +193,6 @@ gst_osssink_init (GstOssSink *osssink)
gst_static_pad_template_get (&osssink_sink_factory), "sink");
gst_element_add_pad (GST_ELEMENT (osssink), osssink->sinkpad);
gst_pad_set_link_function (osssink->sinkpad, gst_osssink_sinkconnect);
gst_pad_set_bufferpool_function (osssink->sinkpad, gst_osssink_get_bufferpool);
gst_pad_set_convert_function (osssink->sinkpad, gst_osssink_convert);
gst_pad_set_query_function (osssink->sinkpad, gst_osssink_sink_query);
gst_pad_set_query_type_function (osssink->sinkpad, gst_osssink_get_query_types);
......@@ -220,7 +205,6 @@ gst_osssink_init (GstOssSink *osssink)
osssink->resync = FALSE;
osssink->mute = FALSE;
osssink->sync = TRUE;
osssink->sinkpool = NULL;
osssink->provided_clock = gst_audio_clock_new ("ossclock", gst_osssink_get_time, osssink);
gst_object_set_parent (GST_OBJECT (osssink->provided_clock), GST_OBJECT (osssink));
osssink->handled = 0;
......@@ -516,7 +500,6 @@ gst_osssink_set_property (GObject *object, guint prop_id, const GValue *value, G
break;
case ARG_BUFFER_SIZE:
osssink->bufsize = g_value_get_uint (value);
osssink->sinkpool = gst_buffer_pool_get_default (osssink->bufsize, 6);
g_object_notify (object, "buffer_size");
break;
case ARG_SYNC:
......
......@@ -56,7 +56,6 @@ struct _GstOssSink {
GstOssElement element;
GstPad *sinkpad;
GstBufferPool *sinkpool;
GstClock *provided_clock;
GstClock *clock;
......
......@@ -92,16 +92,6 @@ static void gst_v4l2src_set_clock (GstElement *element,
GstClock *clock);
/* bufferpool functions */
static GstBuffer * gst_v4l2src_buffer_new (GstBufferPool *pool,
guint64 offset,
guint size,
gpointer user_data);
static void gst_v4l2src_buffer_free (GstBufferPool *pool,
GstBuffer *buf,
gpointer user_data);
static GstPadTemplate *src_template;
static GstElementClass *parent_class = NULL;
......@@ -222,12 +212,6 @@ gst_v4l2src_init (GstV4l2Src *v4l2src)
gst_pad_set_convert_function (v4l2src->srcpad, gst_v4l2src_srcconvert);
gst_pad_set_getcaps_function (v4l2src->srcpad, gst_v4l2src_getcaps);
v4l2src->bufferpool = gst_buffer_pool_new(NULL, NULL,
gst_v4l2src_buffer_new,
NULL,
gst_v4l2src_buffer_free,
v4l2src);
v4l2src->breq.count = 0;
v4l2src->formats = NULL;
......@@ -761,13 +745,6 @@ gst_v4l2src_get (GstPad *pad)
(fps = gst_v4l2src_get_fps(v4l2src)) == 0)
return NULL;
buf = gst_buffer_new_from_pool(v4l2src->bufferpool, 0, 0);
if (!buf) {
gst_element_error(GST_ELEMENT(v4l2src),
"Failed to create a new GstBuffer");
return NULL;
}
if (v4l2src->need_writes > 0) {
/* use last frame */
num = v4l2src->last_frame;
......@@ -842,8 +819,10 @@ gst_v4l2src_get (GstPad *pad)
v4l2src->use_num_times[num] = 1;
}
buf = gst_buffer_new ();
GST_BUFFER_DATA(buf) = gst_v4l2src_get_buffer(v4l2src, num);
GST_BUFFER_SIZE(buf) = v4l2src->bufsettings.bytesused;
GST_BUFFER_FLAG_SET(buf, GST_BUFFER_READONLY);
if (v4l2src->use_fixed_fps)
GST_BUFFER_TIMESTAMP(buf) = v4l2src->handled * GST_SECOND / fps;
else /* calculate time based on our own clock */
......@@ -987,6 +966,7 @@ gst_v4l2src_set_clock (GstElement *element,
}
#if 0
static GstBuffer*
gst_v4l2src_buffer_new (GstBufferPool *pool,
guint64 offset,
......@@ -1010,8 +990,9 @@ gst_v4l2src_buffer_new (GstBufferPool *pool,
return buffer;
}
#endif
#if 0
static void
gst_v4l2src_buffer_free (GstBufferPool *pool,
GstBuffer *buf,
......@@ -1039,3 +1020,5 @@ gst_v4l2src_buffer_free (GstBufferPool *pool,
/* free the buffer itself */
gst_buffer_default_free(buf);
}
#endif
......@@ -80,9 +80,6 @@ struct _GstV4l2Src {
/* how are we going to push buffers? */
gboolean use_fixed_fps;
/* bufferpool for the buffers we're gonna use */
GstBufferPool *bufferpool;
};
struct _GstV4l2SrcClass {
......
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