hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Broadcom BM2835 V4L2 driver
 *
 * Copyright © 2013 Raspberry Pi (Trading) Ltd.
 *
 * Authors: Vincent Sanders @ Collabora
 *          Dave Stevenson @ Broadcom
 *        (now dave.stevenson@raspberrypi.org)
 *          Simon Mellor @ Broadcom
 *          Luke Diamand @ Broadcom
 */
 
/* MMAL_PORT_TYPE_T */
enum mmal_port_type {
   MMAL_PORT_TYPE_UNKNOWN = 0,    /* Unknown port type */
   MMAL_PORT_TYPE_CONTROL,        /* Control port */
   MMAL_PORT_TYPE_INPUT,        /* Input port */
   MMAL_PORT_TYPE_OUTPUT,        /* Output port */
   MMAL_PORT_TYPE_CLOCK,        /* Clock port */
};
 
/* The port is pass-through and doesn't need buffer headers allocated */
#define MMAL_PORT_CAPABILITY_PASSTHROUGH                       0x01
/*
 *The port wants to allocate the buffer payloads.
 * This signals a preference that payload allocation should be done
 * on this port for efficiency reasons.
 */
#define MMAL_PORT_CAPABILITY_ALLOCATION                        0x02
/*
 * The port supports format change events.
 * This applies to input ports and is used to let the client know
 * whether the port supports being reconfigured via a format
 * change event (i.e. without having to disable the port).
 */
#define MMAL_PORT_CAPABILITY_SUPPORTS_EVENT_FORMAT_CHANGE      0x04
 
/*
 * mmal port structure (MMAL_PORT_T)
 *
 * most elements are informational only, the pointer values for
 * interogation messages are generally provided as additional
 * structures within the message. When used to set values only the
 * buffer_num, buffer_size and userdata parameters are writable.
 */
struct mmal_port {
   u32 priv;    /* Private member used by the framework */
   u32 name;    /* Port name. Used for debugging purposes (RO) */
 
   u32 type;    /* Type of the port (RO) enum mmal_port_type */
   u16 index;    /* Index of the port in its type list (RO) */
   u16 index_all;    /* Index of the port in the list of all ports (RO) */
 
   u32 is_enabled;    /* Indicates whether the port is enabled or not (RO) */
   u32 format;    /* Format of the elementary stream */
 
   u32 buffer_num_min;    /* Minimum number of buffers the port
                *   requires (RO).  This is set by the
                *   component.
                */
 
   u32 buffer_size_min;    /* Minimum size of buffers the port
                * requires (RO).  This is set by the
                * component.
                */
 
   u32 buffer_alignment_min;/* Minimum alignment requirement for
                 * the buffers (RO).  A value of
                 * zero means no special alignment
                 * requirements.  This is set by the
                 * component.
                 */
 
   u32 buffer_num_recommended;    /* Number of buffers the port
                    * recommends for optimal
                    * performance (RO).  A value of
                    * zero means no special
                    * recommendation.  This is set
                    * by the component.
                    */
 
   u32 buffer_size_recommended;    /* Size of buffers the port
                    * recommends for optimal
                    * performance (RO).  A value of
                    * zero means no special
                    * recommendation.  This is set
                    * by the component.
                    */
 
   u32 buffer_num;    /* Actual number of buffers the port will use.
            * This is set by the client.
            */
 
   u32 buffer_size; /* Actual maximum size of the buffers that
             * will be sent to the port. This is set by
             * the client.
             */
 
   u32 component;    /* Component this port belongs to (Read Only) */
 
   u32 userdata;    /* Field reserved for use by the client */
 
   u32 capabilities;    /* Flags describing the capabilities of a
                * port (RO).  Bitwise combination of \ref
                * portcapabilities "Port capabilities"
                * values.
                */
};