[Libva] [RFC PATCH Libva-intel-driver 4/6] Encoding: Reset the last_packed_header_type to avoid the unpaired packed header type/data

Zhao, Yakui yakui.zhao at intel.com
Tue May 20 22:51:18 PDT 2014


From: "Zhao, Yakui" <yakui.zhao at intel.com>

After adding the support of inserting the packed rawdata, more group of packed header data
can be passed. In order to insert the packed rawdata correctly, the packed header type/
data should be paired.

Signed-off-by: Zhao Yakui <yakui.zhao at intel.com>
---
 src/i965_drv_video.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
index 954b377..056b9e2 100755
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -2313,7 +2313,11 @@ i965_encoder_render_picture(VADriverContextP ctx,
 
         case VAEncPackedHeaderDataBufferType:
         {
-
+            if (encode->last_packed_header_type == 0) {
+                WARN_ONCE("the packed header data is passed without type!\n");
+                vaStatus = VA_STATUS_ERROR_INVALID_PARAMETER;
+                return vaStatus;
+            }
             if (encode->last_packed_header_type == VAEncPackedHeaderRawData) {
                 vaStatus = I965_RENDER_ENCODE_BUFFER(packed_header_data_ext);
                 if (vaStatus == VA_STATUS_SUCCESS) {
@@ -2336,6 +2340,7 @@ i965_encoder_render_picture(VADriverContextP ctx,
                                                                      obj_buffer,
                                                                      va_enc_packed_type_to_idx(encode->last_packed_header_type));
             }
+            encode->last_packed_header_type = 0;
             break;       
         }
 
-- 
1.7.12-rc1



More information about the Libva mailing list