summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/va/config.c
diff options
context:
space:
mode:
authorBoyuan Zhang <[email protected]>2016-07-21 19:40:17 -0400
committerChristian König <[email protected]>2016-07-25 13:39:51 +0200
commit10c1cc47a6adba9ea83d4df5c154c07f95ac3a40 (patch)
tree96a7d15f0fe80d3640faa7bd8ac8d05e65857a0c /src/gallium/state_trackers/va/config.c
parent34f46348438b29e20d06cca312616cfba8ee05f6 (diff)
st/va: get rate control method from configattrib v2
Rate control method is passed from app to driver through config attrib list. That is why we need to store this rate control method to config. And later on, we will pass this value to context->desc.h264enc.rate_ctrl.rate_ctrl_method. v2 (chk): fix broken build and commit message Signed-off-by: Boyuan Zhang <[email protected]> Signed-off-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/va/config.c')
-rw-r--r--src/gallium/state_trackers/va/config.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/va/config.c b/src/gallium/state_trackers/va/config.c
index 7742087e999..889ce38e676 100644
--- a/src/gallium/state_trackers/va/config.c
+++ b/src/gallium/state_trackers/va/config.c
@@ -202,6 +202,17 @@ vlVaCreateConfig(VADriverContextP ctx, VAProfile profile, VAEntrypoint entrypoin
config->profile = p;
+ for (int i = 0; i <num_attribs ; i++) {
+ if (attrib_list[i].type == VAConfigAttribRateControl) {
+ if (attrib_list[i].value == VA_RC_CBR)
+ config->rc = PIPE_H264_ENC_RATE_CONTROL_METHOD_CONSTANT;
+ else if (attrib_list[i].value == VA_RC_VBR)
+ config->rc = PIPE_H264_ENC_RATE_CONTROL_METHOD_VARIABLE;
+ else
+ config->rc = PIPE_H264_ENC_RATE_CONTROL_METHOD_DISABLE;
+ }
+ }
+
pipe_mutex_lock(drv->mutex);
*config_id = handle_table_add(drv->htab, config);
pipe_mutex_unlock(drv->mutex);