diff options
-rwxr-xr-x | test/basic/Android.mk | 125 | ||||
-rw-r--r-- | test/putsurface/Android.mk | 2 | ||||
-rwxr-xr-x | test/putsurface/putsurface_common.c | 98 | ||||
-rwxr-xr-x | va/Android.mk | 31 | ||||
-rwxr-xr-x | va/va.c | 18 | ||||
-rwxr-xr-x | va/va.h | 15 | ||||
-rw-r--r-- | va/va_android.h | 3 | ||||
-rwxr-xr-x | va/va_backend.h | 2 | ||||
-rw-r--r-- | va/va_backend_tpi.h | 4 | ||||
-rw-r--r-- | va/va_fool.c | 15 | ||||
-rwxr-xr-x | va/va_trace.c | 421 |
11 files changed, 339 insertions, 395 deletions
diff --git a/test/basic/Android.mk b/test/basic/Android.mk index 1755ec9..e5b3a59 100755 --- a/test/basic/Android.mk +++ b/test/basic/Android.mk @@ -1,3 +1,7 @@ +LIBVA_TESTS_SHARED_LIBS := libva-android libva libdl libdrm libcutils libutils +LIBVA_TESTS_CFLAGS := -DANDROID -Wno-unused-parameter +LIBVA_TESTS_C_INCLUDES := $(TARGET_OUT_HEADERS)/libva + # For test_01 # ===================================================== @@ -8,17 +12,12 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := \ test_01.c \ -LOCAL_CFLAGS += \ - -DANDROID - -LOCAL_C_INCLUDES += \ - $(TARGET_OUT_HEADERS)/libva \ - $(TOPDIR)/vendor/intel/hardware/libva/va/ - +LOCAL_CFLAGS := $(LIBVA_TESTS_CFLAGS) +LOCAL_C_INCLUDES := $(LIBVA_TESTS_C_INCLUDES) LOCAL_MODULE_TAGS := optional LOCAL_MODULE := test_001 -LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui libsurfaceflinger +LOCAL_SHARED_LIBRARIES := $(LIBVA_TESTS_SHARED_LIBS) include $(BUILD_EXECUTABLE) @@ -29,17 +28,12 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := \ test_02.c \ -LOCAL_CFLAGS += \ - -DANDROID - -LOCAL_C_INCLUDES += \ - $(TARGET_OUT_HEADERS)/libva \ - $(TOPDIR)/vendor/intel/hardware/libva/va/ - +LOCAL_CFLAGS += $(LIBVA_TESTS_CFLAGS) +LOCAL_C_INCLUDES := $(LIBVA_TESTS_C_INCLUDES) LOCAL_MODULE_TAGS := optional LOCAL_MODULE := test_02_android -LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui libsurfaceflinger +LOCAL_SHARED_LIBRARIES := $(LIBVA_TESTS_SHARED_LIBS) include $(BUILD_EXECUTABLE) @@ -50,17 +44,12 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := \ test_03.c \ -LOCAL_CFLAGS += \ - -DANDROID - -LOCAL_C_INCLUDES += \ - $(TARGET_OUT_HEADERS)/libva \ - $(TOPDIR)/vendor/intel/hardware/libva/va/ - +LOCAL_CFLAGS += $(LIBVA_TESTS_CFLAGS) +LOCAL_C_INCLUDES := $(LIBVA_TESTS_C_INCLUDES) LOCAL_MODULE_TAGS := optional LOCAL_MODULE := test_03_android -LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui libsurfaceflinger +LOCAL_SHARED_LIBRARIES := $(LIBVA_TESTS_SHARED_LIBS) include $(BUILD_EXECUTABLE) @@ -71,17 +60,12 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := \ test_04.c \ -LOCAL_CFLAGS += \ - -DANDROID - -LOCAL_C_INCLUDES += \ - $(TARGET_OUT_HEADERS)/libva \ - $(TOPDIR)/vendor/intel/hardware/libva/va/ - +LOCAL_CFLAGS += $(LIBVA_TESTS_CFLAGS) +LOCAL_C_INCLUDES := $(LIBVA_TESTS_C_INCLUDES) LOCAL_MODULE_TAGS := optional LOCAL_MODULE := test_04_android -LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui libsurfaceflinger +LOCAL_SHARED_LIBRARIES := $(LIBVA_TESTS_SHARED_LIBS) include $(BUILD_EXECUTABLE) @@ -92,17 +76,12 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := \ test_05.c \ -LOCAL_CFLAGS += \ - -DANDROID - -LOCAL_C_INCLUDES += \ - $(TARGET_OUT_HEADERS)/libva \ - $(TOPDIR)/vendor/intel/hardware/libva/va/ - +LOCAL_CFLAGS += $(LIBVA_TESTS_CFLAGS) +LOCAL_C_INCLUDES := $(LIBVA_TESTS_C_INCLUDES) LOCAL_MODULE_TAGS := optional LOCAL_MODULE := test_05_android -LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui libsurfaceflinger +LOCAL_SHARED_LIBRARIES := $(LIBVA_TESTS_SHARED_LIBS) include $(BUILD_EXECUTABLE) @@ -113,17 +92,12 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := \ test_06.c \ -LOCAL_CFLAGS += \ - -DANDROID - -LOCAL_C_INCLUDES += \ - $(TARGET_OUT_HEADERS)/libva \ - $(TOPDIR)/vendor/intel/hardware/libva/va/ - +LOCAL_CFLAGS += $(LIBVA_TESTS_CFLAGS) +LOCAL_C_INCLUDES := $(LIBVA_TESTS_C_INCLUDES) LOCAL_MODULE_TAGS := optional LOCAL_MODULE := test_06_android -LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui libsurfaceflinger +LOCAL_SHARED_LIBRARIES := $(LIBVA_TESTS_SHARED_LIBS) include $(BUILD_EXECUTABLE) @@ -134,17 +108,12 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := \ test_07.c \ -LOCAL_CFLAGS += \ - -DANDROID - -LOCAL_C_INCLUDES += \ - $(TARGET_OUT_HEADERS)/libva \ - $(TOPDIR)/vendor/intel/hardware/libva/va/ - +LOCAL_CFLAGS += $(LIBVA_TESTS_CFLAGS) +LOCAL_C_INCLUDES := $(LIBVA_TESTS_C_INCLUDES) LOCAL_MODULE_TAGS := optional LOCAL_MODULE := test_07_android -LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui libsurfaceflinger +LOCAL_SHARED_LIBRARIES := $(LIBVA_TESTS_SHARED_LIBS) include $(BUILD_EXECUTABLE) @@ -155,17 +124,12 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := \ test_08.c \ -LOCAL_CFLAGS += \ - -DANDROID - -LOCAL_C_INCLUDES += \ - $(TARGET_OUT_HEADERS)/libva \ - $(TOPDIR)/vendor/intel/hardware/libva/va/ - +LOCAL_CFLAGS += $(LIBVA_TESTS_CFLAGS) +LOCAL_C_INCLUDES := $(LIBVA_TESTS_C_INCLUDES) LOCAL_MODULE_TAGS := optional LOCAL_MODULE := test_08_android -LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui libsurfaceflinger +LOCAL_SHARED_LIBRARIES := $(LIBVA_TESTS_SHARED_LIBS) include $(BUILD_EXECUTABLE) @@ -176,17 +140,12 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := \ test_09.c \ -LOCAL_CFLAGS += \ - -DANDROID - -LOCAL_C_INCLUDES += \ - $(TARGET_OUT_HEADERS)/libva \ - $(TOPDIR)/vendor/intel/hardware/libva/va/ - +LOCAL_CFLAGS += $(LIBVA_TESTS_CFLAGS) +LOCAL_C_INCLUDES := $(LIBVA_TESTS_C_INCLUDES) LOCAL_MODULE_TAGS := optional LOCAL_MODULE := test_09_android -LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui libsurfaceflinger +LOCAL_SHARED_LIBRARIES := $(LIBVA_TESTS_SHARED_LIBS) include $(BUILD_EXECUTABLE) @@ -197,17 +156,12 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := \ test_10.c -LOCAL_CFLAGS += \ - -DANDROID - -LOCAL_C_INCLUDES += \ - $(TARGET_OUT_HEADERS)/libva \ - $(TOPDIR)/vendor/intel/hardware/libva/va/ - +LOCAL_CFLAGS += $(LIBVA_TESTS_CFLAGS) +LOCAL_C_INCLUDES := $(LIBVA_TESTS_C_INCLUDES) LOCAL_MODULE_TAGS := optional LOCAL_MODULE := test_10_android -LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui libsurfaceflinger +LOCAL_SHARED_LIBRARIES := $(LIBVA_TESTS_SHARED_LIBS) include $(BUILD_EXECUTABLE) @@ -218,17 +172,12 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := \ test_11.c -LOCAL_CFLAGS += \ - -DANDROID - -LOCAL_C_INCLUDES += \ - $(TARGET_OUT_HEADERS)/libva \ - $(TOPDIR)/vendor/intel/hardware/libva/va/ - +LOCAL_CFLAGS += $(LIBVA_TESTS_CFLAGS) +LOCAL_C_INCLUDES := $(LIBVA_TESTS_C_INCLUDES) LOCAL_MODULE_TAGS := optional LOCAL_MODULE := test_11_android -LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui libsurfaceflinger +LOCAL_SHARED_LIBRARIES := $(LIBVA_TESTS_SHARED_LIBS) include $(BUILD_EXECUTABLE) diff --git a/test/putsurface/Android.mk b/test/putsurface/Android.mk index 03edb61..628492d 100644 --- a/test/putsurface/Android.mk +++ b/test/putsurface/Android.mk @@ -10,7 +10,7 @@ LOCAL_SRC_FILES := \ #putsurface_x11.c LOCAL_CFLAGS += \ - -DANDROID + -DANDROID -Wno-unused-parameter LOCAL_C_INCLUDES += \ $(TARGET_OUT_HEADERS)/libva diff --git a/test/putsurface/putsurface_common.c b/test/putsurface/putsurface_common.c index e52bf45..d7d7003 100755 --- a/test/putsurface/putsurface_common.c +++ b/test/putsurface/putsurface_common.c @@ -8,11 +8,11 @@ * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. @@ -89,7 +89,7 @@ static VASurfaceID csc_render_surface; typedef struct { - char * fmt_str; + const char * fmt_str; unsigned int fourcc; } fourcc_map; fourcc_map va_fourcc_map[] = { @@ -114,7 +114,7 @@ unsigned int map_str_to_vafourcc (char * str) return 0; } -char* map_vafourcc_to_str (unsigned int format) +const char* map_vafourcc_to_str (unsigned int format) { static char unknown_format[] = "unknown-format"; unsigned int i; @@ -161,7 +161,7 @@ ensure_image_formats(void) if (num_image_formats == 0) return 0; - image_formats = malloc(num_image_formats * sizeof(*image_formats)); + image_formats = (VAImageFormat *) malloc(num_image_formats * sizeof(*image_formats)); if (!image_formats) return 0; @@ -210,7 +210,7 @@ ensure_surface_attribs(void) /* Guess the number of surface attributes, thus including any pixel-format supported by the VA driver */ num_surface_attribs = VASurfaceAttribCount + num_image_formats; - surface_attribs = malloc(num_surface_attribs * sizeof(*surface_attribs)); + surface_attribs = (VASurfaceAttrib *) malloc(num_surface_attribs * sizeof(*surface_attribs)); if (!surface_attribs) return 0; @@ -219,7 +219,7 @@ ensure_surface_attribs(void) if (va_status == VA_STATUS_SUCCESS) va_surface_attribs = surface_attribs; else if (va_status == VA_STATUS_ERROR_MAX_NUM_EXCEEDED) { - va_surface_attribs = realloc(surface_attribs, + va_surface_attribs = (VASurfaceAttrib *) realloc(surface_attribs, num_surface_attribs * sizeof(*va_surface_attribs)); if (!va_surface_attribs) { free(surface_attribs); @@ -256,7 +256,8 @@ lookup_surface_attrib(VASurfaceAttribType type, const VAGenericValue *value) int csc_preparation () { VAStatus va_status; - + VASurfaceAttrib surface_attribs[1], * const s_attrib = &surface_attribs[0]; + // 1. make sure dst fourcc is supported for vaImage if (!lookup_image_format(csc_dst_fourcc)) { test_color_conversion = 0; @@ -265,7 +266,6 @@ int csc_preparation () } // 2. make sure src_fourcc is supported for vaSurface - VASurfaceAttrib surface_attribs[1], * const s_attrib = &surface_attribs[0]; s_attrib->type = VASurfaceAttribPixelFormat; s_attrib->flags = VA_SURFACE_ATTRIB_SETTABLE; s_attrib->value.type = VAGenericValueTypeInteger; @@ -292,18 +292,18 @@ int csc_preparation () image_format.fourcc = csc_dst_fourcc; image_format.byte_order = VA_LSB_FIRST; image_format.bits_per_pixel = 16; - + va_status = vaCreateImage(va_dpy, &image_format, surface_width, surface_height, &csc_dst_fourcc_image); CHECK_VASTATUS(va_status,"vaCreateImage"); - + // 3.3 create a temp VASurface for final rendering(vaPutSurface) s_attrib->value.value.i = VA_FOURCC_NV12; - va_status = vaCreateSurfaces(va_dpy, VA_RT_FORMAT_YUV420, + va_status = vaCreateSurfaces(va_dpy, VA_RT_FORMAT_YUV420, surface_width, surface_height, - &csc_render_surface, 1, + &csc_render_surface, 1, surface_attribs, 1); CHECK_VASTATUS(va_status,"vaCreateSurfaces"); @@ -328,7 +328,7 @@ static VASurfaceID get_next_free_surface(int *index) return surface_id[i]; } - + for (i=0; i<SURFACE_NUM; i++) { surface_status = (VASurfaceStatus)0; vaQuerySurfaceStatus(va_dpy, surface_id[i], &surface_status); @@ -356,11 +356,11 @@ static int upload_source_YUV_once_for_all() int box_width_loc=8; int row_shift_loc=0; int i; - + for (i=0; i<SURFACE_NUM; i++) { printf("\rLoading data into surface %d.....", i); upload_surface(va_dpy, surface_id[i], box_width_loc, row_shift_loc, 0); - + row_shift_loc++; if (row_shift_loc==(2*box_width_loc)) row_shift_loc= 0; } @@ -384,9 +384,9 @@ static void update_clipbox(VARectangle *cliprects, int width, int height) { if (test_clip == 0) return; - + srand((unsigned)time(NULL)); - + cliprects[0].x = (rand() % width); cliprects[0].y = (rand() % height); cliprects[0].width = (rand() % (width - cliprects[0].x)); @@ -412,16 +412,16 @@ static void* putsurface_thread(void *data) unsigned int frame_num=0, start_time, putsurface_time; VARectangle cliprects[2]; /* client supplied clip list */ int continue_display = 0; - + if (drawable == drawable_thread0) printf("Enter into thread0\n\n"); if (drawable == drawable_thread1) printf("Enter into thread1\n\n"); - + putsurface_time = 0; while (!quit) { VASurfaceID surface_id = VA_INVALID_SURFACE; - + while (surface_id == VA_INVALID_SURFACE) surface_id = get_next_free_surface(&index); @@ -432,9 +432,9 @@ static void* putsurface_thread(void *data) if (check_event) pthread_mutex_lock(&gmutex); - + start_time = get_tick_count(); - if ((continue_display == 0) && getenv("FRAME_STOP")) { + if ((continue_display == 0) && getenv("FRAME_STOP")) { char c; printf("Press any key to display frame %d...(c/C to continue)\n", frame_num); c = getchar(); @@ -447,13 +447,13 @@ static void* putsurface_thread(void *data) printf("do additional colorcoversion from %s to %s\n", map_vafourcc_to_str(csc_src_fourcc), map_vafourcc_to_str(csc_dst_fourcc)); } // get image from surface, csc_src_fourcc to csc_dst_fourcc conversion happens - vaStatus = vaGetImage(va_dpy, surface_id, 0, 0, + vaStatus = vaGetImage(va_dpy, surface_id, 0, 0, surface_width, surface_height, csc_dst_fourcc_image.image_id); CHECK_VASTATUS(vaStatus,"vaGetImage"); - + // render csc_dst_fourcc image to temp surface vaStatus = vaPutImage(va_dpy, csc_render_surface, csc_dst_fourcc_image.image_id, - 0, 0, surface_width, surface_height, + 0, 0, surface_width, surface_height, 0, 0, surface_width, surface_height); CHECK_VASTATUS(vaStatus,"vaPutImage"); @@ -475,20 +475,20 @@ static void* putsurface_thread(void *data) display_field); CHECK_VASTATUS(vaStatus,"vaPutSurface"); } - + putsurface_time += (get_tick_count() - start_time); - + if (check_event) pthread_mutex_unlock(&gmutex); - + pthread_mutex_unlock(&surface_mutex[index]); /* locked in get_next_free_surface */ - + if ((frame_num % 0xff) == 0) { fprintf(stderr, "%.2f FPS \r", 256000.0 / (float)putsurface_time); putsurface_time = 0; update_clipbox(cliprects, width, height); } - + if (check_event) check_window_event(win_display, drawable, &width, &height, &quit); @@ -496,7 +496,7 @@ static void* putsurface_thread(void *data) row_shift++; if (row_shift==(2*box_width)) row_shift= 0; } - + if (frame_rate != 0) /* rough framerate control */ usleep(1000/frame_rate*1000); @@ -504,10 +504,10 @@ static void* putsurface_thread(void *data) if (frame_num >= frame_num_total) quit = 1; } - - if (drawable == drawable_thread1) + + if (drawable == drawable_thread1) pthread_exit(NULL); - + return 0; } int main(int argc,char **argv) @@ -595,8 +595,8 @@ int main(int argc,char **argv) case '1': sscanf(optarg, "%s", str_src_fmt); csc_src_fourcc = map_str_to_vafourcc (str_src_fmt); - - if (!csc_src_fourcc) { + + if (!csc_src_fourcc) { printf("invalid fmt1: %s\n", str_src_fmt ); exit(0); } @@ -604,8 +604,8 @@ int main(int argc,char **argv) case '2': sscanf(optarg, "%s", str_dst_fmt); csc_dst_fourcc = map_str_to_vafourcc (str_dst_fmt); - - if (!csc_dst_fourcc) { + + if (!csc_dst_fourcc) { printf("invalid fmt1: %s\n", str_dst_fmt ); exit(0); } @@ -620,7 +620,7 @@ int main(int argc,char **argv) if (csc_src_fourcc && csc_dst_fourcc) { test_color_conversion = 1; } - + win_display = (void *)open_display(); if (win_display == NULL) { fprintf(stderr, "Can't open the connection of display!\n"); @@ -642,23 +642,23 @@ int main(int argc,char **argv) &surface_id[0], SURFACE_NUM, NULL, 0 ); - } + } CHECK_VASTATUS(va_status, "vaCreateSurfaces"); if (multi_thread == 0) /* upload the content for all surfaces */ upload_source_YUV_once_for_all(); - + if (check_event) pthread_mutex_init(&gmutex, NULL); - + for(i = 0; i< SURFACE_NUM; i++) pthread_mutex_init(&surface_mutex[i], NULL); - - if (multi_thread == 1) + + if (multi_thread == 1) ret = pthread_create(&thread1, NULL, putsurface_thread, (void*)drawable_thread1); putsurface_thread((void *)drawable_thread0); - if (multi_thread == 1) + if (multi_thread == 1) pthread_join(thread1, (void **)&ret); printf("thread1 is free\n"); @@ -666,7 +666,7 @@ int main(int argc,char **argv) // destroy temp surface/image va_status = vaDestroySurfaces(va_dpy, &csc_render_surface, 1); CHECK_VASTATUS(va_status,"vaDestroySurfaces"); - + va_status = vaDestroyImage(va_dpy, csc_dst_fourcc_image.image_id); CHECK_VASTATUS(va_status,"vaDestroyImage"); } @@ -676,12 +676,12 @@ int main(int argc,char **argv) vpp_config_id = VA_INVALID_ID; } - vaDestroySurfaces(va_dpy,&surface_id[0],SURFACE_NUM); + vaDestroySurfaces(va_dpy,&surface_id[0],SURFACE_NUM); vaTerminate(va_dpy); free(va_image_formats); free(va_surface_attribs); close_display(win_display); - + return 0; } diff --git a/va/Android.mk b/va/Android.mk index b10b643..eae7993 100755 --- a/va/Android.mk +++ b/va/Android.mk @@ -25,18 +25,11 @@ LOCAL_PATH:= $(call my-dir) -LIBVA_DRIVERS_PATH = /system/lib - -# Version set to Android Jelly Bean -ALOG_VERSION_REQ := 4.1 -ALOG_VERSION := $(filter $(ALOG_VERSION_REQ),$(firstword $(sort $(PLATFORM_VERSION) \ - $(ALOG_VERSION_REQ)))) +ifeq ($(ENABLE_IMG_GRAPHICS),true) +LIBVA_DRIVERS_PATH = /system/lib include $(CLEAR_VARS) -#LIBVA_MINOR_VERSION := 31 -#LIBVA_MAJOR_VERSION := 0 - LOCAL_SRC_FILES := \ va.c \ va_trace.c \ @@ -45,14 +38,8 @@ LOCAL_SRC_FILES := \ LOCAL_CFLAGS := \ -DANDROID \ -DVA_DRIVERS_PATH="\"$(LIBVA_DRIVERS_PATH)\"" \ - -DLOG_TAG=\"libva\" - -# Android Jelly Bean defined ALOGx, older versions use LOGx -ifeq ($(ALOG_VERSION), $(ALOG_VERSION_REQ)) -LOCAL_CFLAGS += -DANDROID_ALOG -else -LOCAL_CFLAGS += -DANDROID_LOG -endif + -DLOG_TAG=\"libva\" \ + -DANDROID_ALOG LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/.. @@ -79,7 +66,7 @@ LOCAL_COPY_HEADERS := \ va_enc_mpeg2.h \ LOCAL_COPY_HEADERS_TO := libva/va - +LOCAL_CFLAGS += -Werror LOCAL_MODULE_TAGS := optional LOCAL_MODULE := libva @@ -115,7 +102,7 @@ LOCAL_C_INCLUDES := \ LOCAL_COPY_HEADERS_TO := libva/va LOCAL_COPY_HEADERS := va_android.h - +LOCAL_CFLAGS += -Werror LOCAL_MODULE_TAGS := optional LOCAL_MODULE := libva-android @@ -142,7 +129,7 @@ LOCAL_C_INCLUDES := \ LOCAL_COPY_HEADERS_TO := libva/va LOCAL_COPY_HEADERS := egl/va_egl.h egl/va_backend_egl.h - +LOCAL_CFLAGS += -Werror LOCAL_MODULE_TAGS := optional LOCAL_MODULE := libva-egl @@ -171,8 +158,10 @@ LOCAL_COPY_HEADERS := \ va_backend_tpi.h LOCAL_SHARED_LIBRARIES := libva - +LOCAL_CFLAGS += -Werror LOCAL_MODULE_TAGS := optional LOCAL_MODULE := libva-tpi include $(BUILD_SHARED_LIBRARY) + +endif # $(ENABLE_IMG_GRAPHICS),true) @@ -249,7 +249,7 @@ static VAStatus va_openDriver(VADisplay dpy, char *driver_name) { VA_MAJOR_VERSION, VA_MINOR_VERSION }, { 0, 33 }, { 0, 32 }, - { -1, } + { -1, 0} }; for (i = 0; compatible_versions[i].major >= 0; i++) { @@ -1029,21 +1029,21 @@ VAStatus vaDestroyBuffer ( VAStatus vaBufferInfo ( VADisplay dpy, - VAContextID context, /* in */ + VAContextID __maybe_unused context, /* in */ VABufferID buf_id, /* in */ VABufferType *type, /* out */ unsigned int *size, /* out */ unsigned int *num_elements /* out */ ) { - VADriverContextP ctx; - - CHECK_DISPLAY(dpy); - ctx = CTX(dpy); + VADriverContextP ctx; - VA_FOOL_FUNC(va_FoolBufferInfo, dpy, buf_id, type, size, num_elements); - - return ctx->vtable->vaBufferInfo( ctx, buf_id, type, size, num_elements ); + CHECK_DISPLAY(dpy); + ctx = CTX(dpy); + + VA_FOOL_FUNC(va_FoolBufferInfo, dpy, buf_id, type, size, num_elements); + + return ctx->vtable->vaBufferInfo( ctx, buf_id, type, size, num_elements ); } VAStatus vaBeginPicture ( @@ -85,6 +85,12 @@ extern "C" { #endif +#ifdef __GNUC__ +# define __maybe_unused __attribute__((__unused__)) +#else +# define __maybe_unused +#endif + /** * \mainpage Video Acceleration (VA) API * @@ -2494,10 +2500,13 @@ typedef struct _VAParseSliceHeaderGroupBuffer unsigned char luma_log2_weight_denom; unsigned char chroma_log2_weight_denom; unsigned char cabac_init_idc; - unsigned char pic_order_cnt_lsb; + unsigned char reserved8bit; + + unsigned short pic_order_cnt_lsb; + unsigned short reserved16bit; - unsigned char pic_parameter_set_id; - unsigned short idr_pic_id; + unsigned short idr_pic_id; + unsigned char pic_parameter_set_id; unsigned char colour_plane_id; char slice_alpha_c0_offset_div2; diff --git a/va/va_android.h b/va/va_android.h index 0193fb0..978becd 100644 --- a/va/va_android.h +++ b/va/va_android.h @@ -48,7 +48,8 @@ VADisplay vaGetDisplay ( #ifdef __cplusplus #ifdef ANDROID -#include <gui/Surface.h> +#include <system/window.h> +#include <utils/StrongPointer.h> using namespace android; /* diff --git a/va/va_backend.h b/va/va_backend.h index 09f8245..61b9d3a 100755 --- a/va/va_backend.h +++ b/va/va_backend.h @@ -394,7 +394,7 @@ struct VADriverVTable /* DEPRECATED */ VAStatus (*vaGetSurfaceAttributes)( - VADriverContextP dpy, + VADriverContextP ctx, VAConfigID config, VASurfaceAttrib *attrib_list, unsigned int num_attribs diff --git a/va/va_backend_tpi.h b/va/va_backend_tpi.h index d79ae2a..6b1c85a 100644 --- a/va/va_backend_tpi.h +++ b/va/va_backend_tpi.h @@ -36,7 +36,7 @@ struct VADriverVTableTPI { VAStatus (*vaCreateSurfacesWithAttribute) ( - VADisplay dpy, + VADriverContextP ctx, int width, int height, int format, @@ -64,7 +64,7 @@ struct VADriverVTableTPI ); VAStatus (*vaSetTimestampForSurface)( - VADisplay dpy, + VADriverContextP ctx, VASurfaceID surface, long long timestamp ); diff --git a/va/va_fool.c b/va/va_fool.c index 9f7a045..1df177f 100644 --- a/va/va_fool.c +++ b/va/va_fool.c @@ -163,7 +163,7 @@ int va_FoolEnd(VADisplay dpy) free(fool_ctx); ((VADisplayContextP)dpy)->vafool = NULL; - + return 0; } @@ -171,15 +171,15 @@ int va_FoolCreateConfig( VADisplay dpy, VAProfile profile, VAEntrypoint entrypoint, - VAConfigAttrib *attrib_list, - int num_attribs, - VAConfigID *config_id /* out */ + VAConfigAttrib __maybe_unused *attrib_list, + int __maybe_unused num_attribs, + VAConfigID __maybe_unused *config_id /* out */ ) { DPY2FOOLCTX(dpy); fool_ctx->entrypoint = entrypoint; - + /* * check fool_codec to align with current context * e.g. fool_codec = decode then for encode, the @@ -208,18 +208,17 @@ int va_FoolCreateConfig( else va_infoMessage("FOOL is not enabled for this context\n"); - return 0; /* continue */ } VAStatus va_FoolCreateBuffer( VADisplay dpy, - VAContextID context, /* in */ + VAContextID __maybe_unused context, /* in */ VABufferType type, /* in */ unsigned int size, /* in */ unsigned int num_elements, /* in */ - void *data, /* in */ + void __maybe_unused *data, /* in */ VABufferID *buf_id /* out */ ) { diff --git a/va/va_trace.c b/va/va_trace.c index 0928f19..a70091e 100755 --- a/va/va_trace.c +++ b/va/va_trace.c @@ -368,11 +368,12 @@ void va_TraceSurface(VADisplay dpy) void va_TraceInitialize ( VADisplay dpy, - int *major_version, /* out */ - int *minor_version /* out */ + int __maybe_unused *major_version, /* out */ + int __maybe_unused *minor_version /* out */ ) { - DPY2TRACECTX(dpy); + DPY2TRACECTX(dpy); + TRACE_FUNCNAME(idx); } @@ -391,7 +392,7 @@ void va_TraceCreateConfig( VAEntrypoint entrypoint, VAConfigAttrib *attrib_list, int num_attribs, - VAConfigID *config_id /* out */ + VAConfigID __maybe_unused *config_id /* out */ ) { int i; @@ -399,7 +400,7 @@ void va_TraceCreateConfig( DPY2TRACECTX(dpy); TRACE_FUNCNAME(idx); - + va_TraceMsg(trace_ctx, "\tprofile = %d\n", profile); va_TraceMsg(trace_ctx, "\tentrypoint = %d\n", entrypoint); va_TraceMsg(trace_ctx, "\tnum_attribs = %d\n", num_attribs); @@ -485,7 +486,7 @@ static void va_TraceSurfaceAttributes( va_TraceMsg(trace_ctx, "\t\tvalue.value.p = %p\n", p->value.value.p); if ((p->type == VASurfaceAttribExternalBufferDescriptor) && p->value.value.p) { VASurfaceAttribExternalBuffers *tmp = (VASurfaceAttribExternalBuffers *) p->value.value.p; - int j; + unsigned int j; va_TraceMsg(trace_ctx, "\t\t--VASurfaceAttribExternalBufferDescriptor\n"); va_TraceMsg(trace_ctx, "\t\t pixel_format=0x%08x\n", tmp->pixel_format); @@ -646,11 +647,11 @@ static char * buffer_type_to_string(int type) void va_TraceCreateBuffer ( VADisplay dpy, - VAContextID context, /* in */ + VAContextID __maybe_unused context, /* in */ VABufferType type, /* in */ unsigned int size, /* in */ unsigned int num_elements, /* in */ - void *data, /* in */ + void __maybe_unused *data, /* in */ VABufferID *buf_id /* out */ ) { @@ -762,7 +763,9 @@ static void va_TraceVABuffers( unsigned int dump_size = 64; DPY2TRACECTX(dpy); - + + va_TraceMsg(trace_ctx, "\t context = %d, buffer = %d, type = %d, size = %d, num_elements = %d\n", + context, buffer, type, size, num_elements); va_TraceMsg(trace_ctx, "--%s\n", buffer_type_to_string(type)); if (dump_size>size) @@ -793,18 +796,17 @@ static void va_TraceVABuffers( static void va_TraceVAPictureParameterBufferMPEG2( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { VAPictureParameterBufferMPEG2 *p=(VAPictureParameterBufferMPEG2 *)data; DPY2TRACECTX(dpy); va_TraceMsg(trace_ctx,"VAPictureParameterBufferMPEG2\n"); - va_TraceMsg(trace_ctx,"\thorizontal size= %d\n", p->horizontal_size); va_TraceMsg(trace_ctx,"\tvertical size= %d\n", p->vertical_size); va_TraceMsg(trace_ctx,"\tforward reference picture= %d\n", p->forward_reference_picture); @@ -832,18 +834,17 @@ static void va_TraceVAPictureParameterBufferMPEG2( static void va_TraceVAIQMatrixBufferMPEG2( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { VAIQMatrixBufferMPEG2 *p=(VAIQMatrixBufferMPEG2 *)data; DPY2TRACECTX(dpy); va_TraceMsg(trace_ctx,"VAIQMatrixBufferMPEG2\n"); - va_TraceMsg(trace_ctx,"\tload_intra_quantiser_matrix = %d\n", p->load_intra_quantiser_matrix); va_TraceMsg(trace_ctx,"\tload_non_intra_quantiser_matrix = %d\n", p->load_non_intra_quantiser_matrix); va_TraceMsg(trace_ctx,"\tload_chroma_intra_quantiser_matrix = %d\n", p->load_chroma_intra_quantiser_matrix); @@ -860,11 +861,11 @@ static void va_TraceVAIQMatrixBufferMPEG2( static void va_TraceVASliceParameterBufferMPEG2( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { VASliceParameterBufferMPEG2 *p=(VASliceParameterBufferMPEG2 *)data; @@ -876,7 +877,6 @@ static void va_TraceVASliceParameterBufferMPEG2( trace_ctx->trace_slice_size = p->slice_data_size; va_TraceMsg(trace_ctx,"VASliceParameterBufferMPEG2\n"); - va_TraceMsg(trace_ctx,"\tslice_data_size = %d\n", p->slice_data_size); va_TraceMsg(trace_ctx,"\tslice_data_offset = %d\n", p->slice_data_offset); va_TraceMsg(trace_ctx,"\tslice_data_flag = %d\n", p->slice_data_flag); @@ -892,11 +892,11 @@ static void va_TraceVASliceParameterBufferMPEG2( static void va_TraceVAPictureParameterBufferJPEG( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { int i; @@ -917,17 +917,18 @@ static void va_TraceVAPictureParameterBufferJPEG( static void va_TraceVAIQMatrixBufferJPEG( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { int i, j; static char tmp[1024]; VAIQMatrixBufferJPEGBaseline *p=(VAIQMatrixBufferJPEGBaseline *)data; DPY2TRACECTX(dpy); + va_TraceMsg(trace_ctx,"*VAIQMatrixParameterBufferJPEG\n"); va_TraceMsg(trace_ctx,"\tload_quantiser_table =\n"); for (i = 0; i < 4; ++i) { @@ -945,16 +946,17 @@ static void va_TraceVAIQMatrixBufferJPEG( static void va_TraceVASliceParameterBufferJPEG( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { int i; VASliceParameterBufferJPEGBaseline *p=(VASliceParameterBufferJPEGBaseline *)data; DPY2TRACECTX(dpy); + va_TraceMsg(trace_ctx,"*VASliceParameterBufferJPEG\n"); va_TraceMsg(trace_ctx,"\tslice_data_size = %u\n", p->slice_data_size); va_TraceMsg(trace_ctx,"\tslice_data_offset = %u\n", p->slice_data_offset); @@ -973,11 +975,11 @@ static void va_TraceVASliceParameterBufferJPEG( static void va_TraceVAHuffmanTableBufferJPEG( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { int i, j; @@ -1019,11 +1021,11 @@ static void va_TraceVAHuffmanTableBufferJPEG( static void va_TraceVAPictureParameterBufferMPEG4( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { int i; @@ -1079,11 +1081,11 @@ static void va_TraceVAPictureParameterBufferMPEG4( static void va_TraceVAIQMatrixBufferMPEG4( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { int i; @@ -1108,18 +1110,17 @@ static void va_TraceVAIQMatrixBufferMPEG4( static void va_TraceVAEncSequenceParameterBufferMPEG4( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { VAEncSequenceParameterBufferMPEG4 *p = (VAEncSequenceParameterBufferMPEG4 *)data; DPY2TRACECTX(dpy); - + va_TraceMsg(trace_ctx, "\t--VAEncSequenceParameterBufferMPEG4\n"); - va_TraceMsg(trace_ctx, "\tprofile_and_level_indication = %d\n", p->profile_and_level_indication); va_TraceMsg(trace_ctx, "\tintra_period = %d\n", p->intra_period); va_TraceMsg(trace_ctx, "\tvideo_object_layer_width = %d\n", p->video_object_layer_width); @@ -1138,16 +1139,16 @@ static void va_TraceVAEncSequenceParameterBufferMPEG4( static void va_TraceVAEncPictureParameterBufferMPEG4( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { VAEncPictureParameterBufferMPEG4 *p = (VAEncPictureParameterBufferMPEG4 *)data; DPY2TRACECTX(dpy); - + va_TraceMsg(trace_ctx, "\t--VAEncPictureParameterBufferMPEG4\n"); va_TraceMsg(trace_ctx, "\treference_picture = 0x%08x\n", p->reference_picture); va_TraceMsg(trace_ctx, "\treconstructed_picture = 0x%08x\n", p->reconstructed_picture); @@ -1165,11 +1166,11 @@ static void va_TraceVAEncPictureParameterBufferMPEG4( static void va_TraceVASliceParameterBufferMPEG4( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { VASliceParameterBufferMPEG4 *p=(VASliceParameterBufferMPEG4 *)data; @@ -1208,11 +1209,11 @@ static inline void va_TraceFlagIfNotZero( static void va_TraceVAPictureParameterBufferH264( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { int i; @@ -1275,7 +1276,7 @@ static void va_TraceVAPictureParameterBufferH264( va_TraceMsg(trace_ctx, "\tframe_num = %d\n", p->frame_num); va_TraceMsg(trace_ctx, "\tnum_ref_idx_l0_default_active_minus1 = %d\n", p->num_ref_idx_l0_default_active_minus1); va_TraceMsg(trace_ctx, "\tnum_ref_idx_l1_default_active_minus1 = %d\n", p->num_ref_idx_l1_default_active_minus1); - + va_TraceMsg(trace_ctx, NULL); return; @@ -1283,11 +1284,11 @@ static void va_TraceVAPictureParameterBufferH264( static void va_TraceVASliceParameterBufferH264( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { int i; @@ -1376,11 +1377,11 @@ static void va_TraceVASliceParameterBufferH264( static void va_TraceVAIQMatrixBufferH264( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data ) { @@ -1420,11 +1421,11 @@ static void va_TraceVAIQMatrixBufferH264( static void va_TraceVAEncSequenceParameterBufferH264( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { VAEncSequenceParameterBufferH264 *p = (VAEncSequenceParameterBufferH264 *)data; @@ -1483,11 +1484,11 @@ static void va_TraceVAEncSequenceParameterBufferH264( static void va_TraceVAEncPictureParameterBufferH264( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { VAEncPictureParameterBufferH264 *p = (VAEncPictureParameterBufferH264 *)data; @@ -1546,16 +1547,16 @@ static void va_TraceVAEncPictureParameterBufferH264( static void va_TraceVAEncSliceParameterBuffer( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { VAEncSliceParameterBuffer* p = (VAEncSliceParameterBuffer*)data; DPY2TRACECTX(dpy); - + va_TraceMsg(trace_ctx, "\t--VAEncSliceParameterBuffer\n"); va_TraceMsg(trace_ctx, "\tstart_row_number = %d\n", p->start_row_number); @@ -1571,11 +1572,11 @@ static void va_TraceVAEncSliceParameterBuffer( static void va_TraceVAEncSliceParameterBufferH264( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { VAEncSliceParameterBufferH264* p = (VAEncSliceParameterBufferH264*)data; @@ -1689,11 +1690,11 @@ static void va_TraceVAEncSliceParameterBufferH264( static void va_TraceVAEncPackedHeaderParameterBufferType( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { VAEncPackedHeaderParameterBuffer* p = (VAEncPackedHeaderParameterBuffer*)data; @@ -1817,9 +1818,10 @@ static void va_TraceVAPictureParameterBufferVC1( { VAPictureParameterBufferVC1* p = (VAPictureParameterBufferVC1*)data; DPY2TRACECTX(dpy); - + va_TraceMsg(trace_ctx, "\t--VAPictureParameterBufferVC1\n"); - + va_TraceMsg(trace_ctx, "\t context = %d, buffer = %d, type = %d, size = %d, num_elements = %d\n", + context, buffer, type, size, num_elements); va_TraceMsg(trace_ctx, "\tforward_reference_picture = 0x%08x\n", p->forward_reference_picture); va_TraceMsg(trace_ctx, "\tbackward_reference_picture = 0x%08x\n", p->backward_reference_picture); va_TraceMsg(trace_ctx, "\tinloop_decoded_picture = 0x%08x\n", p->inloop_decoded_picture); @@ -1912,11 +1914,11 @@ static void va_TraceVAPictureParameterBufferVC1( static void va_TraceVASliceParameterBufferVC1( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void* data ) { @@ -1937,11 +1939,11 @@ static void va_TraceVASliceParameterBufferVC1( static void va_TraceVAEncSequenceParameterBufferVP8( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { VAEncSequenceParameterBufferVP8 *p = (VAEncSequenceParameterBufferVP8 *)data; @@ -1971,11 +1973,11 @@ static void va_TraceVAEncSequenceParameterBufferVP8( static void va_TraceVAEncPictureParameterBufferVP8( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused uffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { VAEncPictureParameterBufferVP8 *p = (VAEncPictureParameterBufferVP8 *)data; @@ -2041,11 +2043,11 @@ static void va_TraceVAEncPictureParameterBufferVP8( static void va_TraceVAPictureParameterBufferVP8( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { char tmp[1024]; @@ -2117,11 +2119,11 @@ static void va_TraceVAPictureParameterBufferVP8( static void va_TraceVASliceParameterBufferVP8( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { VASliceParameterBufferVP8 *p = (VASliceParameterBufferVP8 *)data; @@ -2146,11 +2148,11 @@ static void va_TraceVASliceParameterBufferVP8( static void va_TraceVAIQMatrixBufferVP8( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { char tmp[1024]; @@ -2174,11 +2176,11 @@ static void va_TraceVAIQMatrixBufferVP8( } static void va_TraceVAProbabilityBufferVP8( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { char tmp[1024]; @@ -2204,7 +2206,7 @@ static void va_TraceVAProbabilityBufferVP8( void va_TraceBeginPicture( VADisplay dpy, - VAContextID context, + VAContextID __maybe_unused context, VASurfaceID render_target ) { @@ -2212,7 +2214,6 @@ void va_TraceBeginPicture( TRACE_FUNCNAME(idx); - va_TraceMsg(trace_ctx, "\tcontext = 0x%08x\n", context); va_TraceMsg(trace_ctx, "\trender_targets = 0x%08x\n", render_target); va_TraceMsg(trace_ctx, "\tframe_count = #%d\n", trace_ctx->trace_frame_no); va_TraceMsg(trace_ctx, NULL); @@ -2281,11 +2282,11 @@ static void va_TraceMPEG2Buf( static void va_TraceVAEncSequenceParameterBufferH263( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { VAEncSequenceParameterBufferH263 *p = (VAEncSequenceParameterBufferH263 *)data; @@ -2306,16 +2307,16 @@ static void va_TraceVAEncSequenceParameterBufferH263( static void va_TraceVAEncPictureParameterBufferH263( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { VAEncPictureParameterBufferH263 *p = (VAEncPictureParameterBufferH263 *)data; DPY2TRACECTX(dpy); - + va_TraceMsg(trace_ctx, "\t--VAEncPictureParameterBufferH263\n"); va_TraceMsg(trace_ctx, "\treference_picture = 0x%08x\n", p->reference_picture); va_TraceMsg(trace_ctx, "\treconstructed_picture = 0x%08x\n", p->reconstructed_picture); @@ -2330,16 +2331,16 @@ static void va_TraceVAEncPictureParameterBufferH263( static void va_TraceVAEncPictureParameterBufferJPEG( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { VAEncPictureParameterBufferJPEG *p = (VAEncPictureParameterBufferJPEG *)data; int i; - + DPY2TRACECTX(dpy); va_TraceMsg(trace_ctx, "\t--VAEncPictureParameterBufferJPEG\n"); @@ -2374,16 +2375,16 @@ static void va_TraceVAEncPictureParameterBufferJPEG( static void va_TraceVAEncQMatrixBufferJPEG( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { VAQMatrixBufferJPEG *p = (VAQMatrixBufferJPEG *)data; DPY2TRACECTX(dpy); - + va_TraceMsg(trace_ctx, "\t--VAQMatrixBufferJPEG\n"); va_TraceMsg(trace_ctx, "\tload_lum_quantiser_matrix = %d\n", p->load_lum_quantiser_matrix); if (p->load_lum_quantiser_matrix) { @@ -2427,16 +2428,16 @@ static void va_TraceVAEncQMatrixBufferJPEG( static void va_TraceVAEncSliceParameterBufferJPEG( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data) { VAEncSliceParameterBufferJPEG *p = (VAEncSliceParameterBufferJPEG *)data; int i; - + DPY2TRACECTX(dpy); va_TraceMsg(trace_ctx, "\t--VAEncSliceParameterBufferJPEG\n"); @@ -2457,14 +2458,16 @@ static void va_TraceVAEncSliceParameterBufferJPEG( static void va_TraceH263Buf( VADisplay dpy, - VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VAContextID __maybe_unused context, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *pbuf ) { + DPY2TRACECTX(dpy); + switch (type) { case VAPictureParameterBufferType:/* print MPEG4 buffer */ va_TraceVAPictureParameterBufferMPEG4(dpy, context, buffer, type, size, num_elements, pbuf); @@ -2828,7 +2831,7 @@ static void va_TraceVC1Buf( static void va_TraceProcFilterParameterBufferDeinterlacing( VADisplay dpy, - VAContextID context, + VAContextID __maybe_unused context, VAProcFilterParameterBufferBase *base ) { @@ -2844,7 +2847,7 @@ va_TraceProcFilterParameterBufferDeinterlacing( static void va_TraceProcFilterParameterBufferColorBalance( VADisplay dpy, - VAContextID context, + VAContextID __maybe_unused context, VAProcFilterParameterBufferBase *base ) { @@ -2866,7 +2869,7 @@ va_TraceProcFilterParameterBufferBase( { DPY2TRACECTX(dpy); - va_TraceMsg(trace_ctx, "\t type = %d\n", base->type); + va_TraceMsg(trace_ctx, "\t type = %d, context = %d\n", base->type, context); } static void @@ -2881,7 +2884,7 @@ va_TraceProcFilterParameterBuffer( unsigned int size; unsigned int num_elements; VAProcFilterParameterBufferBase *base_filter = NULL; - int i; + unsigned int i; DPY2TRACECTX(dpy); @@ -2938,15 +2941,15 @@ static void va_TraceVAProcPipelineParameterBuffer( VADisplay dpy, VAContextID context, - VABufferID buffer, - VABufferType type, - unsigned int size, - unsigned int num_elements, + VABufferID __maybe_unused buffer, + VABufferType __maybe_unused type, + unsigned int __maybe_unused size, + unsigned int __maybe_unused num_elements, void *data ) { VAProcPipelineParameterBuffer *p = (VAProcPipelineParameterBuffer *)data; - int i; + unsigned int i; DPY2TRACECTX(dpy); @@ -3047,7 +3050,7 @@ va_TraceNoneBuf( void va_TraceRenderPicture( VADisplay dpy, - VAContextID context, + VAContextID __maybe_unused context, VABufferID *buffers, int num_buffers ) @@ -3060,7 +3063,6 @@ void va_TraceRenderPicture( TRACE_FUNCNAME(idx); - va_TraceMsg(trace_ctx, "\tcontext = 0x%08x\n", context); va_TraceMsg(trace_ctx, "\tnum_buffers = %d\n", num_buffers); if (buffers == NULL) return; @@ -3157,8 +3159,8 @@ void va_TraceRenderPicture( void va_TraceEndPicture( VADisplay dpy, - VAContextID context, - int endpic_done + VAContextID __maybe_unused context, + int __maybe_unused endpic_done ) { int encode, decode, jpeg; @@ -3166,7 +3168,6 @@ void va_TraceEndPicture( TRACE_FUNCNAME(idx); - va_TraceMsg(trace_ctx, "\tcontext = 0x%08x\n", context); va_TraceMsg(trace_ctx, "\trender_targets = 0x%08x\n", trace_ctx->trace_rendertarget); /* avoid to create so many empty files */ @@ -3191,20 +3192,19 @@ void va_TraceEndPicture( void va_TraceSyncSurface( VADisplay dpy, - VASurfaceID render_target + VASurfaceID __maybe_unused render_target ) { DPY2TRACECTX(dpy); TRACE_FUNCNAME(idx); - va_TraceMsg(trace_ctx, "\trender_target = 0x%08x\n", render_target); va_TraceMsg(trace_ctx, NULL); } void va_TraceQuerySurfaceAttributes( VADisplay dpy, - VAConfigID config, + VAConfigID __maybe_unused config, VASurfaceAttrib *attrib_list, unsigned int *num_attribs ) @@ -3212,7 +3212,6 @@ void va_TraceQuerySurfaceAttributes( DPY2TRACECTX(dpy); TRACE_FUNCNAME(idx); - va_TraceMsg(trace_ctx, "\tconfig = 0x%08x\n", config); va_TraceSurfaceAttributes(trace_ctx, attrib_list, num_attribs); va_TraceMsg(trace_ctx, NULL); @@ -3222,7 +3221,7 @@ void va_TraceQuerySurfaceAttributes( void va_TraceQuerySurfaceStatus( VADisplay dpy, - VASurfaceID render_target, + VASurfaceID __maybe_unused render_target, VASurfaceStatus *status /* out */ ) { @@ -3230,7 +3229,6 @@ void va_TraceQuerySurfaceStatus( TRACE_FUNCNAME(idx); - va_TraceMsg(trace_ctx, "\trender_target = 0x%08x\n", render_target); if (status) va_TraceMsg(trace_ctx, "\tstatus = 0x%08x\n", *status); va_TraceMsg(trace_ctx, NULL); @@ -3304,14 +3302,13 @@ void va_TraceQueryDisplayAttributes ( static void va_TraceDisplayAttributes ( VADisplay dpy, VADisplayAttribute *attr_list, - int num_attributes + int __maybe_unused num_attributes ) { int i; DPY2TRACECTX(dpy); - va_TraceMsg(trace_ctx, "\tnum_attributes = %d\n", num_attributes); if (attr_list == NULL) return; |