hardware/intel/libva
修訂 | 824a70ae1ef79458e65079374209a0cb16b65c31 (tree) |
---|---|
時間 | 2013-06-05 10:40:49 |
作者 | Gwenole Beauchesne <gwenole.beauchesne@inte...> |
Commiter | Xiang, Haihao |
tests: cope with new vaCreateSurfaces() API.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Signed-off-by: Haitao Huang <haitao.huang@intel.com>
Signed-off-by: Austin Yuan <shengquan.yuan@intel.com>
@@ -64,19 +64,19 @@ void test() | ||
64 | 64 | |
65 | 65 | status("vaCreateSurfaces 1 surface\n"); |
66 | 66 | surfaces_1[1] = DEAD_SURFACE_ID; |
67 | - va_status = vaCreateSurfaces(va_dpy, 352, 288, VA_RT_FORMAT_YUV420, 1, surfaces_1); | |
67 | + va_status = vaCreateSurfaces(va_dpy, VA_RT_FORMAT_YUV420, 352, 288, surfaces_1, 1, NULL, 0); | |
68 | 68 | ASSERT( VA_STATUS_SUCCESS == va_status ); |
69 | 69 | ASSERT( DEAD_SURFACE_ID == surfaces_1[1] ); /* bounds check */ |
70 | 70 | |
71 | 71 | status("vaCreateSurfaces 4 surfaces\n"); |
72 | 72 | surfaces_4[4] = DEAD_SURFACE_ID; |
73 | - va_status = vaCreateSurfaces(va_dpy, 352, 288, VA_RT_FORMAT_YUV420, 4, surfaces_4); | |
73 | + va_status = vaCreateSurfaces(va_dpy, VA_RT_FORMAT_YUV420, 352, 288, surfaces_4, 4, NULL, 0); | |
74 | 74 | ASSERT( VA_STATUS_SUCCESS == va_status ); |
75 | 75 | ASSERT( DEAD_SURFACE_ID == surfaces_4[4] ); /* bounds check */ |
76 | 76 | |
77 | 77 | status("vaCreateSurfaces 16 surfaces\n"); |
78 | 78 | surfaces_16[16] = DEAD_SURFACE_ID; |
79 | - va_status = vaCreateSurfaces(va_dpy, 352, 288, VA_RT_FORMAT_YUV420, 16, surfaces_16); | |
79 | + va_status = vaCreateSurfaces(va_dpy, VA_RT_FORMAT_YUV420, 352, 288, surfaces_16, 16, NULL, 0); | |
80 | 80 | ASSERT( VA_STATUS_SUCCESS == va_status ); |
81 | 81 | ASSERT( DEAD_SURFACE_ID == surfaces_16[16] ); /* bounds check */ |
82 | 82 |
@@ -92,7 +92,7 @@ void test() | ||
92 | 92 | |
93 | 93 | status("vaCreateSurfaces 6 surfaces\n"); |
94 | 94 | surfaces_6[6] = DEAD_SURFACE_ID; |
95 | - va_status = vaCreateSurfaces(va_dpy, 352, 288, VA_RT_FORMAT_YUV420, 6, surfaces_6); | |
95 | + va_status = vaCreateSurfaces(va_dpy, VA_RT_FORMAT_YUV420, 352, 288, surfaces_6, 6, NULL, 0); | |
96 | 96 | ASSERT( VA_STATUS_SUCCESS == va_status ); |
97 | 97 | ASSERT( DEAD_SURFACE_ID == surfaces_6[6] ); /* bounds check */ |
98 | 98 |
@@ -74,7 +74,7 @@ void test() | ||
74 | 74 | { |
75 | 75 | status("vaCreateSurfaces create %dx%d surface\n", test_sizes[i].w, test_sizes[i].h); |
76 | 76 | surfaces[i+1] = DEAD_SURFACE_ID; |
77 | - va_status = vaCreateSurfaces(va_dpy, test_sizes[i].w, test_sizes[i].h, VA_RT_FORMAT_YUV420, 1, &surfaces[i]); | |
77 | + va_status = vaCreateSurfaces(va_dpy, VA_RT_FORMAT_YUV420, test_sizes[i].w, test_sizes[i].h, &surfaces[i], 1, NULL, 0); | |
78 | 78 | ASSERT( VA_STATUS_SUCCESS == va_status ); |
79 | 79 | ASSERT( DEAD_SURFACE_ID == surfaces[i+1] ); |
80 | 80 | } |
@@ -69,7 +69,7 @@ void test() | ||
69 | 69 | VASurfaceID *surfaces = malloc(total_surfaces * sizeof(VASurfaceID)); |
70 | 70 | |
71 | 71 | // TODO: Don't assume VA_RT_FORMAT_YUV420 is supported / needed for each config |
72 | - va_status = vaCreateSurfaces(va_dpy, width, height, VA_RT_FORMAT_YUV420, total_surfaces, surfaces); | |
72 | + va_status = vaCreateSurfaces(va_dpy, VA_RT_FORMAT_YUV420, width, height, surfaces, total_surfaces, NULL, 0); | |
73 | 73 | ASSERT( VA_STATUS_SUCCESS == va_status ); |
74 | 74 | |
75 | 75 | for(i = 0; i < config_count; i++) |
@@ -47,7 +47,7 @@ void pre() | ||
47 | 47 | surfaces = malloc(total_surfaces * sizeof(VASurfaceID)); |
48 | 48 | |
49 | 49 | // TODO: Don't assume VA_RT_FORMAT_YUV420 is supported / needed for each config |
50 | - va_status = vaCreateSurfaces(va_dpy, width, height, VA_RT_FORMAT_YUV420, total_surfaces, surfaces); | |
50 | + va_status = vaCreateSurfaces(va_dpy, VA_RT_FORMAT_YUV420, width, height, surfaces, total_surfaces, NULL, 0); | |
51 | 51 | ASSERT( VA_STATUS_SUCCESS == va_status ); |
52 | 52 | |
53 | 53 | status("vaCreateContext with config %08x\n", config); |
@@ -47,7 +47,7 @@ void pre() | ||
47 | 47 | surfaces = malloc(total_surfaces * sizeof(VASurfaceID)); |
48 | 48 | |
49 | 49 | // TODO: Don't assume VA_RT_FORMAT_YUV420 is supported / needed for each config |
50 | - va_status = vaCreateSurfaces(va_dpy, width, height, VA_RT_FORMAT_YUV420, total_surfaces, surfaces); | |
50 | + va_status = vaCreateSurfaces(va_dpy, VA_RT_FORMAT_YUV420, width, height, surfaces, total_surfaces, NULL, 0); | |
51 | 51 | ASSERT( VA_STATUS_SUCCESS == va_status ); |
52 | 52 | |
53 | 53 | status("vaCreateContext with config %08x\n", config); |
@@ -185,8 +185,12 @@ int main(int argc,char **argv) | ||
185 | 185 | &attrib, 1,&config_id); |
186 | 186 | CHECK_VASTATUS(va_status, "vaQueryConfigEntrypoints"); |
187 | 187 | |
188 | - va_status = vaCreateSurfaces(va_dpy,CLIP_WIDTH,CLIP_HEIGHT, | |
189 | - VA_RT_FORMAT_YUV420, 1, &surface_id); | |
188 | + va_status = vaCreateSurfaces( | |
189 | + va_dpy, | |
190 | + VA_RT_FORMAT_YUV420, CLIP_WIDTH, CLIP_HEIGHT, | |
191 | + &surface_id, 1, | |
192 | + NULL, 0 | |
193 | + ); | |
190 | 194 | CHECK_VASTATUS(va_status, "vaCreateSurfaces"); |
191 | 195 | |
192 | 196 | /* Create a context for this decode pipe */ |
@@ -578,10 +578,9 @@ int tinyjpeg_decode(struct jdec_private *priv) | ||
578 | 578 | &attrib, 1,&config_id); |
579 | 579 | CHECK_VASTATUS(va_status, "vaQueryConfigEntrypoints"); |
580 | 580 | |
581 | - va_status = vaCreateSurfaces(va_dpy, | |
581 | + va_status = vaCreateSurfaces(va_dpy,VA_RT_FORMAT_YUV420, | |
582 | 582 | priv->width,priv->height, //alignment? |
583 | - VA_RT_FORMAT_YUV420, | |
584 | - 1, &surface_id); | |
583 | + &surface_id, 1, NULL, 0); | |
585 | 584 | CHECK_VASTATUS(va_status, "vaCreateSurfaces"); |
586 | 585 | |
587 | 586 | /* Create a context for this decode pipe */ |
@@ -250,8 +250,12 @@ static void alloc_encode_resource(FILE *yuv_fp) | ||
250 | 250 | VAStatus va_status; |
251 | 251 | |
252 | 252 | // Create surface |
253 | - va_status = vaCreateSurfaces(va_dpy, picture_width, picture_height, | |
254 | - VA_RT_FORMAT_YUV420, SID_NUMBER, &surface_ids[0]); | |
253 | + va_status = vaCreateSurfaces( | |
254 | + va_dpy, | |
255 | + VA_RT_FORMAT_YUV420, picture_width, picture_height, | |
256 | + &surface_ids[0], SID_NUMBER, | |
257 | + NULL, 0 | |
258 | + ); | |
255 | 259 | CHECK_VASTATUS(va_status, "vaCreateSurfaces"); |
256 | 260 | |
257 | 261 | newImageBuffer = (unsigned char *)malloc(frame_size); |
@@ -1030,19 +1030,18 @@ static int setup_encode() | ||
1030 | 1030 | |
1031 | 1031 | /* create source surfaces */ |
1032 | 1032 | va_status = vaCreateSurfaces(va_dpy, |
1033 | - frame_width, frame_height, | |
1034 | - VA_RT_FORMAT_YUV420, | |
1035 | - SRC_SURFACE_NUM, | |
1036 | - &src_surface[0]); | |
1033 | + VA_RT_FORMAT_YUV420, frame_width, frame_height, | |
1034 | + &src_surface[0], SRC_SURFACE_NUM, | |
1035 | + NULL, 0); | |
1037 | 1036 | CHECK_VASTATUS(va_status, "vaCreateSurfaces"); |
1038 | 1037 | |
1039 | 1038 | /* create reference surfaces */ |
1040 | 1039 | va_status = vaCreateSurfaces( |
1041 | - va_dpy, | |
1042 | - frame_width, frame_height, | |
1043 | - VA_RT_FORMAT_YUV420, | |
1044 | - h264_maxref, | |
1045 | - &ref_surface[0]); | |
1040 | + va_dpy, | |
1041 | + VA_RT_FORMAT_YUV420, frame_width, frame_height, | |
1042 | + &ref_surface[0], h264_maxref, | |
1043 | + NULL, 0 | |
1044 | + ); | |
1046 | 1045 | CHECK_VASTATUS(va_status, "vaCreateSurfaces"); |
1047 | 1046 | |
1048 | 1047 | tmp_surfaceid = calloc(SRC_SURFACE_NUM + h264_maxref, sizeof(VASurfaceID)); |
@@ -892,11 +892,13 @@ mpeg2enc_alloc_va_resources(struct mpeg2enc_context *ctx) | ||
892 | 892 | CHECK_VASTATUS(va_status, "vaCreateContext"); |
893 | 893 | |
894 | 894 | va_status = vaCreateSurfaces(ctx->va_dpy, |
895 | + VA_RT_FORMAT_YUV420, | |
895 | 896 | ctx->width, |
896 | 897 | ctx->height, |
897 | - VA_RT_FORMAT_YUV420, | |
898 | + surface_ids, | |
898 | 899 | SID_NUMBER, |
899 | - surface_ids); | |
900 | + NULL, | |
901 | + 0); | |
900 | 902 | CHECK_VASTATUS(va_status, "vaCreateSurfaces"); |
901 | 903 | } |
902 | 904 |
@@ -337,8 +337,12 @@ int main(int argc,char **argv) | ||
337 | 337 | va_status = vaInitialize(va_dpy, &major_ver, &minor_ver); |
338 | 338 | CHECK_VASTATUS(va_status, "vaInitialize"); |
339 | 339 | |
340 | - va_status = vaCreateSurfaces(va_dpy,surface_width, surface_height, | |
341 | - VA_RT_FORMAT_YUV420, SURFACE_NUM, &surface_id[0]); | |
340 | + va_status = vaCreateSurfaces( | |
341 | + va_dpy, | |
342 | + VA_RT_FORMAT_YUV420, surface_width, surface_height, | |
343 | + &surface_id[0], SURFACE_NUM, | |
344 | + NULL, 0 | |
345 | + ); | |
342 | 346 | CHECK_VASTATUS(va_status, "vaCreateSurfaces"); |
343 | 347 | if (multi_thread == 0) /* upload the content for all surfaces */ |
344 | 348 | upload_source_YUV_once_for_all(); |