2. add interface VARenderMode for APP to swith between overlay and GPU post-processing
3. add VADisplayAttribOverlayColorKey/VADisplayAttribOverlayAutoPaintColorKey which is simliar to Xv for overlay post-processing
4. fix the build issue on Android 2.3
Signed-off-by: Austin Yuan <shengquan.yuan@gmail.com>
Signed-off-by: Jason Hu <jason.hu@intel.com>
Signed-off-by: Zhaohan Ren <zhaohan.ren@intel.com>
} else {
obj_buffer->num_elements = num_elements;
if (obj_buffer->buffer_store != NULL) {
- obj_buffer->buffer_store->num_elements = num_elements;
+ obj_buffer->buffer_store->num_elements = num_elements;
}
}
%{_libdir}/libva-x11.so.%{libversion}
%{_libdir}/libva-glx.so.1
%{_libdir}/libva-glx.so.%{libversion}
+%{_libdir}/libva-egl.so.1
+%{_libdir}/libva-egl.so.%{libversion}
%{_bindir}/vainfo
%{_bindir}/test_*
%{_bindir}/h264encode
%{_libdir}/libva-tpi.so
%{_libdir}/libva-x11.so
%{_libdir}/libva-glx.so
+%{_libdir}/libva-egl.so
%{_libdir}/pkgconfig/libva.pc
%{_libdir}/pkgconfig/libva-tpi.pc
%{_libdir}/pkgconfig/libva-x11.pc
%{_libdir}/pkgconfig/libva-glx.pc
+%{_libdir}/pkgconfig/libva-egl.pc
%changelog
* Tue Jan 25 2011 Austin Yuan <shengquan.yuan@intel.com> 1.0.1
--- /dev/null
+#!/bin/bash
+file=$(find . -name "*.[ch]" -o -name "*.cpp")
+for i in $file
+do
+ echo $i
+ astyle --style=linux -s4 -c -s -p -U -H -n $i
+done
+
+
+
LOCAL_C_INCLUDES += \
$(TARGET_OUT_HEADERS)/libva
+LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := putsurface
LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils libutils libui libsurfaceflinger_client
vaMapBuffer(va_dpy,surface_image.buf,&surface_p);
assert(VA_STATUS_SUCCESS == va_status);
- U_start = surface_p + surface_image.offsets[1];
- V_start = surface_p + surface_image.offsets[2];
+ U_start = (char *)surface_p + surface_image.offsets[1];
+ V_start = (char *)surface_p + surface_image.offsets[2];
/* assume surface is planar format */
yuvgen_planar(surface_image.width, surface_image.height,
LOCAL_C_INCLUDES += \
$(TARGET_OUT_HEADERS)/libva
+LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := vainfo
LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils
va.c \
va_trace.c \
va_fool.c \
- va_fool_getframe.c
+ va_fool_getframe.c
LOCAL_CFLAGS += \
-DANDROID \
LOCAL_COPY_HEADERS_TO := libva/va
+LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := libva
LOCAL_SHARED_LIBRARIES := libdl libdrm libcutils
LOCAL_COPY_HEADERS := va_android.h
+LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := libva-android
LOCAL_SHARED_LIBRARIES := libva
include $(BUILD_SHARED_LIBRARY)
+# For libva-egl
+# =====================================================
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ egl/va_egl.c
+
+LOCAL_CFLAGS += \
+ -DANDROID
+
+LOCAL_C_INCLUDES += \
+ $(TARGET_OUT_HEADERS)/libva \
+ $(LOCAL_PATH)/x11
+
+LOCAL_COPY_HEADERS_TO := libva/va
+
+LOCAL_COPY_HEADERS := egl/va_egl.h egl/va_backend_egl.h
+
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE := libva-egl
+
+LOCAL_SHARED_LIBRARIES := libva
+
+include $(BUILD_SHARED_LIBRARY)
+
+
# For libva-tpi
# =====================================================
LOCAL_SHARED_LIBRARIES := libva
+LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := libva-tpi
include $(BUILD_SHARED_LIBRARY)
SUBDIRS = $(libva_x11_backenddir) $(libva_dummy_backenddir) $(libva_glx_backenddir) $(libva_egl_backenddir)
libvaincludedir = ${includedir}/va
-libvainclude_HEADERS = va.h va_tpi.h va_x11.h va_backend.h va_dummy.h va_version.h va_backend_tpi.h
+libvainclude_HEADERS = va.h va_tpi.h va_x11.h va_backend.h va_dummy.h va_version.h va_backend_tpi.h
DISTCLEANFILES = \
va_version.h
# secret laws and treaty provisions. No part of the Material may be used,
# copied, reproduced, modified, published, uploaded, posted, transmitted,
# distributed, or disclosed in any way without Intel's prior express written
-# permission.
-#
+# permission.
+#
# No license under any patent, copyright, trade secret or other intellectual
# property right is granted to or conferred upon you by disclosure or delivery
# of the Materials, either expressly, by implication, inducement, estoppel or
destx, desty, destw, desth,
cliprects, number_cliprects, flags );
- return ctx->vtable.vaPutSurface( ctx, surface, static_cast<void*>(&draw), srcx, srcy, srcw, srch,
+ return ctx->vtable->vaPutSurface( ctx, surface, static_cast<void*>(&draw), srcx, srcy, srcw, srch,
destx, desty, destw, desth,
cliprects, number_cliprects, flags );
}
#include "va_backend.h"
#include "va_trace.h"
#include "va_fool.h"
+#include "config.h"
#include <assert.h>
#include <stdarg.h>
}
search_path = strdup((const char *)search_path);
- driver_dir = strtok_r((const char *)search_path, ":", &saveptr);
+ gdriver_dir = strtok_r((const char *)search_path, ":", &saveptr);
while(driver_dir)
{
void *handle = NULL;
if (driver_name)
free(driver_name);
+
+ VA_TRACE(va_Initialize, dpy, major_version, minor_version);
+
return vaStatus;
}
if (VA_STATUS_SUCCESS == vaStatus)
pDisplayContext->vaDestroy(pDisplayContext);
+ VA_TRACE(va_Terminate, dpy);
+
va_TraceEnd(dpy);
va_FoolEnd(dpy);
ctx = CTX(dpy);
VA_FOOL(va_FoolCreateConfig, dpy, profile, entrypoint, attrib_list, num_attribs, config_id);
-
+
vaStatus = ctx->vtable->vaCreateConfig ( ctx, profile, entrypoint, attrib_list, num_attribs, config_id );
VA_TRACE(va_TraceCreateConfig, dpy, profile, entrypoint, attrib_list, num_attribs, config_id);
VADriverContextP ctx;
VAStatus vaStatus;
int ret = 0;
-
+
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
int ret = 0;
-
+
VA_FOOL(va_FoolCreateBuffer, dpy, context, type, size, num_elements, data, buf_id);
if (ret)
return VA_STATUS_SUCCESS;
-
+
return ctx->vtable->vaCreateBuffer( ctx, context, type, size, num_elements, data, buf_id);
}
VA_FOOL(va_FoolMapBuffer, dpy, buf_id, pbuf);
if (ret)
return VA_STATUS_SUCCESS;
-
+
va_status = ctx->vtable->vaMapBuffer( ctx, buf_id, pbuf );
if (va_status == VA_STATUS_SUCCESS)
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
int ret = 0;
-
+
VA_FOOL(va_FoolUnmapBuffer, dpy, buf_id);
if (ret)
return VA_STATUS_SUCCESS;
-
+
return ctx->vtable->vaUnmapBuffer( ctx, buf_id );
}
{
VADriverContextP ctx;
int ret = 0;
-
+
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
{
VADriverContextP ctx;
int ret = 0;
-
+
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
VAStatus va_status;
VADriverContextP ctx;
int ret = 0;
-
+
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
VAStatus va_status;
VADriverContextP ctx;
int ret = 0;
-
+
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
{
VADriverContextP ctx;
int ret = 0;
-
+
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
-
+
VA_FOOL(va_FoolQuerySubpictureFormats, dpy, format_list, flags, num_formats);
if (ret)
return VA_STATUS_SUCCESS;
-
+
return ctx->vtable->vaQuerySubpictureFormats ( ctx, format_list, flags, num_formats);
}
* rev 0.31.2 (01/13/2011 Anthony Pabon)- Added a flag to indicate Subpicture coordinates are screen
* screen relative rather than source video relative.
* rev 0.32.0 (01/13/2011 Xiang Haihao) - Add profile into VAPictureParameterBufferVC1
- * update VAAPI to 0.32.0
+ * update VAAPI to 0.32.0
*
* Acknowledgements:
* Some concepts borrowed from XvMC and XvImage.
* SLICE_OVERFLOW(bit9): At least one slice in the current frame has
* exceeded the maximum slice size specified.
* BITRATE_OVERFLOW(bit10): The peak bitrate was exceeded for this frame.
+ * BITRATE_HIGH(bit11): The frame size got within the safety margin of the maximum size (VCM only)
* AIR_MB_OVER_THRESHOLD: the number of MBs adapted to Intra MB
*/
#define VA_CODED_BUF_STATUS_PICTURE_AVE_QP_MASK 0xff
#define VA_CODED_BUF_STATUS_LARGE_SLICE_MASK 0x100
#define VA_CODED_BUF_STATUS_SLICE_OVERFLOW_MASK 0x200
#define VA_CODED_BUF_STATUS_BITRATE_OVERFLOW 0x400
+#define VA_CODED_BUF_STATUS_BITRATE_HIGH 0x800
#define VA_CODED_BUF_STATUS_AIR_MB_OVER_THRESHOLD 0xff0000
/*
VASurfaceStatus *status /* out */
);
+typedef enum
+{
+ VA_DECODE_SLICE_MISSING = 0,
+ VA_DECODE_MB_ERROR = 1,
+} VA_DECODE_ERROR_TYPE;
+
/*
* Client calls vaQuerySurfaceError with VA_STATUS_ERROR_DECODING_ERROR, server side returns
* an array of structure VASurfaceDecodeMBErrors, and the array is terminated by setting status=-1
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 */
+ VA_DECODE_ERROR_TYPE decode_error_type;
} VASurfaceDecodeMBErrors;
/*
#define VA_OOL_DEBLOCKING_FALSE 0x00000000
#define VA_OOL_DEBLOCKING_TRUE 0x00000001
+/* Render mode */
+typedef enum
+{
+ VARenderModeUndefined = 0,
+ VARenderModeLocalOverlay = 1,
+ VARenderModeLocalGPU = 2,
+ VARenderModeExternalOverlay = 4,
+ VARenderModeExternalGPU = 8
+} VARenderMode;
+
+/* Render device */
+typedef enum
+{
+ VARenderDeviceUndefined = 0,
+ VARenderDeviceLocal = 1,
+ VARenderDeviceExternal = 2
+} VARenderDevice;
/* Currently defined display attribute types */
typedef enum
/* client can specifiy a background color for the target window
* the new feature of video conference,
* the uncovered area of the surface is filled by this color
- * also it will blend with the decoded video color*/
+ * also it will blend with the decoded video color
+ */
VADisplayAttribBackgroundColor = 4,
/*
* this is a gettable only attribute. For some implementations that use the
* b: background color of the drawable
*/
VADisplayAttribBlendColor = 13,
+ /*
+ * Indicate driver to skip painting color key or not.
+ * only applicable if the render is overlay
+ */
+ VADisplayAttribOverlayAutoPaintColorKey = 14,
+ /*
+ * customized overlay color key, the format is RGB888
+ * [23:16] = Red, [15:08] = Green, [07:00] = Blue.
+ */
+ VADisplayAttribOverlayColorKey = 15,
+ /*
+ * The hint for the implementation of vaPutSurface
+ * normally, the driver could use an overlay or GPU to render the surface on the screen
+ * this flag provides APP the flexibity to switch the render dynamically
+ */
+ VADisplayAttribRenderMode = 16,
+ /*
+ * specify if vaPutSurface needs to render into specified monitors
+ * one example is that one external monitor (e.g. HDMI) is enabled,
+ * but the window manager is not aware of it, and there is no associated drawable
+ */
+ VADisplayAttribRenderDevice = 17,
+ /*
+ * specify vaPutSurface render area if there is no drawable on the monitor
+ */
+ VADisplayAttribRenderRect = 18,
} VADisplayAttribType;
/* flags for VADisplayAttribute */
* private API. The driver implementation is responsible for the
* allocation and deallocation of this structure.
*/
- void *vtable_tpi;
+ void *vtable_tpi;
void *native_dpy;
int x11_screen;
void *dri_state;
void *glx; /* opaque for GLX code */
-
+
unsigned long reserved[45]; /* reserve for future add-ins, decrease the subscript accordingly */
};
);
VAStatus (*vaCreateSurfacesForUserPtr)(
- VADisplay dpy,
+ VADriverContextP ctx,
int width,
int height,
int format,
VAStatus (*vaPutSurfaceBuf) (
- VADisplay dpy,
+ VADriverContextP ctx,
VASurfaceID surface,
unsigned char* data,
int* data_len,
unsigned int *chroma_u_offset,
unsigned int *chroma_v_offset,
unsigned int *buffer_name,
- void **buffer
+ void **buffer
);
VAStatus vaUnlockSurface(VADisplay dpy,
/* fill garbage data into the other field */
if (((field == VA_TOP_FIELD) && (row &1))
- || ((field == VA_BOTTOM_FIELD) && ((row &1)==0))) {
+ || ((field == VA_BOTTOM_FIELD) && ((row &1)==0))) {
memset(Y_row, 0xff, width);
continue;
}
if (FOOL_ENCODE(idx) || FOOL_DECODE(idx))
return 1; /* fool buffer creation */
-
+
return 0;
}
va_TraceMsg(idx, "\tchecksum = 0x%02x\n", check_sum & 0xff);
}
+
+VAStatus va_TraceInitialize (
+ VADisplay dpy,
+ int *major_version, /* out */
+ int *minor_version /* out */
+)
+{
+ int i;
+ DPY2INDEX(dpy);
+
+ TRACE_FUNCNAME(idx);
+}
+
+VAStatus va_TraceTerminate (
+ VADisplay dpy
+)
+{
+ int i;
+ DPY2INDEX(dpy);
+
+ TRACE_FUNCNAME(idx);
+}
+
+
void va_TraceCreateConfig(
VADisplay dpy,
VAProfile profile,
DPY2INDEX(dpy);
TRACE_FUNCNAME(idx);
-
+
va_TraceMsg(idx, "\tcontext = 0x%08x\n", context);
va_TraceMsg(idx, "\trender_targets = 0x%08x\n", render_target);
+ va_TraceMsg(idx, "\tframe_count = #%d\n", trace_context[idx].trace_frame_no);
trace_context[idx].trace_rendertarget = render_target; /* for surface data dump after vaEndPicture */
void va_TraceMsg(int idx, const char *msg, ...);
+VAStatus va_TraceInitialize (
+ VADisplay dpy,
+ int *major_version, /* out */
+ int *minor_version /* out */
+);
+
+VAStatus va_TraceTerminate (
+ VADisplay dpy
+);
+
void va_TraceCreateConfig(
VADisplay dpy,
VAProfile profile,