Remove bufferpools

Original commit message from CVS:
Remove bufferpools
This commit is contained in:
David Schleef 2003-12-21 21:12:44 +00:00
parent f5118d859a
commit d229104260
23 changed files with 40 additions and 439 deletions

View file

@ -80,7 +80,6 @@ libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \
gstatomic.c \
gstbin.c \
gstbuffer.c \
gstbufferpool-default.c \
gstcaps2.c \
gstclock.c \
gstcpu.c \
@ -142,7 +141,6 @@ gst_headers = \
gstobject.h \
gstbin.h \
gstbuffer.h \
gstbufferpool-default.h \
gstcaps2.h \
gstclock.h \
gstcompat.h \

View file

@ -133,16 +133,6 @@ gst_spider_identity_class_init (GstSpiderIdentityClass *klass)
gstelement_class->request_new_pad = GST_DEBUG_FUNCPTR(gst_spider_identity_request_new_pad);
}
static GstBufferPool*
gst_spider_identity_get_bufferpool (GstPad *pad)
{
GstSpiderIdentity *ident;
ident = GST_SPIDER_IDENTITY (gst_pad_get_parent (pad));
return gst_pad_get_bufferpool (ident->src);
}
static void
gst_spider_identity_init (GstSpiderIdentity *ident)
{
@ -152,7 +142,6 @@ gst_spider_identity_init (GstSpiderIdentity *ident)
gst_element_add_pad (GST_ELEMENT (ident), ident->sink);
gst_pad_set_link_function (ident->sink, GST_DEBUG_FUNCPTR (gst_spider_identity_link));
gst_pad_set_getcaps_function (ident->sink, GST_DEBUG_FUNCPTR (gst_spider_identity_getcaps));
gst_pad_set_bufferpool_function (ident->sink, GST_DEBUG_FUNCPTR (gst_spider_identity_get_bufferpool));
/* src */
ident->src = gst_pad_new_from_template (
gst_static_pad_template_get (&spider_src_factory), "src");
@ -292,7 +281,6 @@ gst_spider_identity_request_new_pad (GstElement *element, GstPadTemplate *templ
gst_element_add_pad (GST_ELEMENT (ident), ident->sink);
gst_pad_set_link_function (ident->sink, GST_DEBUG_FUNCPTR (gst_spider_identity_link));
gst_pad_set_getcaps_function (ident->sink, GST_DEBUG_FUNCPTR (gst_spider_identity_getcaps));
gst_pad_set_bufferpool_function (ident->sink, GST_DEBUG_FUNCPTR (gst_spider_identity_get_bufferpool));
return ident->sink;
case GST_PAD_SRC:
/* src */

View file

@ -112,7 +112,6 @@ gst_fakesrc_data_get_type (void)
static GEnumValue fakesrc_data[] = {
{ FAKESRC_DATA_ALLOCATE, "1", "Allocate data"},
{ FAKESRC_DATA_SUBBUFFER, "2", "Subbuffer data"},
{ FAKESRC_DATA_BUFFERPOOL, "3", "Use the default buffer pool (forces sizetype=2)"},
{0, NULL, NULL},
};
if (!fakesrc_data_type) {
@ -488,19 +487,6 @@ gst_fakesrc_set_property (GObject *object, guint prop_id, const GValue *value, G
src->parent = NULL;
}
}
if (src->data == FAKESRC_DATA_BUFFERPOOL) {
if (src->sizetype != FAKESRC_SIZETYPE_FIXED)
g_object_set (src, "sizetype", FAKESRC_SIZETYPE_FIXED, NULL);
if (!src->pool)
src->pool = gst_buffer_pool_get_default (src->sizemax, 10);
} else {
if (src->pool) {
gst_buffer_pool_unref (src->pool);
src->pool = NULL;
}
}
break;
case ARG_SIZETYPE:
src->sizetype = g_value_get_enum (value);
@ -728,10 +714,6 @@ gst_fakesrc_create_buffer (GstFakeSrc *src)
}
gst_fakesrc_prepare_buffer (src, buf);
break;
case FAKESRC_DATA_BUFFERPOOL:
buf = gst_buffer_new_from_pool (src->pool, 0, 0);
gst_fakesrc_prepare_buffer (src, buf);
break;
default:
g_warning ("fakesrc: dunno how to allocate buffers !");
buf = gst_buffer_new();
@ -869,10 +851,6 @@ gst_fakesrc_change_state (GstElement *element)
gst_buffer_unref (fakesrc->parent);
fakesrc->parent = NULL;
}
if (fakesrc->pool) {
gst_buffer_pool_unref (fakesrc->pool);
fakesrc->pool = NULL;
}
g_free (fakesrc->last_message);
fakesrc->last_message = NULL;
break;

View file

