1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Broadcom BM2835 V4L2 driver
5 * Copyright © 2013 Raspberry Pi (Trading) Ltd.
7 * Authors: Vincent Sanders @ Collabora
8 * Dave Stevenson @ Broadcom
9 * (now dave.stevenson@raspberrypi.org)
10 * Simon Mellor @ Broadcom
11 * Luke Diamand @ Broadcom
14 #ifndef MMAL_MSG_FORMAT_H
15 #define MMAL_MSG_FORMAT_H
17 #include "mmal-msg-common.h"
19 /* MMAL_ES_FORMAT_T */
21 struct mmal_audio_format {
22 u32 channels; /* Number of audio channels */
23 u32 sample_rate; /* Sample rate */
25 u32 bits_per_sample; /* Bits per sample */
26 u32 block_align; /* Size of a block of data */
29 struct mmal_video_format {
30 u32 width; /* Width of frame in pixels */
31 u32 height; /* Height of frame in rows of pixels */
32 struct mmal_rect crop; /* Visible region of the frame */
33 struct mmal_rational frame_rate; /* Frame rate */
34 struct mmal_rational par; /* Pixel aspect ratio */
37 * FourCC specifying the color space of the video stream. See the
38 * MmalColorSpace "pre-defined color spaces" for some examples.
43 struct mmal_subpicture_format {
48 union mmal_es_specific_format {
49 struct mmal_audio_format audio;
50 struct mmal_video_format video;
51 struct mmal_subpicture_format subpicture;
54 /* The elementary stream will already be framed */
55 #define MMAL_ES_FORMAT_FLAG_FRAMED BIT(0)
57 * For column formats we ideally want to pass in the column stride. This hasn't
58 * been the past behaviour, so require a new flag to be set should
59 * es->video.width be the column stride (in lines) instead of an ignored width
62 #define MMAL_ES_FORMAT_FLAG_COL_FMTS_WIDTH_IS_COL_STRIDE BIT(1)
64 /* Definition of an elementary stream format (MMAL_ES_FORMAT_T) */
65 struct mmal_es_format_local {
66 u32 type; /* enum mmal_es_type */
68 u32 encoding; /* FourCC specifying encoding of the elementary
71 u32 encoding_variant; /* FourCC specifying the specific
72 * encoding variant of the elementary
76 union mmal_es_specific_format *es; /* Type specific
81 u32 bitrate; /* Bitrate in bits per second */
82 u32 flags; /* Flags describing properties of the elementary
86 u32 extradata_size; /* Size of the codec specific data */
87 u8 *extradata; /* Codec specific data */
90 /* Remote definition of an elementary stream format (MMAL_ES_FORMAT_T) */
91 struct mmal_es_format {
92 u32 type; /* enum mmal_es_type */
94 u32 encoding; /* FourCC specifying encoding of the elementary
97 u32 encoding_variant; /* FourCC specifying the specific
98 * encoding variant of the elementary
102 u32 es; /* Type specific
103 * information for the
107 u32 bitrate; /* Bitrate in bits per second */
108 u32 flags; /* Flags describing properties of the elementary
112 u32 extradata_size; /* Size of the codec specific data */
113 u32 extradata; /* Codec specific data */
116 #endif /* MMAL_MSG_FORMAT_H */