mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-03-04 01:40:52 -05:00
pipewiresrc: update per-plane stride and offset according to chunk info
This commit is contained in:
parent
182f52603c
commit
95e89f786a
2 changed files with 12 additions and 1 deletions
|
|
@ -412,7 +412,7 @@ gst_deps_def = {
|
|||
'gio-unix-2.0': {},
|
||||
'gstreamer-1.0': {'version': '>= 1.10.0'},
|
||||
'gstreamer-base-1.0': {},
|
||||
'gstreamer-video-1.0': {},
|
||||
'gstreamer-video-1.0': {'version': '>= 1.22.0'},
|
||||
'gstreamer-audio-1.0': {},
|
||||
'gstreamer-allocators-1.0': {},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -838,6 +838,17 @@ static GstBuffer *dequeue_buffer(GstPipeWireSrc *pwsrc)
|
|||
|
||||
video_size += d->chunk->size;
|
||||
}
|
||||
|
||||
/* If the buffer number is smaller than the plane number,
|
||||
* update the stride and offset for the remaining planes.
|
||||
*/
|
||||
if (n_datas && n_datas < n_planes) {
|
||||
for (i = n_datas; i < n_planes; i++) {
|
||||
meta->stride[i] = gst_video_format_info_extrapolate_stride (info->finfo, i, b->buffer->datas[0].chunk->stride);
|
||||
meta->offset[i] = meta->offset[i-1] +
|
||||
meta->stride[i-1] * GST_VIDEO_FORMAT_INFO_SCALE_HEIGHT (info->finfo, i-1, GST_VIDEO_INFO_HEIGHT(info));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (b->buffer->n_datas != gst_buffer_n_memory(data->buf)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue