From fe536e1253f264eb22384db3d6255d7992a3ebb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Misek?= Date: Tue, 5 Nov 2024 15:06:48 +0100 Subject: [PATCH 1/2] fix for AVAPI frame format --- src/frame.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/frame.h b/src/frame.h index 4102d7cc..cd8a9d94 100644 --- a/src/frame.h +++ b/src/frame.h @@ -264,7 +264,9 @@ class Frame : public FFWrapperPtr bool isComplete() const { return m_isComplete; } - bool isValid() const { return (!isNull() && m_raw->data[0] && m_raw->linesize[0]); } + bool isValid() const { + return (!isNull() && (m_raw->data[0] && m_raw->linesize[0]) || ((m_raw->format == AV_PIX_FMT_VAAPI))); + } operator bool() const { return isValid() && isComplete(); } From ec55c08ee11874a6c3e0f1bfdf7eb0a4f484f79c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Misek?= Date: Tue, 5 Nov 2024 15:32:07 +0100 Subject: [PATCH 2/2] valid values for VASurfaceID is > 0 --- src/frame.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/frame.h b/src/frame.h index cd8a9d94..4e1386a8 100644 --- a/src/frame.h +++ b/src/frame.h @@ -265,7 +265,10 @@ class Frame : public FFWrapperPtr bool isComplete() const { return m_isComplete; } bool isValid() const { - return (!isNull() && (m_raw->data[0] && m_raw->linesize[0]) || ((m_raw->format == AV_PIX_FMT_VAAPI))); + return (!isNull() && + ((m_raw->data[0] && m_raw->linesize[0]) || + ((m_raw->format == AV_PIX_FMT_VAAPI) && ((intptr_t)m_raw->data[3] > 0))) + ); } operator bool() const { return isValid() && isComplete(); }