mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
update for memory api changes
This commit is contained in:
parent
28034226c6
commit
df5253b22c
4 changed files with 11 additions and 18 deletions
|
@ -478,7 +478,7 @@ vorbis_handle_data_packet (GstVorbisDec * vd, ogg_packet * packet,
|
|||
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 */
|
||||
|
|
|
@ -109,7 +109,7 @@ gst_rtp_buffer_allocate_data (GstBuffer * buffer, guint payload_len,
|
|||
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 */
|
||||
|
|
|
@ -144,9 +144,7 @@ struct _GstVideoBufferPoolPrivate
|
|||
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);
|
||||
|
@ -195,9 +193,10 @@ video_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
|
|||
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 =
|
||||
|
@ -243,22 +242,16 @@ video_buffer_pool_alloc (GstBufferPool * pool, GstBuffer ** buffer,
|
|||
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");
|
||||
|
||||
|
|
|
@ -459,7 +459,7 @@ gst_dp_buffer_from_header (guint header_length, const guint8 * header)
|
|||
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue