mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
gstomxvideoenc: Set bitrate in setcaps
Otherwise it gets lost whenever we configure new caps https://bugzilla.gnome.org/show_bug.cgi?id=698049
This commit is contained in:
parent
75ee954ea2
commit
5ba55b6c9a
1 changed files with 15 additions and 0 deletions
|
@ -1247,6 +1247,21 @@ gst_omx_video_enc_set_format (GstVideoEncoder * encoder,
|
||||||
NULL) != OMX_ErrorNone)
|
NULL) != OMX_ErrorNone)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
if (self->target_bitrate != 0xffffffff) {
|
||||||
|
OMX_VIDEO_PARAM_BITRATETYPE config;
|
||||||
|
OMX_ERRORTYPE err;
|
||||||
|
|
||||||
|
GST_OMX_INIT_STRUCT (&config);
|
||||||
|
config.nPortIndex = self->enc_out_port->index;
|
||||||
|
config.nTargetBitrate = self->target_bitrate;
|
||||||
|
config.eControlRate = self->control_rate;
|
||||||
|
err = gst_omx_component_set_parameter (self->enc,
|
||||||
|
OMX_IndexParamVideoBitrate, &config);
|
||||||
|
if (err != OMX_ErrorNone)
|
||||||
|
GST_ERROR_OBJECT (self, "Failed to set bitrate parameter: %s (0x%08x)",
|
||||||
|
gst_omx_error_to_string (err), err);
|
||||||
|
}
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (self, "Enabling component");
|
GST_DEBUG_OBJECT (self, "Enabling component");
|
||||||
if (needs_disable) {
|
if (needs_disable) {
|
||||||
if (gst_omx_port_set_enabled (self->enc_in_port, TRUE) != OMX_ErrorNone)
|
if (gst_omx_port_set_enabled (self->enc_in_port, TRUE) != OMX_ErrorNone)
|
||||||
|
|
Loading…
Reference in a new issue