GNU Linux-libre 4.14.290-gnu1
[releases.git] / drivers / staging / vc04_services / bcm2835-camera / mmal-msg-format.h
1 /*
2  * Broadcom BM2835 V4L2 driver
3  *
4  * Copyright © 2013 Raspberry Pi (Trading) Ltd.
5  *
6  * This file is subject to the terms and conditions of the GNU General Public
7  * License.  See the file COPYING in the main directory of this archive
8  * for more details.
9  *
10  * Authors: Vincent Sanders <vincent.sanders@collabora.co.uk>
11  *          Dave Stevenson <dsteve@broadcom.com>
12  *          Simon Mellor <simellor@broadcom.com>
13  *          Luke Diamand <luked@broadcom.com>
14  */
15
16 #ifndef MMAL_MSG_FORMAT_H
17 #define MMAL_MSG_FORMAT_H
18
19 #include "mmal-msg-common.h"
20
21 /* MMAL_ES_FORMAT_T */
22
23 struct mmal_audio_format {
24         u32 channels;           /**< Number of audio channels */
25         u32 sample_rate;        /**< Sample rate */
26
27         u32 bits_per_sample;    /**< Bits per sample */
28         u32 block_align;        /**< Size of a block of data */
29 };
30
31 struct mmal_video_format {
32         u32 width;        /**< Width of frame in pixels */
33         u32 height;       /**< Height of frame in rows of pixels */
34         struct mmal_rect crop;         /**< Visible region of the frame */
35         struct mmal_rational frame_rate;   /**< Frame rate */
36         struct mmal_rational par;          /**< Pixel aspect ratio */
37
38         /* FourCC specifying the color space of the video stream. See the
39          * \ref MmalColorSpace "pre-defined color spaces" for some examples.
40          */
41         u32 color_space;
42 };
43
44 struct mmal_subpicture_format {
45         u32 x_offset;
46         u32 y_offset;
47 };
48
49 union mmal_es_specific_format {
50         struct mmal_audio_format audio;
51         struct mmal_video_format video;
52         struct mmal_subpicture_format subpicture;
53 };
54
55 /** Definition of an elementary stream format (MMAL_ES_FORMAT_T) */
56 struct mmal_es_format_local {
57         u32 type;      /* enum mmal_es_type */
58
59         u32 encoding;  /* FourCC specifying encoding of the elementary stream.*/
60         u32 encoding_variant; /* FourCC specifying the specific
61                                * encoding variant of the elementary
62                                * stream.
63                                */
64
65         union mmal_es_specific_format *es;  /* Type specific
66                                              * information for the
67                                              * elementary stream
68                                              */
69
70         u32 bitrate;        /**< Bitrate in bits per second */
71         u32 flags; /**< Flags describing properties of the elementary stream. */
72
73         u32 extradata_size;       /**< Size of the codec specific data */
74         u8  *extradata;           /**< Codec specific data */
75 };
76
77 /** Remote definition of an elementary stream format (MMAL_ES_FORMAT_T) */
78 struct mmal_es_format {
79         u32 type;      /* enum mmal_es_type */
80
81         u32 encoding;  /* FourCC specifying encoding of the elementary stream.*/
82         u32 encoding_variant; /* FourCC specifying the specific
83                                * encoding variant of the elementary
84                                * stream.
85                                */
86
87         u32 es; /* Type specific
88                  * information for the
89                  * elementary stream
90                  */
91
92         u32 bitrate;        /**< Bitrate in bits per second */
93         u32 flags; /**< Flags describing properties of the elementary stream. */
94
95         u32 extradata_size;       /**< Size of the codec specific data */
96         u32 extradata;           /**< Codec specific data */
97 };
98
99 #endif /* MMAL_MSG_FORMAT_H */