libs: encoder: h264,h265,mpeg2: add framerate parameter

https://bugzilla.gnome.org/show_bug.cgi?id=783449
This commit is contained in:
Víctor Manuel Jáquez Leal 2017-06-05 20:33:27 +02:00
parent 846c276e26
commit d733714ef8
3 changed files with 20 additions and 0 deletions

View file

@ -2171,6 +2171,12 @@ ensure_control_rate_params (GstVaapiEncoderH264 * encoder)
/* HRD params */
fill_hrd_params (encoder, &GST_VAAPI_ENCODER_VA_HRD (encoder));
/* FrameRate params */
GST_VAAPI_ENCODER_VA_FRAME_RATE (encoder) = (VAEncMiscParameterFrameRate) {
.framerate = (guint) GST_VAAPI_ENCODER_FPS_D (encoder) << 16 |
GST_VAAPI_ENCODER_FPS_N (encoder),
};
/* *INDENT-ON* */
return TRUE;

View file

@ -1771,9 +1771,17 @@ ensure_control_rate_params (GstVaapiEncoderH265 * encoder)
if (GST_VAAPI_ENCODER_RATE_CONTROL (encoder) == GST_VAAPI_RATECONTROL_CQP)
return TRUE;
/* *INDENT-OFF* */
/* HRD params */
fill_hrd_params (encoder, &GST_VAAPI_ENCODER_VA_HRD (encoder));
/* FrameRate params */
GST_VAAPI_ENCODER_VA_FRAME_RATE (encoder) = (VAEncMiscParameterFrameRate) {
.framerate = (guint) GST_VAAPI_ENCODER_FPS_D (encoder) << 16 |
GST_VAAPI_ENCODER_FPS_N (encoder),
};
/* *INDENT-ON* */
return TRUE;
}

View file

@ -473,6 +473,12 @@ ensure_control_rate_params (GstVaapiEncoderMpeg2 * encoder)
.buffer_size = base_encoder->bitrate * 1000 * 8,
.initial_buffer_fullness = base_encoder->bitrate * 1000 * 4,
};
/* FrameRate params */
GST_VAAPI_ENCODER_VA_FRAME_RATE (encoder) = (VAEncMiscParameterFrameRate) {
.framerate = (guint) GST_VAAPI_ENCODER_FPS_D (encoder) << 16 |
GST_VAAPI_ENCODER_FPS_N (encoder),
};
/* *INDENT-ON* */
return TRUE;