summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFei Jiang <fei.jiang@intel.com>2010-12-25 15:44:48 +0800
committerFei Jiang <fei.jiang@intel.com>2010-12-25 15:44:48 +0800
commit8b11bbaf790ac7d50e20616764ed13e0fd85e61d (patch)
tree315cf8153d3400a6866843ab6f32dcded0c6c691
parent0749bf21401f8c7db7588b9210e23866d0714dd2 (diff)
downloadlibva-8b11bbaf790ac7d50e20616764ed13e0fd85e61d.tar.gz
Add vaQuerySurfaceError to return decode mb error to middleware.
Fix compile error.
-rwxr-xr-x[-rw-r--r--]va/Android.mk35
-rw-r--r--va/va.c14
-rw-r--r--va/va.h26
-rw-r--r--va/va_backend.h7
4 files changed, 63 insertions, 19 deletions
diff --git a/va/Android.mk b/va/Android.mk
index 74ac5d2..4d14cd6 100644..100755
--- a/va/Android.mk
+++ b/va/Android.mk
@@ -10,23 +10,6 @@ include $(CLEAR_VARS)
#LIBVA_MINOR_VERSION := 31
#LIBVA_MAJOR_VERSION := 0
-
-LOCAL_MODULE := libva
-
-LOCAL_SHARED_LIBRARIES := libdl libdrm libcutils
-
-include $(BUILD_SHARED_LIBRARY)
-
-intermediates := $(local-intermediates-dir)
-GEN := $(intermediates)/va_version.h
-$(GEN): PRIVATE_GEN_VERSION := $(LOCAL_PATH)/../build/gen_version.sh
-$(GEN): PRIVATE_INPUT_FILE := $(LOCAL_PATH)/va_version.h.in
-$(GEN): PRIVATE_CUSTOM_TOOL = sh $(PRIVATE_GEN_VERSION) $(LOCAL_PATH)/.. $(PRIVATE_INPUT_FILE) > $@
-$(GEN): $(LOCAL_PATH)/va_version.h
- $(transform-generated-source)
-
-LOCAL_GENERATED_SOURCES += $(GEN)
-
LOCAL_SRC_FILES := \
va.c \
va_trace.c \
@@ -36,8 +19,6 @@ LOCAL_CFLAGS += \
-DANDROID \
-DVA_DRIVERS_PATH="\"$(LIBVA_DRIVERS_PATH)\""
-LOCAL_COPY_HEADERS_TO := libva/va
-
LOCAL_C_INCLUDES += \
$(TARGET_OUT_HEADERS)/libva \
$(LOCAL_PATH)/x11 \
@@ -50,7 +31,23 @@ LOCAL_COPY_HEADERS := \
va_version.h.in \
x11/va_dricommon.h
+LOCAL_COPY_HEADERS_TO := libva/va
+LOCAL_MODULE := libva
+
+LOCAL_SHARED_LIBRARIES := libdl libdrm libcutils
+
+include $(BUILD_SHARED_LIBRARY)
+
+intermediates := $(local-intermediates-dir)
+GEN := $(intermediates)/va_version.h
+$(GEN): PRIVATE_GEN_VERSION := $(LOCAL_PATH)/../build/gen_version.sh
+$(GEN): PRIVATE_INPUT_FILE := $(LOCAL_PATH)/va_version.h.in
+$(GEN): PRIVATE_CUSTOM_TOOL = sh $(PRIVATE_GEN_VERSION) $(LOCAL_PATH)/.. $(PRIVATE_INPUT_FILE) > $@
+$(GEN): $(LOCAL_PATH)/va_version.h
+ $(transform-generated-source)
+
+LOCAL_GENERATED_SOURCES += $(GEN)
# For libva-android
# =====================================================
diff --git a/va/va.c b/va/va.c
index 765d6d2..663c14b 100644
--- a/va/va.c
+++ b/va/va.c
@@ -853,6 +853,20 @@ VAStatus vaQuerySurfaceStatus (
return ctx->vtable.vaQuerySurfaceStatus( ctx, render_target, status );
}
+VAStatus vaQuerySurfaceError (
+ VADisplay dpy,
+ VASurfaceID surface,
+ VAStatus error_status,
+ void **error_info /*out*/
+)
+{
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
+
+ return ctx->vtable.vaQuerySurfaceError( ctx, surface, error_status, error_info );
+}
+
/* Get maximum number of image formats supported by the implementation */
int vaMaxNumImageFormats (
VADisplay dpy
diff --git a/va/va.h b/va/va.h
index ddc36e6..3d519e0 100644
--- a/va/va.h
+++ b/va/va.h
@@ -130,6 +130,7 @@ typedef int VAStatus; /* Return status type from functions */
#define VA_STATUS_ERROR_INVALID_IMAGE_FORMAT 0x00000016
#define VA_STATUS_ERROR_DECODING_ERROR 0x00000017
#define VA_STATUS_ERROR_ENCODING_ERROR 0x00000018
+#define VA_STATUS_ERROR_SURFACE_MB_ERRORS 0x00000019
#define VA_STATUS_ERROR_UNKNOWN 0xFFFFFFFF
/* De-interlacing flags for vaPutSurface() */
@@ -1438,6 +1439,31 @@ VAStatus vaQuerySurfaceStatus (
);
/*
+ * MB error info returned to middleware.
+ */
+typedef struct _VASurfaceDecodeMBErrors
+{
+ int status; /* 1 if hardware has returned detailed info below, -1 means this record is invalid */
+ unsigned int start_mb; /* start mb address with errors */
+ unsigned int end_mb; /* end mb address with errors */
+} VASurfaceDecodeMBErrors;
+
+/*
+ * After the application gets VA_STATUS_ERROR_DECODING_ERROR after calling vaSyncSurface(),
+ * it can call vaQuerySurfaceError to find out further details on the particular error.
+ * VA_STATUS_ERROR_SURFACE_MB_ERRORS should be passed in as "error_status",
+ * upon the return, error_info will point to an array of _VASurfaceDecodeMBErrors structure,
+ * which is allocated and filled by libVA with detailed information on the missing or error macroblocks.
+ * The array is terminated if "status==-1" is detected.
+ */
+VAStatus vaQuerySurfaceError(
+ VADisplay dpy,
+ VASurfaceID surface,
+ VAStatus error_status,
+ void **error_info
+);
+
+/*
* Images and Subpictures
* VAImage is used to either get the surface data to client memory, or
* to copy image data in client memory to a surface.
diff --git a/va/va_backend.h b/va/va_backend.h
index 62ac970..d1e5570 100644
--- a/va/va_backend.h
+++ b/va/va_backend.h
@@ -178,6 +178,13 @@ struct VADriverVTable
VASurfaceStatus *status /* out */
);
+ VAStatus (*vaQuerySurfaceError) (
+ VADriverContextP ctx,
+ VASurfaceID render_target,
+ VAStatus error_status,
+ void **error_info /*out*/
+ );
+
VAStatus (*vaPutSurface) (
VADriverContextP ctx,
VASurfaceID surface,