1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * Broadcom BM2835 V4L2 driver
4 *
5 * Copyright © 2013 Raspberry Pi (Trading) Ltd.
6 *
7 * Authors: Vincent Sanders @ Collabora
8 * Dave Stevenson @ Broadcom
9 * (now dave.stevenson@raspberrypi.org)
10 * Simon Mellor @ Broadcom
11 * Luke Diamand @ Broadcom
12 */
13
14 #ifndef MMAL_MSG_FORMAT_H
15 #define MMAL_MSG_FORMAT_H
16
17 #include "mmal-msg-common.h"
18
19 /* MMAL_ES_FORMAT_T */
20
21 struct mmal_audio_format {
22 u32 channels; /* Number of audio channels */
23 u32 sample_rate; /* Sample rate */
24
25 u32 bits_per_sample; /* Bits per sample */
26 u32 block_align; /* Size of a block of data */
27 };
28
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 */
35
36 /*
37 * FourCC specifying the color space of the video stream. See the
38 * MmalColorSpace "pre-defined color spaces" for some examples.
39 */
40 u32 color_space;
41 };
42
43 struct mmal_subpicture_format {
44 u32 x_offset;
45 u32 y_offset;
46 };
47
48 union mmal_es_specific_format {
49 struct mmal_audio_format audio;
50 struct mmal_video_format video;
51 struct mmal_subpicture_format subpicture;
52 };
53
54 /* Definition of an elementary stream format (MMAL_ES_FORMAT_T) */
55 struct mmal_es_format_local {
56 u32 type; /* enum mmal_es_type */
57
58 u32 encoding; /* FourCC specifying encoding of the elementary
59 * stream.
60 */
61 u32 encoding_variant; /* FourCC specifying the specific
62 * encoding variant of the elementary
63 * stream.
64 */
65
66 union mmal_es_specific_format *es; /* Type specific
67 * information for the
68 * elementary stream
69 */
70
71 u32 bitrate; /* Bitrate in bits per second */
72 u32 flags; /* Flags describing properties of the elementary
73 * stream.
74 */
75
76 u32 extradata_size; /* Size of the codec specific data */
77 u8 *extradata; /* Codec specific data */
78 };
79
80 /* Remote definition of an elementary stream format (MMAL_ES_FORMAT_T) */
81 struct mmal_es_format {
82 u32 type; /* enum mmal_es_type */
83
84 u32 encoding; /* FourCC specifying encoding of the elementary
85 * stream.
86 */
87 u32 encoding_variant; /* FourCC specifying the specific
88 * encoding variant of the elementary
89 * stream.
90 */
91
92 u32 es; /* Type specific
93 * information for the
94 * elementary stream
95 */
96
97 u32 bitrate; /* Bitrate in bits per second */
98 u32 flags; /* Flags describing properties of the elementary
99 * stream.
100 */
101
102 u32 extradata_size; /* Size of the codec specific data */
103 u32 extradata; /* Codec specific data */
104 };
105
106 #endif /* MMAL_MSG_FORMAT_H */