summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAustin Yuan <shengquan.yuan@gmail.com>2010-06-02 10:22:01 +0800
committerAustin Yuan <shengquan.yuan@gmail.com>2010-06-02 10:22:01 +0800
commit9ce47af9a2df4ecbe562c1a92bf1fe8889928be8 (patch)
tree0e700f6e5911da66a6ef370b455350d452ad8611 /test
parent07c837980e2b2ef204dd24417bf4c70fb59b7dd9 (diff)
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>
Diffstat (limited to 'test')
-rw-r--r--test/encode/h264encode.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/test/encode/h264encode.c b/test/encode/h264encode.c
index bb0cce9..1e4ecec 100644
--- a/test/encode/h264encode.c
+++ b/test/encode/h264encode.c
@@ -105,20 +105,16 @@ static int upload_source_YUV_once_for_all()
static int save_coded_buf(VABufferID coded_buf, int current_frame, int frame_skipped)
{
void *coded_p=NULL;
- int coded_size,coded_offset,wrt_size;
+ VACodedBufferSegment *buf_list = NULL;
VAStatus va_status;
-
- va_status = vaMapBuffer(va_dpy,coded_buf,&coded_p);
- CHECK_VASTATUS(va_status,"vaMapBuffer");
+ unsigned int coded_size = 0;
- coded_size = *((unsigned long *) coded_p); /* first DWord is the coded video size */
- coded_offset = *((unsigned long *) (coded_p + 4)); /* second DWord is byte offset */
-
- wrt_size = write(coded_fd,coded_p+coded_offset,coded_size);
- if (wrt_size != coded_size) {
- fprintf(stderr, "Trying to write %d bytes, but actual %d bytes\n",
- coded_size, wrt_size);
- exit(1);
+ va_status = vaMapBuffer(va_dpy,coded_buf,(void **)(&buf_list));
+ CHECK_VASTATUS(va_status,"vaMapBuffer");
+ while (buf_list != NULL) {
+ printf("Write %d bytes\n", buf_list->size);
+ coded_size += write(coded_fd, buf_list->buf, buf_list->size);
+ buf_list = buf_list->next;
}
vaUnmapBuffer(va_dpy,coded_buf);