Skip to content

Commit 7a969bd

Browse files
jc-kynesimlimeng-linux
authored andcommitted
media: bcm2835-codec: Limit video callbacks
commit 56c8fad9d9ffdbdd79932bcc7e73b3965c7a725e from https://github.com/raspberrypi/linux.git rpi-5.15.y 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 <[email protected]> Signed-off-by: Meng Li <[email protected]>
1 parent 0b2437b commit 7a969bd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2510,6 +2510,14 @@ static int bcm2835_codec_create_component(struct bcm2835_codec_ctx *ctx)
25102510
MMAL_PARAMETER_VIDEO_STOP_ON_PAR_COLOUR_CHANGE,
25112511
&enable,
25122512
sizeof(enable));
2513+
2514+
enable = (unsigned int)-5;
2515+
vchiq_mmal_port_parameter_set(dev->instance,
2516+
&ctx->component->control,
2517+
MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS,
2518+
&enable,
2519+
sizeof(enable));
2520+
25132521
} else if (dev->role == DEINTERLACE) {
25142522
/* Select the default deinterlace algorithm. */
25152523
int half_framerate = 0;

0 commit comments

Comments
 (0)