staging: bcm2835-codec: Signal the firmware to stop on all changes
authorDave Stevenson <dave.stevenson@raspberrypi.com>
Thu, 16 Sep 2021 15:39:07 +0000 (16:39 +0100)
committerDom Cobley <popcornmix@gmail.com>
Mon, 21 Mar 2022 16:04:24 +0000 (16:04 +0000)
The firmware defaults to not stopping video decode if only the
pixel aspect ratio or colourspace change. V4L2 requires us
to stop decoding on any change, therefore tell the firmware
of the desire for this alternate behaviour.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h

index 73afe99..6c6e0ba 100644 (file)
@@ -2483,6 +2483,16 @@ static int bcm2835_codec_create_component(struct bcm2835_codec_ctx *ctx)
                                              MMAL_PARAMETER_VIDEO_VALIDATE_TIMESTAMPS,
                                              &enable,
                                              sizeof(enable));
+               /*
+                * Enable firmware option to stop on colourspace and pixel
+                * aspect ratio changed
+                */
+               enable = 1;
+               vchiq_mmal_port_parameter_set(dev->instance,
+                                             &ctx->component->control,
+                                             MMAL_PARAMETER_VIDEO_STOP_ON_PAR_COLOUR_CHANGE,
+                                             &enable,
+                                             sizeof(enable));
        } else if (dev->role == DEINTERLACE) {
                /* Select the default deinterlace algorithm. */
                int half_framerate = 0;
index 622508d..2108749 100644 (file)
@@ -682,6 +682,9 @@ enum mmal_parameter_video_type {
 
        /**< Take a @ref MMAL_PARAMETER_BOOLEAN_T */
        MMAL_PARAMETER_VIDEO_VALIDATE_TIMESTAMPS,
+
+       /**< Takes a @ref MMAL_PARAMETER_BOOLEAN_T */
+       MMAL_PARAMETER_VIDEO_STOP_ON_PAR_COLOUR_CHANGE,
 };
 
 /** Valid mirror modes */