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)
committerPhil Elwell <8911409+pelwell@users.noreply.github.com>
Thu, 23 Sep 2021 13:53:43 +0000 (14:53 +0100)
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 73afe99268ff2430d5fa98f75612345da5fdc171..6c6e0ba34a0bf1cd771f98429e98b6587fdfd241 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 622508dc6e27586b00d5ce95ce0d944ac2f409d9..21087496a48175720a38cd4b301e144066a056be 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 */