summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSun, Mingruo <mingruo.sun@intel.com>2015-07-08 17:18:56 +0800
committerAustin Yuan <shengquan.yuan@intel.com>2015-07-08 17:28:51 +0800
commit18c60f0e824c977b11cf903af8cda069f438b287 (patch)
tree04c0ff2806e1ae5b3ecac42428483d915bafe1de
parent436cf888faa981915324b7ded157aff52178d8b0 (diff)
vaenc: add "-entrypoint" for VAEntrypointEncSliceLP type
usage: -entrypoint LP Signed-off-by: Sun, Mingruo <mingruo.sun@intel.com>
-rw-r--r--vaenc/h264encode.c7
-rw-r--r--vaenc/va_encode.c7
-rw-r--r--vaenc/va_surface.c4
3 files changed, 11 insertions, 7 deletions
diff --git a/vaenc/h264encode.c b/vaenc/h264encode.c
index 3f854c4..d69a2ba 100644
--- a/vaenc/h264encode.c
+++ b/vaenc/h264encode.c
@@ -1216,7 +1216,7 @@ static VAStatus h264_get_config(void)
continue;
vaQueryConfigEntrypoints(va_dpy, tmp, entrypoints, &num_entrypoints);
for (slice_entrypoint = 0; slice_entrypoint < num_entrypoints; slice_entrypoint++) {
- if (entrypoints[slice_entrypoint] == VAEntrypointEncSlice) {
+ if (entrypoints[slice_entrypoint] == va_entrypoint) {
support_encode = 1;
h264_profile = tmp;
break;
@@ -1227,7 +1227,7 @@ static VAStatus h264_get_config(void)
}
if (support_encode == 0) {
- printf("Can't find VAEntrypointEncSlice for H264 profiles\n");
+ printf("Can't find the target entrypoint for H264 profiles\n");
exit(1);
} else {
switch (h264_profile) {
@@ -1264,7 +1264,7 @@ static VAStatus h264_get_config(void)
for (i = 0; i < VAConfigAttribTypeMax; i++)
h264_attrib[i].type = i;
- va_status = vaGetConfigAttributes(va_dpy, h264_profile, VAEntrypointEncSlice,
+ va_status = vaGetConfigAttributes(va_dpy, h264_profile, va_entrypoint,
&h264_attrib[0], VAConfigAttribTypeMax);
CHECK_VASTATUS_NOEXIT(va_status, "vaGetConfigAttributes");
@@ -1392,7 +1392,6 @@ static VAStatus h264_get_config(void)
}
va_profile = h264_profile;
- va_entrypoint = VAEntrypointEncSlice;
/*
* Force to use sync mode in order to guarantee dumping
diff --git a/vaenc/va_encode.c b/vaenc/va_encode.c
index 9aa14a5..d9dbf85 100644
--- a/vaenc/va_encode.c
+++ b/vaenc/va_encode.c
@@ -57,7 +57,7 @@ VADisplay va_dpy;
VAProfile va_profile;
char *va_profile_str = NULL;
char *va_level_str = NULL;
-VAEntrypoint va_entrypoint;
+VAEntrypoint va_entrypoint = VAEntrypointEncSlice;
VAConfigAttrib config_attrib[VAConfigAttribTypeMax];
unsigned int config_attrib_num = 0;
unsigned int surface_num = SURFACE_NUM;
@@ -450,6 +450,7 @@ static int process_cmdline(int argc, char *argv[])
{"carc", required_argument, NULL, 56},
{"sum", no_argument, NULL, 57},
{"active_pm", no_argument, NULL, 58},
+ {"entrypoint", required_argument, NULL, 59},
{NULL, no_argument, NULL, 0 }};
int long_index, i, tmp, intra_idr_period_tmp = -1;
@@ -711,6 +712,10 @@ static int process_cmdline(int argc, char *argv[])
pm_active = 1;
break;
//case ':':
+ case 59:
+ if (!strncmp(optarg, "LP", 2))
+ va_entrypoint = VAEntrypointEncSliceLP;
+ break;
case '?':
print_help();
exit(0);
diff --git a/vaenc/va_surface.c b/vaenc/va_surface.c
index 3ad13c3..bbb4d16 100644
--- a/vaenc/va_surface.c
+++ b/vaenc/va_surface.c
@@ -132,8 +132,8 @@ VAStatus create_surfaces_external(struct codec_table_t *current_codec)
} else if (surface_type == SURFACE_TYPE_GRALLOC || surface_type == SURFACE_TYPE_GRALLOC_LINEAR) {
unsigned long buffers[SURFACE_NUM];
- va_status = alloc_gralloc_buffer(surface_num, buffers, frame_width_mbaligned, frame_height_mbaligned,
- (surface_type == SURFACE_TYPE_GRALLOC_LINEAR));
+ //va_status = alloc_gralloc_buffer(surface_num, buffers, frame_width_mbaligned, frame_height_mbaligned,
+ // (surface_type == SURFACE_TYPE_GRALLOC_LINEAR));
/* stride need to follow gralloc allocator */
setup_externalbuf(&external_srcbuf, surface_type, &attrib_list[0]);