]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - drivers/staging/media/platform/bcm2835/mmal-msg-port.h
a55c1ea2eceb190689910a6a84370f126b1e9cbb
[mirror_ubuntu-artful-kernel.git] / drivers / staging / media / platform / bcm2835 / mmal-msg-port.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 /* MMAL_PORT_TYPE_T */
17 enum mmal_port_type {
18 MMAL_PORT_TYPE_UNKNOWN = 0, /**< Unknown port type */
19 MMAL_PORT_TYPE_CONTROL, /**< Control port */
20 MMAL_PORT_TYPE_INPUT, /**< Input port */
21 MMAL_PORT_TYPE_OUTPUT, /**< Output port */
22 MMAL_PORT_TYPE_CLOCK, /**< Clock port */
23 };
24
25 /** The port is pass-through and doesn't need buffer headers allocated */
26 #define MMAL_PORT_CAPABILITY_PASSTHROUGH 0x01
27 /** The port wants to allocate the buffer payloads.
28 * This signals a preference that payload allocation should be done
29 * on this port for efficiency reasons. */
30 #define MMAL_PORT_CAPABILITY_ALLOCATION 0x02
31 /** The port supports format change events.
32 * This applies to input ports and is used to let the client know
33 * whether the port supports being reconfigured via a format
34 * change event (i.e. without having to disable the port). */
35 #define MMAL_PORT_CAPABILITY_SUPPORTS_EVENT_FORMAT_CHANGE 0x04
36
37 /* mmal port structure (MMAL_PORT_T)
38 *
39 * most elements are informational only, the pointer values for
40 * interogation messages are generally provided as additional
41 * strucures within the message. When used to set values only teh
42 * buffer_num, buffer_size and userdata parameters are writable.
43 */
44 struct mmal_port {
45 void *priv; /* Private member used by the framework */
46 const char *name; /* Port name. Used for debugging purposes (RO) */
47
48 u32 type; /* Type of the port (RO) enum mmal_port_type */
49 u16 index; /* Index of the port in its type list (RO) */
50 u16 index_all; /* Index of the port in the list of all ports (RO) */
51
52 u32 is_enabled; /* Indicates whether the port is enabled or not (RO) */
53 struct mmal_es_format *format; /* Format of the elementary stream */
54
55 u32 buffer_num_min; /* Minimum number of buffers the port
56 * requires (RO). This is set by the
57 * component.
58 */
59
60 u32 buffer_size_min; /* Minimum size of buffers the port
61 * requires (RO). This is set by the
62 * component.
63 */
64
65 u32 buffer_alignment_min; /* Minimum alignment requirement for
66 * the buffers (RO). A value of
67 * zero means no special alignment
68 * requirements. This is set by the
69 * component.
70 */
71
72 u32 buffer_num_recommended; /* Number of buffers the port
73 * recommends for optimal
74 * performance (RO). A value of
75 * zero means no special
76 * recommendation. This is set
77 * by the component.
78 */
79
80 u32 buffer_size_recommended; /* Size of buffers the port
81 * recommends for optimal
82 * performance (RO). A value of
83 * zero means no special
84 * recommendation. This is set
85 * by the component.
86 */
87
88 u32 buffer_num; /* Actual number of buffers the port will use.
89 * This is set by the client.
90 */
91
92 u32 buffer_size; /* Actual maximum size of the buffers that
93 * will be sent to the port. This is set by
94 * the client.
95 */
96
97 void *component; /* Component this port belongs to (Read Only) */
98
99 void *userdata; /* Field reserved for use by the client */
100
101 u32 capabilities; /* Flags describing the capabilities of a
102 * port (RO). Bitwise combination of \ref
103 * portcapabilities "Port capabilities"
104 * values.
105 */
106
107 };