My Project
mmal_port.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2012, Broadcom Europe Ltd
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7  * Redistributions of source code must retain the above copyright
8  notice, this list of conditions and the following disclaimer.
9  * Redistributions in binary form must reproduce the above copyright
10  notice, this list of conditions and the following disclaimer in the
11  documentation and/or other materials provided with the distribution.
12  * Neither the name of the copyright holder nor the
13  names of its contributors may be used to endorse or promote products
14  derived from this software without specific prior written permission.
15 
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27 
28 #ifndef MMAL_PORT_H
29 #define MMAL_PORT_H
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
37 /* @{ */
38 
39 #include "mmal_types.h"
40 #include "mmal_format.h"
41 #include "mmal_buffer.h"
42 #include "mmal_parameters.h"
43 
45 typedef enum
46 {
52  MMAL_PORT_TYPE_INVALID = 0xffffffff
55 
59 /* @{ */
61 #define MMAL_PORT_CAPABILITY_PASSTHROUGH 0x01
62 
64 #define MMAL_PORT_CAPABILITY_ALLOCATION 0x02
65 
68 #define MMAL_PORT_CAPABILITY_SUPPORTS_EVENT_FORMAT_CHANGE 0x04
69 /* @} */
70 
79 typedef struct MMAL_PORT_T
80 {
82  const char *name;
85  uint16_t index;
86  uint16_t index_all;
88  uint32_t is_enabled;
91  uint32_t buffer_num_min;
93  uint32_t buffer_size_min;
104  uint32_t buffer_num;
106  uint32_t buffer_size;
110  struct MMAL_PORT_USERDATA_T *userdata;
112  uint32_t capabilities;
117 } MMAL_PORT_T;
118 
125 
132 typedef void (*MMAL_PORT_BH_CB_T)(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer);
133 
153 
166 
183 
191  const MMAL_PARAMETER_HEADER_T *param);
192 
208  MMAL_PARAMETER_HEADER_T *param);
209 
217  MMAL_BUFFER_HEADER_T *buffer);
218 
235 
246 
259 uint8_t *mmal_port_payload_alloc(MMAL_PORT_T *port, uint32_t payload_size);
260 
269 void mmal_port_payload_free(MMAL_PORT_T *port, uint8_t *payload);
270 
278 MMAL_STATUS_T mmal_port_event_get(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T **buffer, uint32_t event);
279 
280 /* @} */
281 
282 #ifdef __cplusplus
283 }
284 #endif
285 
286 #endif /* MMAL_PORT_H */
void(* MMAL_PORT_BH_CB_T)(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer)
Definition: mmal_port.h:132
const char * name
Definition: mmal_port.h:82
struct MMAL_PORT_USERDATA_T * userdata
Definition: mmal_port.h:110
uint32_t buffer_num_recommended
Definition: mmal_port.h:98
MMAL_STATUS_T mmal_port_disconnect(MMAL_PORT_T *port)
MMAL_STATUS_T mmal_port_flush(MMAL_PORT_T *port)
MMAL_STATUS_T mmal_port_connect(MMAL_PORT_T *port, MMAL_PORT_T *other_port)
MMAL_PORT_TYPE_T
Definition: mmal_port.h:45
MMAL_ES_FORMAT_T * format
Definition: mmal_port.h:89
uint32_t buffer_size_recommended
Definition: mmal_port.h:101
uint16_t index
Definition: mmal_port.h:85
MMAL_PORT_TYPE_T type
Definition: mmal_port.h:84
uint8_t * mmal_port_payload_alloc(MMAL_PORT_T *port, uint32_t payload_size)
MMAL_STATUS_T mmal_port_enable(MMAL_PORT_T *port, MMAL_PORT_BH_CB_T cb)
MMAL_STATUS_T mmal_port_disable(MMAL_PORT_T *port)
uint16_t index_all
Definition: mmal_port.h:86
MMAL_STATUS_T mmal_port_parameter_set(MMAL_PORT_T *port, const MMAL_PARAMETER_HEADER_T *param)
uint32_t capabilities
Definition: mmal_port.h:112
uint32_t buffer_num_min
Definition: mmal_port.h:91
uint32_t buffer_alignment_min
Definition: mmal_port.h:95
struct MMAL_PORT_PRIVATE_T * priv
Definition: mmal_port.h:81
struct MMAL_COMPONENT_T * component
Definition: mmal_port.h:109
uint32_t buffer_num
Definition: mmal_port.h:104
MMAL_STATUS_T mmal_port_parameter_get(MMAL_PORT_T *port, MMAL_PARAMETER_HEADER_T *param)
MMAL_STATUS_T mmal_port_event_get(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T **buffer, uint32_t event)
MMAL_STATUS_T mmal_port_send_buffer(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer)
MMAL_STATUS_T mmal_port_format_commit(MMAL_PORT_T *port)
uint32_t is_enabled
Definition: mmal_port.h:88
MMAL_STATUS_T
Definition: mmal_types.h:46
uint32_t buffer_size_min
Definition: mmal_port.h:93
struct MMAL_PORT_T MMAL_PORT_T
uint32_t buffer_size
Definition: mmal_port.h:106
void mmal_port_payload_free(MMAL_PORT_T *port, uint8_t *payload)