sample_count, size);
/* alloc buffer for it */
- out = gst_buffer_new_allocate (NULL, size, 0);
+ out = gst_buffer_new_allocate (NULL, size, NULL);
gst_buffer_map (out, &map, GST_MAP_WRITE);
/* get samples ready for reading now, should be sample_count */
len = GST_RTP_HEADER_LEN + csrc_count * sizeof (guint32)
+ payload_len + pad_len;
- mem = gst_allocator_alloc (NULL, 0, len, 0, len, 0);
+ mem = gst_allocator_alloc (NULL, len, NULL);
gst_memory_map (mem, &map, GST_MAP_WRITE);
/* fill in defaults */
GstVideoAlignment video_align;
gboolean add_videometa;
gboolean need_alignment;
- guint prefix;
- guint padding;
- guint align;
+ GstAllocationParams params;
};
static void gst_video_buffer_pool_finalize (GObject * object);
if (priv->caps)
gst_caps_unref (priv->caps);
priv->caps = gst_caps_copy (caps);
- priv->prefix = prefix;
- priv->padding = padding;
- priv->align = align;
+ gst_allocation_params_init (&priv->params);
+ priv->params.prefix = prefix;
+ priv->params.padding = padding;
+ priv->params.align = align;
/* enable metadata based on config of the pool */
priv->add_videometa =
GstVideoBufferPool *vpool = GST_VIDEO_BUFFER_POOL_CAST (pool);
GstVideoBufferPoolPrivate *priv = vpool->priv;
GstVideoInfo *info;
- GstMemory *mem;
- gint maxsize;
info = &priv->info;
GST_DEBUG_OBJECT (pool, "alloc %" G_GSIZE_FORMAT, info->size);
- maxsize = info->size + priv->prefix + priv->padding;
- mem = gst_allocator_alloc (priv->allocator, 0, maxsize, priv->prefix,
- info->size, priv->align);
- if (mem == NULL)
+ *buffer =
+ gst_buffer_new_allocate (priv->allocator, info->size, &priv->params);
+ if (*buffer == NULL)
goto no_memory;
- *buffer = gst_buffer_new ();
- gst_buffer_take_memory (*buffer, -1, mem);
-
if (priv->add_videometa) {
GST_DEBUG_OBJECT (pool, "adding GstVideoMeta");
buffer =
gst_buffer_new_allocate (NULL,
- (guint) GST_DP_HEADER_PAYLOAD_LENGTH (header), 0);
+ (guint) GST_DP_HEADER_PAYLOAD_LENGTH (header), NULL);
GST_BUFFER_TIMESTAMP (buffer) = GST_DP_HEADER_TIMESTAMP (header);
GST_BUFFER_DURATION (buffer) = GST_DP_HEADER_DURATION (header);