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_WRAPPER_H 00029 #define MMAL_WRAPPER_H 00030 00040 #ifdef __cplusplus 00041 extern "C" { 00042 #endif 00043 00045 typedef struct MMAL_WRAPPER_T MMAL_WRAPPER_T; 00046 00052 typedef void (*MMAL_WRAPPER_CALLBACK_T)(MMAL_WRAPPER_T *wrapper); 00053 00055 struct MMAL_WRAPPER_T { 00056 00057 void *user_data; 00058 MMAL_WRAPPER_CALLBACK_T callback; 00059 MMAL_COMPONENT_T *component; 00060 MMAL_STATUS_T status; 00061 00062 MMAL_PORT_T *control; 00064 uint32_t input_num; 00065 MMAL_PORT_T **input; 00066 MMAL_POOL_T **input_pool; 00068 uint32_t output_num; 00069 MMAL_PORT_T **output; 00070 MMAL_POOL_T **output_pool; 00071 MMAL_QUEUE_T **output_queue; 00073 /* Used for debug / statistics */ 00074 int64_t time_setup; 00075 int64_t time_enable; 00076 int64_t time_disable; 00078 }; 00079 00089 MMAL_STATUS_T mmal_wrapper_create(MMAL_WRAPPER_T **wrapper, const char *name); 00090 00094 /* @{ */ 00096 #define MMAL_WRAPPER_FLAG_WAIT 1 00097 00098 #define MMAL_WRAPPER_FLAG_PAYLOAD_ALLOCATE 2 00099 00100 #define MMAL_WRAPPER_FLAG_PAYLOAD_USE_SHARED_MEMORY 4 00101 /* @} */ 00102 00109 MMAL_STATUS_T mmal_wrapper_port_enable(MMAL_PORT_T *port, uint32_t flags); 00110 00116 MMAL_STATUS_T mmal_wrapper_port_disable(MMAL_PORT_T *port); 00117 00125 MMAL_STATUS_T mmal_wrapper_buffer_get_empty(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T **buffer, uint32_t flags); 00126 00134 MMAL_STATUS_T mmal_wrapper_buffer_get_full(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T **buffer, uint32_t flags); 00135 00141 MMAL_STATUS_T mmal_wrapper_cancel(MMAL_WRAPPER_T *wrapper); 00142 00149 MMAL_STATUS_T mmal_wrapper_destroy(MMAL_WRAPPER_T *wrapper); 00150 00151 #ifdef __cplusplus 00152 } 00153 #endif 00154 00157 #endif /* MMAL_WRAPPER_H */