1 From 35e371f270fb14320de11b93cbc0f1e1024ff58c Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Wed, 4 Nov 2020 18:31:02 +0000
4 Subject: [PATCH] staging/bcm2835-codec: Ensure OUTPUT timestamps are
7 The firmware by default tries to ensure that decoded frame
8 timestamps always increment. This is counter to the V4L2 API
9 which wants exactly the OUTPUT queue timestamps passed to the
10 CAPTURE queue buffers.
12 Disable the firmware option.
14 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
16 .../bcm2835-codec/bcm2835-v4l2-codec.c | 13 +++++++++++++
17 .../vc04_services/vchiq-mmal/mmal-parameters.h | 3 +++
18 2 files changed, 16 insertions(+)
20 --- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
21 +++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
22 @@ -2001,6 +2001,19 @@ static int bcm2835_codec_create_componen
23 MMAL_PARAMETER_ZERO_COPY, &enable,
26 + if (dev->role == DECODE) {
28 + * Disable firmware option that ensures decoded timestamps
32 + vchiq_mmal_port_parameter_set(dev->instance,
33 + &ctx->component->output[0],
34 + MMAL_PARAMETER_VIDEO_VALIDATE_TIMESTAMPS,
39 setup_mmal_port_format(ctx, &ctx->q_data[V4L2_M2M_SRC],
40 &ctx->component->input[0]);
42 --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h
43 +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h
44 @@ -674,6 +674,9 @@ enum mmal_parameter_video_type {
46 /**< Take a @ref MMAL_PARAMETER_BOOLEAN_T */
47 MMAL_PARAMETER_VIDEO_ENCODE_HEADERS_WITH_FRAME,
49 + /**< Take a @ref MMAL_PARAMETER_BOOLEAN_T */
50 + MMAL_PARAMETER_VIDEO_VALIDATE_TIMESTAMPS,
53 /** Valid mirror modes */