Skip to content

Commit

Permalink
1. add interface VARenderDevice for output the video into an externa…
Browse files Browse the repository at this point in the history
…l device when the WM is not aware of it

    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 <[email protected]>
Signed-off-by: Jason Hu <[email protected]>
Signed-off-by: Zhaohan Ren <[email protected]>
  • Loading branch information
Austin Yuan committed Apr 1, 2011
1 parent a259f9e commit b305666
Show file tree
Hide file tree
Showing 17 changed files with 173 additions and 33 deletions.
2 changes: 1 addition & 1 deletion i965_drv_video/i965_drv_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ i965_BufferSetNumElements(VADriverContextP ctx,
} 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;
}
}

Expand Down
4 changes: 4 additions & 0 deletions libva.spec
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ rm -rf $RPM_BUILD_ROOT
%{_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
Expand All @@ -95,10 +97,12 @@ rm -rf $RPM_BUILD_ROOT
%{_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 <[email protected]> 1.0.1
Expand Down
10 changes: 10 additions & 0 deletions style_unify
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/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



1 change: 1 addition & 0 deletions test/putsurface/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ LOCAL_CFLAGS += \
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
Expand Down
4 changes: 2 additions & 2 deletions test/putsurface/loadsurface.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ static int upload_surface(VADisplay va_dpy, VASurfaceID surface_id,
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,
Expand Down
1 change: 1 addition & 0 deletions test/vainfo/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ LOCAL_CFLAGS += \
LOCAL_C_INCLUDES += \
$(TARGET_OUT_HEADERS)/libva

LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := vainfo

LOCAL_SHARED_LIBRARIES := libva-android libva libdl libdrm libcutils
Expand Down
32 changes: 31 additions & 1 deletion va/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ LOCAL_SRC_FILES := \
va.c \
va_trace.c \
va_fool.c \
va_fool_getframe.c
va_fool_getframe.c

LOCAL_CFLAGS += \
-DANDROID \
Expand All @@ -34,6 +34,7 @@ LOCAL_COPY_HEADERS := \

LOCAL_COPY_HEADERS_TO := libva/va

LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := libva

LOCAL_SHARED_LIBRARIES := libdl libdrm libcutils
Expand Down Expand Up @@ -69,13 +70,41 @@ LOCAL_COPY_HEADERS_TO := libva/va

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
# =====================================================

Expand All @@ -97,6 +126,7 @@ LOCAL_COPY_HEADERS := \

LOCAL_SHARED_LIBRARIES := libva

LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := libva-tpi

include $(BUILD_SHARED_LIBRARY)
2 changes: 1 addition & 1 deletion va/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ DIST_SUBDIRS = x11 glx egl dummy
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
Expand Down
4 changes: 2 additions & 2 deletions va/android/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
# 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
Expand Down
2 changes: 1 addition & 1 deletion va/android/va_android.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ VAStatus vaPutSurface (
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 );
}
Expand Down
36 changes: 21 additions & 15 deletions va/va.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "va_backend.h"
#include "va_trace.h"
#include "va_fool.h"
#include "config.h"

#include <assert.h>
#include <stdarg.h>
Expand Down Expand Up @@ -191,7 +192,7 @@ static VAStatus va_openDriver(VADisplay dpy, char *driver_name)
}

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;
Expand Down Expand Up @@ -430,6 +431,9 @@ VAStatus vaInitialize (

if (driver_name)
free(driver_name);

VA_TRACE(va_Initialize, dpy, major_version, minor_version);

return vaStatus;
}

Expand Down Expand Up @@ -459,6 +463,8 @@ VAStatus vaTerminate (
if (VA_STATUS_SUCCESS == vaStatus)
pDisplayContext->vaDestroy(pDisplayContext);

VA_TRACE(va_Terminate, dpy);

va_TraceEnd(dpy);

va_FoolEnd(dpy);
Expand Down Expand Up @@ -578,7 +584,7 @@ VAStatus vaCreateConfig (
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);
Expand Down Expand Up @@ -626,7 +632,7 @@ VAStatus vaCreateSurfaces (
VADriverContextP ctx;
VAStatus vaStatus;
int ret = 0;

CHECK_DISPLAY(dpy);
ctx = CTX(dpy);

Expand Down Expand Up @@ -704,11 +710,11 @@ VAStatus vaCreateBuffer (
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);
}

Expand Down Expand Up @@ -742,7 +748,7 @@ VAStatus vaMapBuffer (
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)
Expand All @@ -760,11 +766,11 @@ VAStatus vaUnmapBuffer (
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 );
}

Expand Down Expand Up @@ -804,7 +810,7 @@ VAStatus vaBeginPicture (
{
VADriverContextP ctx;
int ret = 0;

CHECK_DISPLAY(dpy);
ctx = CTX(dpy);

Expand All @@ -826,7 +832,7 @@ VAStatus vaRenderPicture (
{
VADriverContextP ctx;
int ret = 0;

CHECK_DISPLAY(dpy);
ctx = CTX(dpy);

Expand All @@ -847,7 +853,7 @@ VAStatus vaEndPicture (
VAStatus va_status;
VADriverContextP ctx;
int ret = 0;

CHECK_DISPLAY(dpy);
ctx = CTX(dpy);

Expand All @@ -872,7 +878,7 @@ VAStatus vaSyncSurface (
VAStatus va_status;
VADriverContextP ctx;
int ret = 0;

CHECK_DISPLAY(dpy);
ctx = CTX(dpy);

Expand Down Expand Up @@ -1116,14 +1122,14 @@ VAStatus vaQuerySubpictureFormats (
{
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);
}

Expand Down
Loading

0 comments on commit b305666

Please sign in to comment.