mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
gst: Log buffer memory type
This is helpful when one wants to ensure the right memory type is used, independently from the negotiated format.
This commit is contained in:
parent
714b438814
commit
17c53577e8
1 changed files with 3 additions and 0 deletions
|
|
@ -89,16 +89,19 @@ void gst_pipewire_pool_wrap_buffer (GstPipeWirePool *pool, struct pw_buffer *b)
|
||||||
|
|
||||||
GST_LOG_OBJECT (pool, "wrap buffer %d %d", d->mapoffset, d->maxsize);
|
GST_LOG_OBJECT (pool, "wrap buffer %d %d", d->mapoffset, d->maxsize);
|
||||||
if (d->type == SPA_DATA_MemFd) {
|
if (d->type == SPA_DATA_MemFd) {
|
||||||
|
GST_LOG_OBJECT (pool, "memory type MemFd");
|
||||||
gmem = gst_fd_allocator_alloc (pool->fd_allocator, dup(d->fd),
|
gmem = gst_fd_allocator_alloc (pool->fd_allocator, dup(d->fd),
|
||||||
d->mapoffset + d->maxsize, GST_FD_MEMORY_FLAG_NONE);
|
d->mapoffset + d->maxsize, GST_FD_MEMORY_FLAG_NONE);
|
||||||
gst_memory_resize (gmem, d->mapoffset, d->maxsize);
|
gst_memory_resize (gmem, d->mapoffset, d->maxsize);
|
||||||
}
|
}
|
||||||
else if(d->type == SPA_DATA_DmaBuf) {
|
else if(d->type == SPA_DATA_DmaBuf) {
|
||||||
|
GST_LOG_OBJECT (pool, "memory type DmaBuf");
|
||||||
gmem = gst_fd_allocator_alloc (pool->dmabuf_allocator, dup(d->fd),
|
gmem = gst_fd_allocator_alloc (pool->dmabuf_allocator, dup(d->fd),
|
||||||
d->mapoffset + d->maxsize, GST_FD_MEMORY_FLAG_NONE);
|
d->mapoffset + d->maxsize, GST_FD_MEMORY_FLAG_NONE);
|
||||||
gst_memory_resize (gmem, d->mapoffset, d->maxsize);
|
gst_memory_resize (gmem, d->mapoffset, d->maxsize);
|
||||||
}
|
}
|
||||||
else if (d->type == SPA_DATA_MemPtr) {
|
else if (d->type == SPA_DATA_MemPtr) {
|
||||||
|
GST_LOG_OBJECT (pool, "memory type MemPtr");
|
||||||
gmem = gst_memory_new_wrapped (0, d->data, d->maxsize, 0,
|
gmem = gst_memory_new_wrapped (0, d->data, d->maxsize, 0,
|
||||||
d->maxsize, NULL, NULL);
|
d->maxsize, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue