Skip to content

Commit

Permalink
media: bcm2835-codec: Limit video callbacks
Browse files Browse the repository at this point in the history
Limit the number of allowed video callbacks. This helps with limiting
the size of the coded input FIFO which in turn helps to control latency.
Choose -5 as the magic number as it translates to DPB+5 buffers which
has been proven to be a good number in the past.

Ideally coded buffers would not be returned to the user until they
had been decoded into the DPB or been discarded as bad, but that grade
of control is unavailable to us.

Signed-off-by: John Cox <jc@kynesim.co.uk>
  • Loading branch information
jc-kynesim authored and popcornmix committed Nov 8, 2021
1 parent 898d0dc commit f7abe64
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2510,6 +2510,14 @@ static int bcm2835_codec_create_component(struct bcm2835_codec_ctx *ctx)
MMAL_PARAMETER_VIDEO_STOP_ON_PAR_COLOUR_CHANGE,
&enable,
sizeof(enable));

enable = (unsigned int)-5;
vchiq_mmal_port_parameter_set(dev->instance,
&ctx->component->control,
MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS,
&enable,
sizeof(enable));

} else if (dev->role == DEINTERLACE) {
/* Select the default deinterlace algorithm. */
int half_framerate = 0;
Expand Down

0 comments on commit f7abe64

Please sign in to comment.