1 From ac2682411d03cf2951abf2856aeaf10206e700fc Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Thu, 13 May 2021 11:56:21 +0100
4 Subject: [PATCH] staging/bcm2835-codec: Change the default codec res
7 In order to effectively guarantee that a V4L2_EVENT_SOURCE_CHANGE
8 event occurs, adopt a default resolution of 32x32 so that it
9 is incredibly unlikely to be decoding a stream of that resolution
10 and therefore failing to note a "change" requiring the event.
12 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
14 .../bcm2835-codec/bcm2835-v4l2-codec.c | 15 +++++++++++++--
15 1 file changed, 13 insertions(+), 2 deletions(-)
17 --- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
18 +++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
19 @@ -97,8 +97,19 @@ static const char * const components[] =
23 -#define DEFAULT_WIDTH 640
24 -#define DEFAULT_HEIGHT 480
26 + * The decoder spec supports the V4L2_EVENT_SOURCE_CHANGE event, but the docs
27 + * seem to want it to always be generated on startup, which prevents the client
28 + * from configuring the CAPTURE queue based on any parsing it has already done
29 + * which may save time and allow allocation of CAPTURE buffers early. Surely
30 + * SOURCE_CHANGE means something has changed, not just "always notify".
32 + * For those clients that don't set the CAPTURE resolution, adopt a default
33 + * resolution that is seriously unlikely to be correct, therefore almost
34 + * guaranteed to get the SOURCE_CHANGE event.
36 +#define DEFAULT_WIDTH 32
37 +#define DEFAULT_HEIGHT 32
39 * The unanswered question - what is the maximum size of a compressed frame?
40 * V4L2 mandates that the encoded frame must fit in a single buffer. Sizing