• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

hardware/intel/common/libva


Commit MetaInfo

Revision9ce47af9a2df4ecbe562c1a92bf1fe8889928be8 (tree)
Time2010-06-02 11:22:01
AuthorAustin Yuan <shengquan.yuan@gmai...>
CommiterAustin Yuan

Log Message

1) clean up Android header file to make it work in C file (from zhaohan.ren at intel.com)
2) rearrange va/Makefile.am (from elaine.wang at intel.com)
3) apply the new VACodedBufferSegment to encode test APP

Signed-off-by: Austin Yuan <shengquan.yuan@gmail.com>

Change Summary

Incremental Difference

--- a/test/encode/h264encode.c
+++ b/test/encode/h264encode.c
@@ -105,20 +105,16 @@ static int upload_source_YUV_once_for_all()
105105 static int save_coded_buf(VABufferID coded_buf, int current_frame, int frame_skipped)
106106 {
107107 void *coded_p=NULL;
108- int coded_size,coded_offset,wrt_size;
108+ VACodedBufferSegment *buf_list = NULL;
109109 VAStatus va_status;
110-
111- va_status = vaMapBuffer(va_dpy,coded_buf,&coded_p);
112- CHECK_VASTATUS(va_status,"vaMapBuffer");
110+ unsigned int coded_size = 0;
113111
114- coded_size = *((unsigned long *) coded_p); /* first DWord is the coded video size */
115- coded_offset = *((unsigned long *) (coded_p + 4)); /* second DWord is byte offset */
116-
117- wrt_size = write(coded_fd,coded_p+coded_offset,coded_size);
118- if (wrt_size != coded_size) {
119- fprintf(stderr, "Trying to write %d bytes, but actual %d bytes\n",
120- coded_size, wrt_size);
121- exit(1);
112+ va_status = vaMapBuffer(va_dpy,coded_buf,(void **)(&buf_list));
113+ CHECK_VASTATUS(va_status,"vaMapBuffer");
114+ while (buf_list != NULL) {
115+ printf("Write %d bytes\n", buf_list->size);
116+ coded_size += write(coded_fd, buf_list->buf, buf_list->size);
117+ buf_list = buf_list->next;
122118 }
123119 vaUnmapBuffer(va_dpy,coded_buf);
124120
--- a/va/Android.mk
+++ b/va/Android.mk
@@ -1,67 +1,89 @@
1-# For libva_android
1+# For libva
22 # =====================================================
33
44 LOCAL_PATH:= $(call my-dir)
55
6-LIBVA_MINOR_VERSION := 31
7-LIBVA_MAJOR_VERSION := 0
6+LIBVA_DRIVERS_PATH = /system/lib
87
98 include $(CLEAR_VARS)
109
11-LOCAL_SRC_FILES := \
12- va.c \
13- va_trace.c \
14- android/va_android.cpp
10+#LIBVA_MINOR_VERSION := 31
11+#LIBVA_MAJOR_VERSION := 0
1512
13+LOCAL_SRC_FILES := \
14+ va.c \
15+ va_trace.c \
1616
17-LOCAL_CFLAGS += -DHAVE_CONFIG_H \
18- -DANDROID \
17+LOCAL_CFLAGS += \
18+ -DANDROID \
19+ -DVA_DRIVERS_PATH="\"$(LIBVA_DRIVERS_PATH)\""
1920
2021 LOCAL_C_INCLUDES += \
21- $(TARGET_OUT_HEADERS)/libva \
22- $(LOCAL_PATH)/x11
22+ $(TARGET_OUT_HEADERS)/libva \
23+ $(LOCAL_PATH)/x11 \
24+ $(LOCAL_PATH)/..
2325
24-LOCAL_CXX := g++
26+LOCAL_COPY_HEADERS := \
27+ va.h \
28+ va_version.h \
29+ va_backend.h \
30+ va_version.h.in \
31+ x11/va_dricommon.h
2532
2633 LOCAL_COPY_HEADERS_TO := libva/va
2734
28-LOCAL_COPY_HEADERS := \
29- va.h \
30- va_backend.h \
31- va_version.h.in \
32- x11/va_dricommon.h \
33- va_android.h
34-
35-LOCAL_MODULE := libva_android
35+LOCAL_MODULE := libva
3636
3737 LOCAL_SHARED_LIBRARIES := libdl libdrm libcutils
3838
3939 include $(BUILD_SHARED_LIBRARY)
4040
4141
42-# For libva_android_tpi
42+# For libva-android
4343 # =====================================================
4444
4545 include $(CLEAR_VARS)
4646
4747 LOCAL_SRC_FILES := \
48- va_tpi.c \
48+ android/va_android.cpp
49+
50+LOCAL_CFLAGS += \
51+ -DANDROID
52+
53+LOCAL_C_INCLUDES += \
54+ $(TARGET_OUT_HEADERS)/libva \
55+ $(LOCAL_PATH)/x11
56+
57+LOCAL_COPY_HEADERS_TO := libva/va
58+
59+LOCAL_COPY_HEADERS := va_android.h
60+
61+LOCAL_MODULE := libva-android
62+
63+include $(BUILD_SHARED_LIBRARY)
64+
65+
66+# For libva-tpi
67+# =====================================================
68+
69+include $(CLEAR_VARS)
70+
71+LOCAL_SRC_FILES := va_tpi.c
4972
50-LOCAL_CFLAGS += -DANDROID \
73+LOCAL_CFLAGS += -DANDROID
5174
5275 LOCAL_C_INCLUDES += \
53- $(TARGET_OUT_HEADERS)/libva \
76+ $(TARGET_OUT_HEADERS)/libva \
77+ $(LOCAL_PATH)/..
5478
5579 LOCAL_COPY_HEADERS_TO := libva/va
5680
5781 LOCAL_COPY_HEADERS := \
58- va.h \
59- va_backend.h \
60- va_tpi.h \
61- va_backend_tpi.h
82+ va_tpi.h \
83+ va_backend_tpi.h
6284
63-LOCAL_SHARED_LIBRARIES := libva_android
85+LOCAL_SHARED_LIBRARIES := libva
6486
65-LOCAL_MODULE := libva_android_tpi
87+LOCAL_MODULE := libva-tpi
6688
6789 include $(BUILD_SHARED_LIBRARY)
--- a/va/Makefile.am
+++ b/va/Makefile.am
@@ -27,17 +27,25 @@ INCLUDES = \
2727 LDADD = \
2828 $(LIBVA_LT_LDFLAGS)
2929
30-libva_x11_backend = libva-x11.la
31-libva_x11_backenddir = x11
32-
30+libva_la_SOURCES = va.c va_trace.c
3331 libva_ladir = $(libdir)
3432 libva_la_LDFLAGS = $(LDADD) -no-undefined
3533 libva_la_LIBADD = $(LIBVA_LIBS) -ldl
3634
35+libva_tpi_la_SOURCES = va_tpi.c
3736 libva_tpi_ladir = $(libdir)
3837 libva_tpi_la_LDFLAGS = $(LDADD) -no-undefined
3938 libva_tpi_la_LIBADD = $(libvacorelib) -ldl
40-libva_tpi_la_DEPENDENCIES = libva.la
39+libva_tpi_la_DEPENDENCIES = $(libvacorelib)
40+
41+
42+libva_x11_backend = libva-x11.la
43+libva_x11_backenddir = x11
44+
45+libva_x11_la_SOURCES =
46+libva_x11_la_LIBADD = $(libvacorelib) x11/libva_x11.la $(LIBVA_LIBS) $(X11_LIBS) $(XEXT_LIBS) $(DRM_LIBS) $(XFIXES_LIBS)
47+libva_x11_la_LDFLAGS = $(LDADD)
48+libva_x11_la_DEPENDENCIES = $(libvacorelib) x11/libva_x11.la
4149
4250 if BUILD_DUMMY_BACKEND
4351 libva_dummy_backend = libva-dummy.la
@@ -66,14 +74,6 @@ libva_glx_backend =
6674 libva_glx_backenddir =
6775 endif
6876
69-libva_x11_la_SOURCES =
70-libva_x11_la_LIBADD = $(libvacorelib) x11/libva_x11.la $(LIBVA_LIBS) $(X11_LIBS) $(XEXT_LIBS) $(DRM_LIBS) $(XFIXES_LIBS)
71-libva_x11_la_LDFLAGS = $(LDADD)
72-libva_x11_la_DEPENDENCIES = $(libvacorelib) x11/libva_x11.la
73-
74-libva_la_SOURCES = va.c va_trace.c
75-libva_tpi_la_SOURCES = va_tpi.c
76-
7777 lib_LTLIBRARIES = libva.la libva-tpi.la $(libva_x11_backend) $(libva_dummy_backend) $(libva_glx_backend)
7878
7979 DIST_SUBDIRS = x11 glx dummy
--- a/va/va_android.h
+++ b/va/va_android.h
@@ -3,14 +3,10 @@
33
44 #include <va/va.h>
55
6-#ifdef ANDROID
7-#include <ui/ISurface.h>
8-using namespace android;
9-#endif
10-
116 #ifdef __cplusplus
127 extern "C" {
138 #endif
9+
1410 /*
1511 * Returns a suitable VADisplay for VA API
1612 */
@@ -18,11 +14,19 @@ VADisplay vaGetDisplay (
1814 void *android_dpy
1915 );
2016
17+#ifdef __cplusplus
18+}
19+#endif
20+
21+#ifdef __cplusplus
2122 #ifdef ANDROID
23+#include <ui/ISurface.h>
24+using namespace android;
25+
2226 /*
2327 * Output rendering
24- * Following is the rendering interface for X windows,
25- * to get the decode output surface to a X drawable
28+ * Following is the rendering interface for Android system,
29+ * to get the decode output surface to an ISurface object.
2630 * It basically performs a de-interlacing (if needed),
2731 * color space conversion and scaling to the destination
2832 * rectangle
@@ -43,9 +47,8 @@ VAStatus vaPutSurface (
4347 unsigned int number_cliprects, /* number of clip rects in the clip list */
4448 unsigned int flags /* PutSurface flags */
4549 );
46-#endif
47-
48-#ifdef __cplusplus
49-}
50-#endif
50+
51+#endif /* ANDROID */
52+#endif /* __cplusplus */
53+
5154 #endif /* _VA_ANDROID_H_ */