@ -43,7 +43,6 @@ typedef enum {
typedef enum {
FAKESRC_DATA_ALLOCATE = 1,
FAKESRC_DATA_SUBBUFFER,
FAKESRC_DATA_BUFFERPOOL
} GstFakeSrcDataType;
typedef enum {
@ -103,7 +102,6 @@ struct _GstFakeSrc {
gboolean signal_handoffs;
gboolean dump;
gboolean need_flush;
GstBufferPool *pool;
gchar *last_message;
};

View file

@ -152,16 +152,6 @@ gst_identity_class_init (GstIdentityClass *klass)
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_identity_get_property);
}
static GstBufferPool*
gst_identity_get_bufferpool (GstPad *pad)
{
GstIdentity *identity;
identity = GST_IDENTITY (gst_pad_get_parent (pad));
return gst_pad_get_bufferpool (identity->srcpad);
}
static GstCaps2*
gst_identity_getcaps (GstPad *pad)
{
@ -216,7 +206,6 @@ gst_identity_init (GstIdentity *identity)
identity->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
gst_element_add_pad (GST_ELEMENT (identity), identity->sinkpad);
gst_pad_set_chain_function (identity->sinkpad, GST_DEBUG_FUNCPTR (gst_identity_chain));
gst_pad_set_bufferpool_function (identity->sinkpad, gst_identity_get_bufferpool);
gst_pad_set_link_function (identity->sinkpad, gst_identity_link);
gst_pad_set_getcaps_function (identity->sinkpad, gst_identity_getcaps);

View file

@ -170,16 +170,6 @@ gst_shaper_class_init (GstShaperClass *klass)
gstelement_class->request_new_pad = GST_DEBUG_FUNCPTR (gst_shaper_request_new_pad);
}
static GstBufferPool*
gst_shaper_get_bufferpool (GstPad *pad)
{
GstShaperConnection *connection;
connection = gst_pad_get_element_private (pad);
return gst_pad_get_bufferpool (connection->srcpad);
}
static GstCaps2*
gst_shaper_getcaps (GstPad *pad)
{
@ -236,7 +226,6 @@ gst_shaper_create_connection (GstShaper *shaper)
connection->sinkpad = gst_pad_new_from_template (
gst_static_pad_template_get (&shaper_sink_template), padname);
g_free (padname);
gst_pad_set_bufferpool_function (connection->sinkpad, gst_shaper_get_bufferpool);
gst_pad_set_getcaps_function (connection->sinkpad, gst_shaper_getcaps);
gst_pad_set_internal_link_function (connection->sinkpad, gst_shaper_get_internal_link);
gst_pad_set_link_function (connection->sinkpad, gst_shaper_link);

View file

@ -151,23 +151,12 @@ gst_statistics_class_init (GstStatisticsClass *klass)
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_statistics_get_property);
}
static GstBufferPool*
gst_statistics_get_bufferpool (GstPad *pad)
{
GstStatistics *statistics;
statistics = GST_STATISTICS (gst_pad_get_parent (pad));
return gst_pad_get_bufferpool (statistics->srcpad);
}
static void
gst_statistics_init (GstStatistics *statistics)
{
statistics->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
gst_element_add_pad (GST_ELEMENT (statistics), statistics->sinkpad);
gst_pad_set_chain_function (statistics->sinkpad, GST_DEBUG_FUNCPTR (gst_statistics_chain));
gst_pad_set_bufferpool_function (statistics->sinkpad, GST_DEBUG_FUNCPTR (gst_statistics_get_bufferpool));
statistics->srcpad = gst_pad_new ("src", GST_PAD_SRC);
gst_element_add_pad (GST_ELEMENT (statistics), statistics->srcpad);

View file

@ -33,7 +33,6 @@
#include <gst/gstbin.h>
#include <gst/gstbuffer.h>
#include <gst/gstbufferpool-default.h>
#include <gst/gstcaps2.h>
#include <gst/gstclock.h>
#include <gst/gstcpu.h>

View file

@ -27,7 +27,6 @@
#include "gstbuffer.h"
#include "gstmemchunk.h"
#include "gstinfo.h"
#include "gstbufferpool-default.h"
GType _gst_buffer_type;
GType _gst_buffer_pool_type;
@ -37,7 +36,6 @@ GType _gst_buffer_pool_type;
#include "gsttrace.h"
static GstAllocTrace *_gst_buffer_trace;
static GstAllocTrace *_gst_buffer_pool_trace;
#endif
static GstMemChunk *chunk;
@ -55,7 +53,6 @@ _gst_buffer_initialize (void)
#ifndef GST_DISABLE_TRACE
_gst_buffer_trace = gst_alloc_trace_register (GST_BUFFER_TRACE_NAME);
_gst_buffer_pool_trace = gst_alloc_trace_register (GST_BUFFER_POOL_TRACE_NAME);
#endif
chunk = gst_mem_chunk_new ("GstBufferChunk", sizeof (GstBuffer),
@ -70,16 +67,6 @@ gst_buffer_get_type (void)
return _gst_buffer_type;
}
static void
_gst_buffer_free_to_pool (GstBuffer *buffer)
{
GstBufferPool *pool = buffer->pool;
pool->buffer_free (pool, buffer, pool->user_data);
gst_data_unref (GST_DATA (pool));
}
static void
_gst_buffer_sub_free (GstBuffer *buffer)
{
@ -125,12 +112,6 @@ gst_buffer_default_free (GstBuffer *buffer)
#endif
}
static GstBuffer*
_gst_buffer_copy_from_pool (GstBuffer *buffer)
{
return buffer->pool->buffer_copy (buffer->pool, buffer, buffer->pool->user_data);
}
/**
* gst_buffer_stamp:
* @dest: buffer to stamp
@ -251,42 +232,6 @@ gst_buffer_new_and_alloc (guint size)
return newbuf;
}
/**
* gst_buffer_new_from_pool:
* @pool: a #GstBufferPool to use.
* @offset: the offset of the new buffer.
* @size: the size of the new buffer.
*
* Creates a newly allocated buffer using the specified buffer pool,
* offset and size.
*
* Returns: the new #GstBuffer, or NULL if there was an error.
*/
GstBuffer*
gst_buffer_new_from_pool (GstBufferPool *pool,
guint64 offset, guint size)
{
GstBuffer *buffer;
g_return_val_if_fail (pool != NULL, NULL);
gst_data_ref (GST_DATA (pool));
buffer = pool->buffer_new (pool, offset, size, pool->user_data);
if (!buffer)
return NULL;
GST_BUFFER_BUFFERPOOL (buffer) = pool;
/* override the buffer refcount functions with those from the pool (if any) */
if (pool->buffer_free)
GST_DATA (buffer)->free = (GstDataFreeFunction)_gst_buffer_free_to_pool;
if (pool->buffer_copy)
GST_DATA (buffer)->copy = (GstDataCopyFunction)_gst_buffer_copy_from_pool;
return buffer;
}
/**
* gst_buffer_create_sub:
* @parent: a parent #GstBuffer to create a subbuffer from.
@ -495,135 +440,3 @@ gst_buffer_pool_get_type (void)
return _gst_buffer_pool_type;
}
/**
* gst_buffer_pool_default_free:
* @pool: a #GstBufferPool to free.
*
* Frees the memory associated with the bufferpool.
*/
void
gst_buffer_pool_default_free (GstBufferPool *pool)
{
g_return_if_fail (pool != NULL);
_GST_DATA_DISPOSE (GST_DATA (pool));
g_free (pool);
#ifndef GST_DISABLE_TRACE
gst_alloc_trace_free (_gst_buffer_pool_trace, pool);
#endif
}
/**
* gst_buffer_pool_new:
* @free: the #GstDataFreeFunction to free the buffer pool.
* @copy: the #GstDataCopyFunction to copy the buffer pool.
* @buffer_new: the #GstBufferPoolBufferNewFunction to create a new buffer
* from this pool
* @buffer_copy: the #GstBufferPoolBufferCopyFunction to copy a buffer
* from this pool
* @buffer_free: the #GstBufferPoolBufferFreeFunction to free a buffer
* in this pool
* @user_data: the user data gpointer passed to buffer_* functions.
*
* Creates a new buffer pool with the given functions.
*
* Returns: a new #GstBufferPool, or NULL on error.
*/
GstBufferPool*
gst_buffer_pool_new (GstDataFreeFunction free,
GstDataCopyFunction copy,
GstBufferPoolBufferNewFunction buffer_new,
GstBufferPoolBufferCopyFunction buffer_copy,
GstBufferPoolBufferFreeFunction buffer_free,
gpointer user_data)
{
GstBufferPool *pool;
/* we need at least a buffer_new function */
g_return_val_if_fail (buffer_new != NULL, NULL);
pool = g_new0 (GstBufferPool, 1);
#ifndef GST_DISABLE_TRACE
gst_alloc_trace_new (_gst_buffer_pool_trace, pool);
#endif
GST_CAT_DEBUG (GST_CAT_BUFFER, "allocating new buffer pool %p\n", pool);
/* init data struct */
_GST_DATA_INIT (GST_DATA (pool),
_gst_buffer_pool_type,
0,
(free ? free : (GstDataFreeFunction) gst_buffer_pool_default_free),
copy);
/* set functions */
pool->buffer_new = buffer_new;
pool->buffer_copy = buffer_copy;
pool->buffer_free = buffer_free;
pool->user_data = user_data;
return pool;
}
/**
* gst_buffer_pool_is_active:
* @pool: the #GstBufferPool to query.
*
* Queries if the given buffer pool is active.
*
* Returns: TRUE if the pool is active.
*/
gboolean
gst_buffer_pool_is_active (GstBufferPool *pool)
{
g_return_val_if_fail (pool != NULL, FALSE);
return pool->active;
}
/**
* gst_buffer_pool_set_active:
* @pool: a #GstBufferPool to set the activity status on.
* @active: the new status of the pool.
*
* Sets the given pool to the active or inactive state depending on the
* active parameter.
*/
void
gst_buffer_pool_set_active (GstBufferPool *pool, gboolean active)
{
g_return_if_fail (pool != NULL);
pool->active = active;
}
/**
* gst_buffer_pool_set_user_data:
* @pool: the #GstBufferPool to set the user data for.
* @user_data: the user_data to set on the buffer pool.
*
* Sets the given user data on the buffer pool.
*/
void
gst_buffer_pool_set_user_data (GstBufferPool *pool, gpointer user_data)
{
g_return_if_fail (pool != NULL);
pool->user_data = user_data;
}
/**
* gst_buffer_pool_get_user_data:
* @pool: the #GstBufferPool to get the user data for.
*
* Gets the user data of the buffer pool.
*
* Returns: the user data associated with this buffer pool.
*/
gpointer
gst_buffer_pool_get_user_data (GstBufferPool *pool)
{
g_return_val_if_fail (pool != NULL, NULL);
return pool->user_data;
}

View file

@ -30,19 +30,14 @@
G_BEGIN_DECLS
typedef struct _GstBuffer GstBuffer;
typedef struct _GstBufferPool GstBufferPool;
#define GST_BUFFER_TRACE_NAME "GstBuffer"
#define GST_BUFFER_POOL_TRACE_NAME "GstBufferPool"
extern GType _gst_buffer_type;
extern GType _gst_buffer_pool_type;
#define GST_TYPE_BUFFER (_gst_buffer_type)
#define GST_TYPE_BUFFER_POOL (_gst_buffer_pool_type)
#define GST_BUFFER(buf) ((GstBuffer *)(buf))
#define GST_BUFFER_POOL(pool) ((GstBufferPool *)(pool))
#define GST_IS_BUFFER(buf) (GST_DATA_TYPE(buf) == GST_TYPE_BUFFER)
#define GST_IS_BUFFER_POOL(buf) (GST_DATA_TYPE(buf) == GST_TYPE_BUFFER_POOL)
@ -110,47 +105,18 @@ struct _GstBuffer {
guint64 offset_end;
/* this is a pointer to the buffer pool (if any) */
GstBufferPool *pool;
gpointer pool;
/* pointer to pool private data of parent buffer in case of a subbuffer */
gpointer pool_private;
gpointer _gst_reserved[GST_PADDING];
};
/* bufferpools */
typedef GstBuffer* (*GstBufferPoolBufferNewFunction) (GstBufferPool *pool, guint64 offset,
guint size, gpointer user_data);
typedef GstBuffer* (*GstBufferPoolBufferCopyFunction) (GstBufferPool *pool,
const GstBuffer *buffer,
gpointer user_data);
typedef void (*GstBufferPoolBufferFreeFunction) (GstBufferPool *pool,
GstBuffer *buffer,
gpointer user_data);
struct _GstBufferPool {
GstData data;
gboolean active;
GstBufferPoolBufferNewFunction buffer_new;
GstBufferPoolBufferCopyFunction buffer_copy;
GstBufferPoolBufferFreeFunction buffer_free;
gpointer user_data;
gpointer _gst_reserved[GST_PADDING];
};
/* allocation */
GType gst_buffer_get_type (void);
GstBuffer* gst_buffer_new (void);
GstBuffer* gst_buffer_new_and_alloc (guint size);
/* creating a new buffer from a pool */
GstBuffer* gst_buffer_new_from_pool (GstBufferPool *pool,
guint64 offset, guint size);
#define gst_buffer_set_data(buf, data, size) \
G_STMT_START { \
GST_BUFFER_DATA (buf) = data; \
@ -183,36 +149,6 @@ void _gst_buffer_initialize (void);
void gst_buffer_default_free (GstBuffer *buffer);
GstBuffer* gst_buffer_default_copy (GstBuffer *buffer);
/* creating a new buffer pools */
GType gst_buffer_pool_get_type (void);
GstBufferPool* gst_buffer_pool_new (GstDataFreeFunction free,
GstDataCopyFunction copy,
GstBufferPoolBufferNewFunction buffer_new,
GstBufferPoolBufferCopyFunction buffer_copy,
GstBufferPoolBufferFreeFunction buffer_free,
gpointer user_data);
/* function used by subclasses and bufferpools */
void gst_buffer_pool_default_free (GstBufferPool *pool);
/* check if pool is usable */
gboolean gst_buffer_pool_is_active (GstBufferPool *pool);
void gst_buffer_pool_set_active (GstBufferPool *pool, gboolean active);
#define gst_buffer_pool_ref(pool) GST_BUFFER_POOL (gst_data_ref (GST_DATA (pool)))
#define gst_buffer_pool_ref_by_count(pool,c) GST_BUFFER_POOL (gst_data_ref_by_count (GST_DATA (pool), c))
#define gst_buffer_pool_unref(pool) gst_data_unref (GST_DATA (pool))
/* bufferpool operations */
#define gst_buffer_pool_copy(pool) GST_BUFFER_POOL (gst_data_copy (GST_DATA (pool)))
#define gst_buffer_pool_is_writable(pool) GST_BUFFER_POOL (gst_data_is_writable (GST_DATA (pool)))
#define gst_buffer_pool_copy_on_write(pool) GST_BUFFER_POOL (gst_data_copy_on_write (GST_DATA (pool)))
#define gst_buffer_pool_free(pool) gst_data_free (GST_DATA (pool))
void gst_buffer_pool_set_user_data (GstBufferPool *pool, gpointer user_data);
gpointer gst_buffer_pool_get_user_data (GstBufferPool *pool);
G_END_DECLS
#endif /* __GST_BUFFER_H__ */

View file

@ -1211,7 +1211,7 @@ gst_element_class_add_pad_template (GstElementClass *klass,
* <note>This function is for use in _base_init functions only.</note>
*/
void
gst_element_class_set_details (GstElementClass *klass, GstElementDetails *details)
gst_element_class_set_details (GstElementClass *klass, const GstElementDetails *details)
{
g_return_if_fail (GST_IS_ELEMENT_CLASS (klass));
g_return_if_fail (GST_IS_ELEMENT_DETAILS (details));

View file

@ -239,7 +239,7 @@ void gst_element_class_add_pad_template (GstElementClass *klass, GstPadTemplat
void gst_element_class_install_std_props (GstElementClass *klass,
const gchar *first_name, ...);
void gst_element_class_set_details (GstElementClass *klass,
GstElementDetails *details);
const GstElementDetails *details);
#define gst_element_default_deep_notify gst_object_default_deep_notify

View file

@ -216,7 +216,6 @@ gst_real_pad_init (GstRealPad *pad)
pad->chainhandler = NULL;
pad->gethandler = NULL;
pad->bufferpoolfunc = NULL;
pad->ghostpads = NULL;
pad->caps = NULL;
@ -824,25 +823,26 @@ gst_pad_set_getcaps_function (GstPad *pad,
GST_CAT_DEBUG (GST_CAT_PADS, "getcapsfunc for %s:%s set to %s",
GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (getcaps));
}
/**
* gst_pad_set_bufferpool_function:
* @pad: a #GstPad to set the bufferpool function for.
* @bufpool: the #GstPadBufferPoolFunction to set.
* gst_pad_set_bufferalloc_function:
* @pad: a #GstPad to set the bufferalloc function for.
* @bufalloc: the #GstPadBufferPoolFunction to set.
*
* Sets the given bufferpool function for the pad. Note that the
* bufferpool function can only be set on sinkpads.
* Sets the given bufferalloc function for the pad. Note that the
* bufferalloc function can only be set on sinkpads.
*/
void
gst_pad_set_bufferpool_function (GstPad *pad,
GstPadBufferPoolFunction bufpool)
gst_pad_set_bufferalloc_function (GstPad *pad,
GstPadBufferAllocFunction bufalloc)
{
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_REAL_PAD (pad));
g_return_if_fail (GST_PAD_IS_SINK (pad));
GST_RPAD_BUFFERPOOLFUNC (pad) = bufpool;
GST_CAT_DEBUG (GST_CAT_PADS, "bufferpoolfunc for %s:%s set to %s",
GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (bufpool));
GST_RPAD_BUFFERALLOCFUNC (pad) = bufalloc;
GST_CAT_DEBUG (GST_CAT_PADS, "bufferallocfunc for %s:%s set to %s",
GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (bufalloc));
}
/**
@ -2214,16 +2214,16 @@ gst_pad_recover_caps_error (GstPad *pad, const GstCaps2 *allowed)
}
/**
* gst_pad_get_bufferpool:
* @pad: a #GstPad to get the bufferpool from.
* gst_pad_alloc_buffer:
* @pad: a #GstPad to get the buffer from.
*
* Gets the bufferpool of the peer pad of the given pad.Note that
* a bufferpool can only be obtained from a srcpad.
* Allocates a new, empty buffer optimized to push to pad #pad. This
* function only works if #pad is a src pad.
*
* Returns: the #GstBufferPool, or NULL in case of an error.
* Returns: a new, empty #GstBuffer, or NULL if there is an error
*/
GstBufferPool*
gst_pad_get_bufferpool (GstPad *pad)
GstBuffer*
gst_pad_alloc_buffer (GstPad *pad, guint64 offset, gint size)
{
GstRealPad *peer;
@ -2236,18 +2236,17 @@ gst_pad_get_bufferpool (GstPad *pad)
if (!peer)
return NULL;
GST_CAT_DEBUG (GST_CAT_BUFFER, "(%s:%s): getting bufferpool", GST_DEBUG_PAD_NAME (pad));
GST_CAT_DEBUG (GST_CAT_BUFFER, "(%s:%s): getting buffer",
GST_DEBUG_PAD_NAME (pad));
if (peer->bufferpoolfunc) {
if (peer->bufferallocfunc) {
GST_CAT_DEBUG (GST_CAT_PADS,
"calling bufferpoolfunc &%s (@%p) of peer pad %s:%s",
GST_DEBUG_FUNCPTR_NAME (peer->bufferpoolfunc),
&peer->bufferpoolfunc, GST_DEBUG_PAD_NAME (((GstPad*) peer)));
return (peer->bufferpoolfunc) (((GstPad*) peer));
"calling bufferallocfunc &%s (@%p) of peer pad %s:%s",
GST_DEBUG_FUNCPTR_NAME (peer->bufferallocfunc),
&peer->bufferallocfunc, GST_DEBUG_PAD_NAME (((GstPad*) peer)));
return (peer->bufferallocfunc) (GST_PAD (peer), offset, size);
} else {
GST_CAT_DEBUG (GST_CAT_PADS, "no bufferpoolfunc for peer pad %s:%s at %p",
GST_DEBUG_PAD_NAME (((GstPad*) peer)), &peer->bufferpoolfunc);
return NULL;
return gst_buffer_new_and_alloc(size);
}
}

View file

@ -122,7 +122,7 @@ typedef GstPadLinkReturn (*GstPadLinkFunction) (GstPad *pad, const GstCaps2 *c
typedef void (*GstPadUnlinkFunction) (GstPad *pad);
typedef GstCaps2* (*GstPadGetCapsFunction) (GstPad *pad);
typedef GstCaps2* (*GstPadFixateFunction) (GstPad *pad, const GstCaps2 *caps, gpointer user_data);
typedef GstBufferPool* (*GstPadBufferPoolFunction) (GstPad *pad);
typedef GstBuffer* (*GstPadBufferAllocFunction) (GstPad *pad, guint64 offset, guint size);
typedef gboolean (*GstPadDispatcherFunction) (GstPad *pad, gpointer data);
@ -191,7 +191,7 @@ struct _GstRealPad {
GstPadQueryTypeFunction querytypefunc;
GstPadIntLinkFunction intlinkfunc;
GstPadBufferPoolFunction bufferpoolfunc;
GstPadBufferAllocFunction bufferallocfunc;
GstProbeDispatcher probedisp;
@ -254,7 +254,7 @@ struct _GstGhostPadClass {
#define GST_RPAD_UNLINKFUNC(pad) (((GstRealPad *)(pad))->unlinkfunc)
#define GST_RPAD_GETCAPSFUNC(pad) (((GstRealPad *)(pad))->getcapsfunc)
#define GST_RPAD_FIXATEFUNC(pad) (((GstRealPad *)(pad))->fixatefunc)
#define GST_RPAD_BUFFERPOOLFUNC(pad) (((GstRealPad *)(pad))->bufferpoolfunc)
#define GST_RPAD_BUFFERALLOCFUNC(pad) (((GstRealPad *)(pad))->bufferallocfunc)
/* GstGhostPad */
#define GST_GPAD_REALPAD(pad) (((GstGhostPad *)(pad))->realpad)
@ -369,8 +369,8 @@ GList* gst_pad_get_ghost_pad_list (GstPad *pad);
GstPadTemplate* gst_pad_get_pad_template (GstPad *pad);
void gst_pad_set_bufferpool_function (GstPad *pad, GstPadBufferPoolFunction bufpool);
GstBufferPool* gst_pad_get_bufferpool (GstPad *pad);
void gst_pad_set_bufferalloc_function (GstPad *pad, GstPadBufferAllocFunction bufferalloc);
GstBuffer* gst_pad_alloc_buffer (GstPad *pad, guint64 offset, gint size);
/* data passing setup functions */
void gst_pad_set_chain_function (GstPad *pad, GstPadChainFunction chain);

View file

@ -90,8 +90,6 @@ static GstPadLinkReturn
static void gst_queue_chain (GstPad *pad,
GstData *data);
static GstData *gst_queue_get (GstPad *pad);
static GstBufferPool *
gst_queue_get_bufferpool (GstPad *pad);
static gboolean gst_queue_handle_src_event (GstPad *pad,
GstEvent *event);
@ -253,7 +251,6 @@ gst_queue_init (GstQueue *queue)
queue->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
gst_pad_set_chain_function (queue->sinkpad, GST_DEBUG_FUNCPTR (gst_queue_chain));
gst_element_add_pad (GST_ELEMENT (queue), queue->sinkpad);
gst_pad_set_bufferpool_function (queue->sinkpad, GST_DEBUG_FUNCPTR (gst_queue_get_bufferpool));
gst_pad_set_link_function (queue->sinkpad, GST_DEBUG_FUNCPTR (gst_queue_link));
gst_pad_set_getcaps_function (queue->sinkpad, GST_DEBUG_FUNCPTR (gst_queue_getcaps));
gst_pad_set_active (queue->sinkpad, TRUE);
@ -349,12 +346,6 @@ gst_queue_getcaps (GstPad *pad)
return gst_caps2_new_any ();
}
static GstBufferPool *
gst_queue_get_bufferpool (GstPad *pad)
{
return gst_pad_get_bufferpool (gst_queue_otherpad (pad));
}
static void
gst_queue_locked_flush (GstQueue *queue)
{

View file

@ -112,7 +112,6 @@ gst_fakesrc_data_get_type (void)
static GEnumValue fakesrc_data[] = {
{ FAKESRC_DATA_ALLOCATE, "1", "Allocate data"},
{ FAKESRC_DATA_SUBBUFFER, "2", "Subbuffer data"},
{ FAKESRC_DATA_BUFFERPOOL, "3", "Use the default buffer pool (forces sizetype=2)"},
{0, NULL, NULL},
};
if (!fakesrc_data_type) {
@ -488,19 +487,6 @@ gst_fakesrc_set_property (GObject *object, guint prop_id, const GValue *value, G
src->parent = NULL;
}
}
if (src->data == FAKESRC_DATA_BUFFERPOOL) {
if (src->sizetype != FAKESRC_SIZETYPE_FIXED)
g_object_set (src, "sizetype", FAKESRC_SIZETYPE_FIXED, NULL);
if (!src->pool)
src->pool = gst_buffer_pool_get_default (src->sizemax, 10);
} else {
if (src->pool) {
gst_buffer_pool_unref (src->pool);
src->pool = NULL;
}
}
break;
case ARG_SIZETYPE:
src->sizetype = g_value_get_enum (value);
@ -728,10 +714,6 @@ gst_fakesrc_create_buffer (GstFakeSrc *src)
}
gst_fakesrc_prepare_buffer (src, buf);
break;
case FAKESRC_DATA_BUFFERPOOL:
buf = gst_buffer_new_from_pool (src->pool, 0, 0);
gst_fakesrc_prepare_buffer (src, buf);
break;
default:
g_warning ("fakesrc: dunno how to allocate buffers !");
buf = gst_buffer_new();
@ -869,10 +851,6 @@ gst_fakesrc_change_state (GstElement *element)
gst_buffer_unref (fakesrc->parent);
fakesrc->parent = NULL;
}
if (fakesrc->pool) {
gst_buffer_pool_unref (fakesrc->pool);
fakesrc->pool = NULL;
}
g_free (fakesrc->last_message);
fakesrc->last_message = NULL;
break;

View file

@ -43,7 +43,6 @@ typedef enum {
typedef enum {
FAKESRC_DATA_ALLOCATE = 1,
FAKESRC_DATA_SUBBUFFER,
FAKESRC_DATA_BUFFERPOOL
} GstFakeSrcDataType;
typedef enum {
@ -103,7 +102,6 @@ struct _GstFakeSrc {
gboolean signal_handoffs;
gboolean dump;
gboolean need_flush;
GstBufferPool *pool;
gchar *last_message;
};

View file

@ -152,16 +152,6 @@ gst_identity_class_init (GstIdentityClass *klass)
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_identity_get_property);
}
static GstBufferPool*
gst_identity_get_bufferpool (GstPad *pad)
{
GstIdentity *identity;
identity = GST_IDENTITY (gst_pad_get_parent (pad));
return gst_pad_get_bufferpool (identity->srcpad);
}
static GstCaps2*
gst_identity_getcaps (GstPad *pad)
{
@ -216,7 +206,6 @@ gst_identity_init (GstIdentity *identity)
identity->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
gst_element_add_pad (GST_ELEMENT (identity), identity->sinkpad);
gst_pad_set_chain_function (identity->sinkpad, GST_DEBUG_FUNCPTR (gst_identity_chain));
gst_pad_set_bufferpool_function (identity->sinkpad, gst_identity_get_bufferpool);
gst_pad_set_link_function (identity->sinkpad, gst_identity_link);
gst_pad_set_getcaps_function (identity->sinkpad, gst_identity_getcaps);

View file

@ -90,8 +90,6 @@ static GstPadLinkReturn
static void gst_queue_chain (GstPad *pad,
GstData *data);
static GstData *gst_queue_get (GstPad *pad);
static GstBufferPool *
gst_queue_get_bufferpool (GstPad *pad);
static gboolean gst_queue_handle_src_event (GstPad *pad,
GstEvent *event);
@ -253,7 +251,6 @@ gst_queue_init (GstQueue *queue)
queue->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
gst_pad_set_chain_function (queue->sinkpad, GST_DEBUG_FUNCPTR (gst_queue_chain));
gst_element_add_pad (GST_ELEMENT (queue), queue->sinkpad);
gst_pad_set_bufferpool_function (queue->sinkpad, GST_DEBUG_FUNCPTR (gst_queue_get_bufferpool));
gst_pad_set_link_function (queue->sinkpad, GST_DEBUG_FUNCPTR (gst_queue_link));
gst_pad_set_getcaps_function (queue->sinkpad, GST_DEBUG_FUNCPTR (gst_queue_getcaps));
gst_pad_set_active (queue->sinkpad, TRUE);
@ -349,12 +346,6 @@ gst_queue_getcaps (GstPad *pad)
return gst_caps2_new_any ();
}
static GstBufferPool *
gst_queue_get_bufferpool (GstPad *pad)
{
return gst_pad_get_bufferpool (gst_queue_otherpad (pad));
}
static void
gst_queue_locked_flush (GstQueue *queue)
{

View file

@ -170,16 +170,6 @@ gst_shaper_class_init (GstShaperClass *klass)
gstelement_class->request_new_pad = GST_DEBUG_FUNCPTR (gst_shaper_request_new_pad);
}
static GstBufferPool*
gst_shaper_get_bufferpool (GstPad *pad)
{
GstShaperConnection *connection;
connection = gst_pad_get_element_private (pad);
return gst_pad_get_bufferpool (connection->srcpad);
}
static GstCaps2*
gst_shaper_getcaps (GstPad *pad)
{
@ -236,7 +226,6 @@ gst_shaper_create_connection (GstShaper *shaper)
connection->sinkpad = gst_pad_new_from_template (
gst_static_pad_template_get (&shaper_sink_template), padname);
g_free (padname);
gst_pad_set_bufferpool_function (connection->sinkpad, gst_shaper_get_bufferpool);
gst_pad_set_getcaps_function (connection->sinkpad, gst_shaper_getcaps);
gst_pad_set_internal_link_function (connection->sinkpad, gst_shaper_get_internal_link);
gst_pad_set_link_function (connection->sinkpad, gst_shaper_link);

View file

@ -151,23 +151,12 @@ gst_statistics_class_init (GstStatisticsClass *klass)
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_statistics_get_property);
}
static GstBufferPool*
gst_statistics_get_bufferpool (GstPad *pad)
{
GstStatistics *statistics;
statistics = GST_STATISTICS (gst_pad_get_parent (pad));
return gst_pad_get_bufferpool (statistics->srcpad);
}
static void
gst_statistics_init (GstStatistics *statistics)
{
statistics->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
gst_element_add_pad (GST_ELEMENT (statistics), statistics->sinkpad);
gst_pad_set_chain_function (statistics->sinkpad, GST_DEBUG_FUNCPTR (gst_statistics_chain));
gst_pad_set_bufferpool_function (statistics->sinkpad, GST_DEBUG_FUNCPTR (gst_statistics_get_bufferpool));
statistics->srcpad = gst_pad_new ("src", GST_PAD_SRC);
gst_element_add_pad (GST_ELEMENT (statistics), statistics->srcpad);

View file

@ -558,9 +558,9 @@ print_element_info (GstElementFactory *factory)
g_print (" Has custom intconnfunc(): %s\n",
GST_DEBUG_FUNCPTR_NAME(realpad->intlinkfunc));
if (realpad->bufferpoolfunc)
g_print (" Has bufferpoolfunc(): %s\n",
GST_DEBUG_FUNCPTR_NAME(realpad->bufferpoolfunc));
if (realpad->bufferallocfunc)
g_print (" Has bufferallocfunc(): %s\n",
GST_DEBUG_FUNCPTR_NAME(realpad->bufferallocfunc));
if (pad->padtemplate)
g_print (" Pad Template: '%s'\n",

View file

@ -663,9 +663,9 @@ print_element_info (GstElementFactory *factory)
PUT_STRING (4, "<intlink-function function=\"%s\"/>",
GST_DEBUG_FUNCPTR_NAME(realpad->intlinkfunc));
if (realpad->bufferpoolfunc)
PUT_STRING (4, "<bufferpool-function function=\"%s\"/>",
GST_DEBUG_FUNCPTR_NAME(realpad->bufferpoolfunc));
if (realpad->bufferallocfunc)
PUT_STRING (4, "<bufferalloc-function function=\"%s\"/>",
GST_DEBUG_FUNCPTR_NAME(realpad->bufferallocfunc));
PUT_END_TAG (3, "implementation");
if (realpad->caps) {