mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-08-07 09:58:31 +00:00
gstreamer-encoder: Add video metadata for DMA-BUF
Include video metadata when using DMA-BUF to provide stride and offset. Without this metadata, GStreamer may incorrectly interpret the buffer layout, leading to corrupted image output—especially when the framebuffer includes padding.
This commit is contained in:
parent
d973f638a5
commit
960e600759
@ -1876,6 +1876,15 @@ spice_gst_encoder_encode_dmabuf(VideoEncoder *video_encoder,
|
||||
gst_buffer_append_memory(buffer, mem);
|
||||
}
|
||||
|
||||
gst_buffer_add_video_meta_full(buffer,
|
||||
GST_VIDEO_FRAME_FLAG_NONE,
|
||||
encoder->format->gst_format,
|
||||
dmabuf_data->width,
|
||||
dmabuf_data->height,
|
||||
dmabuf_data->num_planes,
|
||||
dmabuf_data->offset,
|
||||
dmabuf_data->stride);
|
||||
|
||||
gst_mini_object_weak_ref(GST_MINI_OBJECT(buffer),
|
||||
(GstMiniObjectNotify)spice_gst_mem_free_cb,
|
||||
dmabuf_data);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user