diff options
-rw-r--r-- | test/encode/h264encode.c | 12 | ||||
-rw-r--r-- | va/va.h | 1 |
2 files changed, 10 insertions, 3 deletions
diff --git a/test/encode/h264encode.c b/test/encode/h264encode.c index 7a110b3..b2030bc 100644 --- a/test/encode/h264encode.c +++ b/test/encode/h264encode.c @@ -917,8 +917,8 @@ static int process_cmdline(int argc, char *argv[]) static int init_va(void) { VAProfile profile_list[]={VAProfileH264High,VAProfileH264Main,VAProfileH264Baseline,VAProfileH264ConstrainedBaseline}; - VAEntrypoint entrypoints[VAEntrypointMax]={0}; - int num_entrypoints,slice_entrypoint; + VAEntrypoint *entrypoints; + int num_entrypoints, slice_entrypoint; int support_encode = 0; int major_ver, minor_ver; VAStatus va_status; @@ -928,6 +928,13 @@ static int init_va(void) va_status = vaInitialize(va_dpy, &major_ver, &minor_ver); CHECK_VASTATUS(va_status, "vaInitialize"); + num_entrypoints = vaMaxNumEntrypoints(va_dpy); + entrypoints = malloc(num_entrypoints * sizeof(*entrypoints)); + if (!entrypoints) { + fprintf(stderr, "error: failed to initialize VA entrypoints array\n"); + exit(1); + } + /* use the highest profile */ for (i = 0; i < sizeof(profile_list)/sizeof(profile_list[0]); i++) { if ((h264_profile != ~0) && h264_profile != profile_list[i]) @@ -1101,6 +1108,7 @@ static int init_va(void) printf("Support VAConfigAttribEncMacroblockInfo\n"); } + free(entrypoints); return 0; } @@ -304,7 +304,6 @@ typedef enum VAEntrypointEncSlice = 6, /* slice level encode */ VAEntrypointEncPicture = 7, /* pictuer encode, JPEG, etc */ VAEntrypointVideoProc = 10, /**< Video pre/post-processing. */ - VAEntrypointMax } VAEntrypoint; /* Currently defined configuration attribute types */ |