mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 11:41:09 +00:00
qsv: Fix encoding error when input memory belongs to other GPU
Copy frame if VA display of input buffer is different from that of encoder, like we've been doing on Windows Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3335>
This commit is contained in:
parent
04581fad6a
commit
e1e9ee5506
1 changed files with 4 additions and 2 deletions
|
@ -87,15 +87,17 @@ static GstBuffer *
|
|||
gst_qsv_va_allocator_upload (GstQsvAllocator * allocator,
|
||||
const GstVideoInfo * info, GstBuffer * buffer, GstBufferPool * pool)
|
||||
{
|
||||
GstQsvVaAllocator *self = GST_QSV_VA_ALLOCATOR (allocator);
|
||||
GstVideoFrame src_frame, dst_frame;
|
||||
VASurfaceID surface;
|
||||
GstBuffer *dst_buf;
|
||||
GstFlowReturn ret;
|
||||
|
||||
/* TODO: handle buffer from different VA display */
|
||||
surface = gst_va_buffer_get_surface (buffer);
|
||||
if (surface != VA_INVALID_ID)
|
||||
if (surface != VA_INVALID_ID && gst_va_buffer_peek_display (buffer) ==
|
||||
self->display) {
|
||||
return gst_buffer_ref (buffer);
|
||||
}
|
||||
|
||||
ret = gst_buffer_pool_acquire_buffer (pool, &dst_buf, nullptr);
|
||||
if (ret != GST_FLOW_OK) {
|
||||
|
|
Loading…
Reference in a new issue