My Project
|
00001 /* 00002 Copyright (c) 2012, Broadcom Europe Ltd 00003 All rights reserved. 00004 00005 Redistribution and use in source and binary forms, with or without 00006 modification, are permitted provided that the following conditions are met: 00007 * Redistributions of source code must retain the above copyright 00008 notice, this list of conditions and the following disclaimer. 00009 * Redistributions in binary form must reproduce the above copyright 00010 notice, this list of conditions and the following disclaimer in the 00011 documentation and/or other materials provided with the distribution. 00012 * Neither the name of the copyright holder nor the 00013 names of its contributors may be used to endorse or promote products 00014 derived from this software without specific prior written permission. 00015 00016 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 00017 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00018 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00019 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY 00020 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00021 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00022 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00023 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00024 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00025 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00026 */ 00027 00028 #ifndef MMAL_PORT_H 00029 #define MMAL_PORT_H 00030 00031 #ifdef __cplusplus 00032 extern "C" { 00033 #endif 00034 00037 /* @{ */ 00038 00039 #include "mmal_types.h" 00040 #include "mmal_format.h" 00041 #include "mmal_buffer.h" 00042 #include "mmal_parameters.h" 00043 00045 typedef enum 00046 { 00047 MMAL_PORT_TYPE_UNKNOWN = 0, 00048 MMAL_PORT_TYPE_CONTROL, 00049 MMAL_PORT_TYPE_INPUT, 00050 MMAL_PORT_TYPE_OUTPUT, 00051 MMAL_PORT_TYPE_CLOCK, 00052 MMAL_PORT_TYPE_INVALID = 0xffffffff 00054 } MMAL_PORT_TYPE_T; 00055 00059 /* @{ */ 00061 #define MMAL_PORT_CAPABILITY_PASSTHROUGH 0x01 00062 00064 #define MMAL_PORT_CAPABILITY_ALLOCATION 0x02 00065 00068 #define MMAL_PORT_CAPABILITY_SUPPORTS_EVENT_FORMAT_CHANGE 0x04 00069 /* @} */ 00070 00079 typedef struct MMAL_PORT_T 00080 { 00081 struct MMAL_PORT_PRIVATE_T *priv; 00082 const char *name; 00084 MMAL_PORT_TYPE_T type; 00085 uint16_t index; 00086 uint16_t index_all; 00088 uint32_t is_enabled; 00089 MMAL_ES_FORMAT_T *format; 00091 uint32_t buffer_num_min; 00093 uint32_t buffer_size_min; 00095 uint32_t buffer_alignment_min; 00098 uint32_t buffer_num_recommended; 00101 uint32_t buffer_size_recommended; 00104 uint32_t buffer_num; 00106 uint32_t buffer_size; 00109 struct MMAL_COMPONENT_T *component; 00110 struct MMAL_PORT_USERDATA_T *userdata; 00112 uint32_t capabilities; 00117 } MMAL_PORT_T; 00118 00124 MMAL_STATUS_T mmal_port_format_commit(MMAL_PORT_T *port); 00125 00132 typedef void (*MMAL_PORT_BH_CB_T)(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer); 00133 00152 MMAL_STATUS_T mmal_port_enable(MMAL_PORT_T *port, MMAL_PORT_BH_CB_T cb); 00153 00165 MMAL_STATUS_T mmal_port_disable(MMAL_PORT_T *port); 00166 00182 MMAL_STATUS_T mmal_port_flush(MMAL_PORT_T *port); 00183 00190 MMAL_STATUS_T mmal_port_parameter_set(MMAL_PORT_T *port, 00191 const MMAL_PARAMETER_HEADER_T *param); 00192 00207 MMAL_STATUS_T mmal_port_parameter_get(MMAL_PORT_T *port, 00208 MMAL_PARAMETER_HEADER_T *param); 00209 00216 MMAL_STATUS_T mmal_port_send_buffer(MMAL_PORT_T *port, 00217 MMAL_BUFFER_HEADER_T *buffer); 00218 00234 MMAL_STATUS_T mmal_port_connect(MMAL_PORT_T *port, MMAL_PORT_T *other_port); 00235 00245 MMAL_STATUS_T mmal_port_disconnect(MMAL_PORT_T *port); 00246 00259 uint8_t *mmal_port_payload_alloc(MMAL_PORT_T *port, uint32_t payload_size); 00260 00269 void mmal_port_payload_free(MMAL_PORT_T *port, uint8_t *payload); 00270 00278 MMAL_STATUS_T mmal_port_event_get(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T **buffer, uint32_t event); 00279 00280 /* @} */ 00281 00282 #ifdef __cplusplus 00283 } 00284 #endif 00285 00286 #endif /* MMAL_PORT_H */