mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-22 14:06:23 +00:00
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
This commit is contained in:
parent
1670712500
commit
2c458819f5
1 changed files with 3 additions and 7 deletions
|
@ -1908,13 +1908,9 @@ raspi_capture_update_config (RASPIVID_STATE *state, RASPIVID_CONFIG *config, gbo
|
||||||
MMAL_COMPONENT_T *encoder = state->encoder_component;
|
MMAL_COMPONENT_T *encoder = state->encoder_component;
|
||||||
MMAL_PORT_T *encoder_output = encoder->output[0];
|
MMAL_PORT_T *encoder_output = encoder->output[0];
|
||||||
|
|
||||||
#if 0 /* not dynamically change-able */
|
status = mmal_port_parameter_set_uint32(encoder_output, MMAL_PARAMETER_VIDEO_BIT_RATE, config->bitrate);
|
||||||
encoder_output->format->bitrate = config->bitrate;
|
if (status != MMAL_SUCCESS)
|
||||||
status = mmal_port_format_commit(encoder_output);
|
vcos_log_warn("Unable to change bitrate dynamically");
|
||||||
if (status != MMAL_SUCCESS) {
|
|
||||||
vcos_log_warn("Cannot change bitrate dynamically");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
{
|
{
|
||||||
MMAL_PARAMETER_UINT32_T param = {{ MMAL_PARAMETER_INTRAPERIOD, sizeof(param)}, config->intraperiod};
|
MMAL_PARAMETER_UINT32_T param = {{ MMAL_PARAMETER_INTRAPERIOD, sizeof(param)}, config->intraperiod};
|
||||||
|
|
Loading…
Reference in a new issue