mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
gst: fix video metadata offsets
The offsets in GStreamer are always offsets into the buffer memory where the plane starts so set this to the accumulated plane sizes.
This commit is contained in:
parent
241ec04d88
commit
cc6081b70d
1 changed files with 1 additions and 2 deletions
|
|
@ -664,7 +664,6 @@ static GstBuffer *dequeue_buffer(GstPipeWireSrc *pwsrc)
|
|||
GstVideoInfo *info = &pwsrc->video_info;
|
||||
uint32_t n_datas = b->buffer->n_datas;
|
||||
uint32_t n_planes = GST_VIDEO_INFO_N_PLANES (info);
|
||||
gboolean is_planar = n_planes > 1;
|
||||
gsize video_size = 0;
|
||||
|
||||
GstVideoMeta *meta = gst_buffer_add_video_meta_full (buf, GST_VIDEO_FRAME_FLAG_NONE,
|
||||
|
|
@ -677,7 +676,7 @@ static GstBuffer *dequeue_buffer(GstPipeWireSrc *pwsrc)
|
|||
|
||||
for (i = 0; i < MIN (n_datas, n_planes); i++) {
|
||||
struct spa_data *d = &b->buffer->datas[i];
|
||||
meta->offset[i] = is_planar ? d->chunk->offset : video_size;
|
||||
meta->offset[i] = video_size;
|
||||
meta->stride[i] = d->chunk->stride;
|
||||
|
||||
video_size += d->chunk->size;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue