From: Jan Schmidt Date: Fri, 27 Jan 2017 01:58:29 +0000 (+1100) Subject: rpicamsrc: Implement dynamic bitrate update X-Git-Tag: 1.19.3~509^2~493^2~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2c458819f510a4c84fd871d892f503f7371413f6;p=platform%2Fupstream%2Fgstreamer.git rpicamsrc: Implement dynamic bitrate update Use mmal_port_set_parameter_uint32 to update the encoder bitrate. Fixes https://github.com/thaytan/gst-rpicamsrc/issues/60 --- diff --git a/sys/rpicamsrc/RaspiCapture.c b/sys/rpicamsrc/RaspiCapture.c index 8065e70..c50ef99 100644 --- a/sys/rpicamsrc/RaspiCapture.c +++ b/sys/rpicamsrc/RaspiCapture.c @@ -1908,13 +1908,9 @@ raspi_capture_update_config (RASPIVID_STATE *state, RASPIVID_CONFIG *config, gbo MMAL_COMPONENT_T *encoder = state->encoder_component; MMAL_PORT_T *encoder_output = encoder->output[0]; -#if 0 /* not dynamically change-able */ - encoder_output->format->bitrate = config->bitrate; - status = mmal_port_format_commit(encoder_output); - if (status != MMAL_SUCCESS) { - vcos_log_warn("Cannot change bitrate dynamically"); - } -#endif + status = mmal_port_parameter_set_uint32(encoder_output, MMAL_PARAMETER_VIDEO_BIT_RATE, config->bitrate); + if (status != MMAL_SUCCESS) + vcos_log_warn("Unable to change bitrate dynamically"); { MMAL_PARAMETER_UINT32_T param = {{ MMAL_PARAMETER_INTRAPERIOD, sizeof(param)}, config->intraperiod};