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_CONNECTION_H 00029 #define MMAL_CONNECTION_H 00030 00082 #ifdef __cplusplus 00083 extern "C" { 00084 #endif 00085 00089 /* @{ */ 00092 #define MMAL_CONNECTION_FLAG_TUNNELLING 0x1 00093 00094 #define MMAL_CONNECTION_FLAG_ALLOCATION_ON_INPUT 0x2 00095 00096 #define MMAL_CONNECTION_FLAG_ALLOCATION_ON_OUTPUT 0x4 00097 /* @} */ 00098 00100 typedef struct MMAL_CONNECTION_T MMAL_CONNECTION_T; 00101 00107 typedef void (*MMAL_CONNECTION_CALLBACK_T)(MMAL_CONNECTION_T *connection); 00108 00110 struct MMAL_CONNECTION_T { 00111 00112 void *user_data; 00113 MMAL_CONNECTION_CALLBACK_T callback; 00115 uint32_t is_enabled; 00117 uint32_t flags; 00120 MMAL_PORT_T *in; 00121 MMAL_PORT_T *out; 00123 MMAL_POOL_T *pool; 00124 MMAL_QUEUE_T *queue; 00126 const char *name; 00128 /* Used for debug / statistics */ 00129 int64_t time_setup; 00130 int64_t time_enable; 00131 int64_t time_disable; 00132 }; 00133 00149 MMAL_STATUS_T mmal_connection_create(MMAL_CONNECTION_T **connection, 00150 MMAL_PORT_T *out, MMAL_PORT_T *in, uint32_t flags); 00151 00160 void mmal_connection_acquire(MMAL_CONNECTION_T *connection); 00161 00171 MMAL_STATUS_T mmal_connection_release(MMAL_CONNECTION_T *connection); 00172 00182 MMAL_STATUS_T mmal_connection_destroy(MMAL_CONNECTION_T *connection); 00183 00196 MMAL_STATUS_T mmal_connection_enable(MMAL_CONNECTION_T *connection); 00197 00203 MMAL_STATUS_T mmal_connection_disable(MMAL_CONNECTION_T *connection); 00204 00215 MMAL_STATUS_T mmal_connection_event_format_changed(MMAL_CONNECTION_T *connection, 00216 MMAL_BUFFER_HEADER_T *buffer); 00217 00218 #ifdef __cplusplus 00219 } 00220 #endif 00221 00224 #endif /* MMAL_CONNECTION_H */