My Project
mmal_port_private.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_PRIVATE_H
29 #define MMAL_PORT_PRIVATE_H
30 
31 #include "interface/mmal/mmal.h"
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
40 typedef struct MMAL_PORT_PRIVATE_T
41 {
43  struct MMAL_PORT_PRIVATE_CORE_T *core;
45  struct MMAL_PORT_MODULE_T *module;
47  struct MMAL_PORT_CLOCK_T *clock;
48 
57 
58  uint8_t *(*pf_payload_alloc)(MMAL_PORT_T *port, uint32_t payload_size);
59  void (*pf_payload_free)(MMAL_PORT_T *port, uint8_t *payload);
60 
62 
66 
71 
73 MMAL_PORT_T *mmal_port_alloc(MMAL_COMPONENT_T *, MMAL_PORT_TYPE_T type, unsigned int extra_size);
75 void mmal_port_free(MMAL_PORT_T *port);
77 MMAL_PORT_T **mmal_ports_alloc(MMAL_COMPONENT_T *, unsigned int ports_num, MMAL_PORT_TYPE_T type,
78  unsigned int extra_size);
80 void mmal_ports_free(MMAL_PORT_T **ports, unsigned int ports_num);
81 
83 void mmal_port_acquire(MMAL_PORT_T *port);
84 
87 
90 
93 
94 /*****************************************************************************
95  * Clock Port API
96  *****************************************************************************/
103 typedef void (*MMAL_PORT_CLOCK_EVENT_CB)(MMAL_PORT_T *port, const MMAL_CLOCK_EVENT_T *event);
104 
113 MMAL_PORT_T* mmal_port_clock_alloc(MMAL_COMPONENT_T *component, unsigned int extra_size,
114  MMAL_PORT_CLOCK_EVENT_CB event_cb);
115 
121 
131 MMAL_PORT_T **mmal_ports_clock_alloc(MMAL_COMPONENT_T *component, unsigned int ports_num,
132  unsigned int extra_size, MMAL_PORT_CLOCK_EVENT_CB event_cb);
133 
139 void mmal_ports_clock_free(MMAL_PORT_T **ports, unsigned int ports_num);
140 
148 typedef void (*MMAL_PORT_CLOCK_REQUEST_CB)(MMAL_PORT_T *port, int64_t media_time, void *cb_data);
149 
160 MMAL_STATUS_T mmal_port_clock_request_add(MMAL_PORT_T *port, int64_t media_time,
161  MMAL_PORT_CLOCK_REQUEST_CB cb, void *cb_data);
162 
170 
174 
178 
182 
184 MMAL_STATUS_T mmal_port_clock_media_time_set(MMAL_PORT_T *port, int64_t media_time);
186 
189  const MMAL_CLOCK_UPDATE_THRESHOLD_T *threshold);
191  MMAL_CLOCK_UPDATE_THRESHOLD_T *threshold);
192 
195  const MMAL_CLOCK_DISCONT_THRESHOLD_T *threshold);
197  MMAL_CLOCK_DISCONT_THRESHOLD_T *threshold);
198 
201  const MMAL_CLOCK_REQUEST_THRESHOLD_T *threshold);
203  MMAL_CLOCK_REQUEST_THRESHOLD_T *threshold);
204 
208 
209 #ifdef __cplusplus
210 }
211 #endif
212 
213 #endif /* MMAL_PORT_PRIVATE_H */
MMAL_BOOL_T mmal_port_is_connected(MMAL_PORT_T *port)
struct MMAL_PORT_MODULE_T * module
MMAL_PORT_T * mmal_port_alloc(MMAL_COMPONENT_T *, MMAL_PORT_TYPE_T type, unsigned int extra_size)
MMAL_PORT_T ** mmal_ports_alloc(MMAL_COMPONENT_T *, unsigned int ports_num, MMAL_PORT_TYPE_T type, unsigned int extra_size)
MMAL_STATUS_T mmal_port_clock_discont_threshold_set(MMAL_PORT_T *port, const MMAL_CLOCK_DISCONT_THRESHOLD_T *threshold)
void(* MMAL_PORT_BH_CB_T)(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer)
Definition: mmal_port.h:132
MMAL_STATUS_T mmal_port_release(MMAL_PORT_T *port)
void mmal_ports_clock_free(MMAL_PORT_T **ports, unsigned int ports_num)
void mmal_port_clock_free(MMAL_PORT_T *port)
void mmal_port_acquire(MMAL_PORT_T *port)
MMAL_STATUS_T mmal_port_clock_media_time_set(MMAL_PORT_T *port, int64_t media_time)
MMAL_STATUS_T(* pf_disable)(MMAL_PORT_T *port)
MMAL_STATUS_T(* pf_flush)(MMAL_PORT_T *port)
MMAL_BOOL_T mmal_port_clock_active_get(MMAL_PORT_T *port)
MMAL_PORT_TYPE_T
Definition: mmal_port.h:45
MMAL_STATUS_T mmal_port_pause(MMAL_PORT_T *port, MMAL_BOOL_T pause)
MMAL_STATUS_T(* pf_set_format)(MMAL_PORT_T *port)
MMAL_STATUS_T mmal_port_clock_request_flush(MMAL_PORT_T *port)
MMAL_RATIONAL_T mmal_port_clock_scale_get(MMAL_PORT_T *port)
MMAL_BOOL_T mmal_port_clock_reference_get(MMAL_PORT_T *port)
int64_t mmal_port_clock_media_time_get(MMAL_PORT_T *port)
MMAL_STATUS_T(* pf_connect)(MMAL_PORT_T *port, MMAL_PORT_T *other_port)
MMAL_STATUS_T mmal_port_clock_update_threshold_set(MMAL_PORT_T *port, const MMAL_CLOCK_UPDATE_THRESHOLD_T *threshold)
MMAL_STATUS_T(* pf_send)(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *)
MMAL_STATUS_T mmal_port_clock_request_threshold_get(MMAL_PORT_T *port, MMAL_CLOCK_REQUEST_THRESHOLD_T *threshold)
void mmal_port_event_send(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer)
void mmal_port_clock_input_buffer_info(MMAL_PORT_T *port, const MMAL_CLOCK_BUFFER_INFO_T *info)
MMAL_STATUS_T(* pf_enable)(MMAL_PORT_T *port, MMAL_PORT_BH_CB_T)
void(* MMAL_PORT_CLOCK_REQUEST_CB)(MMAL_PORT_T *port, int64_t media_time, void *cb_data)
MMAL_PORT_T ** mmal_ports_clock_alloc(MMAL_COMPONENT_T *component, unsigned int ports_num, unsigned int extra_size, MMAL_PORT_CLOCK_EVENT_CB event_cb)
MMAL_STATUS_T mmal_port_clock_discont_threshold_get(MMAL_PORT_T *port, MMAL_CLOCK_DISCONT_THRESHOLD_T *threshold)
MMAL_PORT_T * mmal_port_clock_alloc(MMAL_COMPONENT_T *component, unsigned int extra_size, MMAL_PORT_CLOCK_EVENT_CB event_cb)
MMAL_STATUS_T mmal_port_clock_request_threshold_set(MMAL_PORT_T *port, const MMAL_CLOCK_REQUEST_THRESHOLD_T *threshold)
MMAL_STATUS_T mmal_port_clock_update_threshold_get(MMAL_PORT_T *port, MMAL_CLOCK_UPDATE_THRESHOLD_T *threshold)
struct MMAL_PORT_PRIVATE_T MMAL_PORT_PRIVATE_T
int32_t MMAL_BOOL_T
Definition: mmal_common.h:60
void mmal_port_clock_output_buffer_info(MMAL_PORT_T *port, const MMAL_CLOCK_BUFFER_INFO_T *info)
MMAL_STATUS_T mmal_port_clock_request_add(MMAL_PORT_T *port, int64_t media_time, MMAL_PORT_CLOCK_REQUEST_CB cb, void *cb_data)
MMAL_STATUS_T(* pf_parameter_get)(MMAL_PORT_T *port, MMAL_PARAMETER_HEADER_T *param)
struct MMAL_PORT_PRIVATE_CORE_T * core
MMAL_STATUS_T
Definition: mmal_types.h:46
void mmal_port_free(MMAL_PORT_T *port)
MMAL_STATUS_T mmal_port_clock_scale_set(MMAL_PORT_T *port, MMAL_RATIONAL_T scale)
void mmal_port_buffer_header_callback(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer)
MMAL_STATUS_T mmal_port_clock_reference_set(MMAL_PORT_T *port, MMAL_BOOL_T reference)
MMAL_STATUS_T(* pf_parameter_set)(MMAL_PORT_T *port, const MMAL_PARAMETER_HEADER_T *param)
void mmal_ports_free(MMAL_PORT_T **ports, unsigned int ports_num)
MMAL_STATUS_T mmal_port_clock_active_set(MMAL_PORT_T *port, MMAL_BOOL_T active)
struct MMAL_PORT_CLOCK_T * clock
void(* MMAL_PORT_CLOCK_EVENT_CB)(MMAL_PORT_T *port, const MMAL_CLOCK_EVENT_T *event)
void(* pf_payload_free)(MMAL_PORT_T *port, uint8_t *payload)