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_BUFFER_H 00029 #define MMAL_BUFFER_H 00030 00031 #ifdef __cplusplus 00032 extern "C" { 00033 #endif 00034 00041 /* @{ */ 00042 00044 typedef struct { 00045 uint32_t planes; 00046 uint32_t offset[4]; 00048 uint32_t pitch[4]; 00050 uint32_t flags; 00052 /* TBD stereoscopic support */ 00053 } MMAL_BUFFER_HEADER_VIDEO_SPECIFIC_T; 00054 00056 typedef union 00057 { 00059 MMAL_BUFFER_HEADER_VIDEO_SPECIFIC_T video; 00060 00061 } MMAL_BUFFER_HEADER_TYPE_SPECIFIC_T; 00062 00069 typedef struct MMAL_BUFFER_HEADER_T 00070 { 00071 struct MMAL_BUFFER_HEADER_T *next; 00073 struct MMAL_BUFFER_HEADER_PRIVATE_T *priv; 00075 uint32_t cmd; 00078 uint8_t *data; 00080 uint32_t alloc_size; 00081 uint32_t length; 00083 uint32_t offset; 00085 uint32_t flags; 00088 int64_t pts; 00090 int64_t dts; 00095 MMAL_BUFFER_HEADER_TYPE_SPECIFIC_T *type; 00096 00097 void *user_data; 00099 } MMAL_BUFFER_HEADER_T; 00100 00104 /* @{ */ 00106 #define MMAL_BUFFER_HEADER_FLAG_EOS (1<<0) 00107 00108 #define MMAL_BUFFER_HEADER_FLAG_FRAME_START (1<<1) 00109 00110 #define MMAL_BUFFER_HEADER_FLAG_FRAME_END (1<<2) 00111 00112 #define MMAL_BUFFER_HEADER_FLAG_FRAME (MMAL_BUFFER_HEADER_FLAG_FRAME_START|MMAL_BUFFER_HEADER_FLAG_FRAME_END) 00113 00114 #define MMAL_BUFFER_HEADER_FLAG_KEYFRAME (1<<3) 00115 00117 #define MMAL_BUFFER_HEADER_FLAG_DISCONTINUITY (1<<4) 00118 00120 #define MMAL_BUFFER_HEADER_FLAG_CONFIG (1<<5) 00121 00122 #define MMAL_BUFFER_HEADER_FLAG_ENCRYPTED (1<<6) 00123 00124 #define MMAL_BUFFER_HEADER_FLAG_CODECSIDEINFO (1<<7) 00125 00126 #define MMAL_BUFFER_HEADER_FLAGS_SNAPSHOT (1<<8) 00127 00128 #define MMAL_BUFFER_HEADER_FLAG_CORRUPTED (1<<9) 00129 00130 #define MMAL_BUFFER_HEADER_FLAG_TRANSMISSION_FAILED (1<<10) 00131 /* @} */ 00132 00136 /* @{ */ 00138 #define MMAL_BUFFER_HEADER_VIDEO_FLAG_INTERLACED (1<<0) 00139 00140 #define MMAL_BUFFER_HEADER_VIDEO_FLAG_TOP_FIELD_FIRST (1<<2) 00141 00142 #define MMAL_BUFFER_HEADER_VIDEO_FLAG_DISPLAY_EXTERNAL (1<<3) 00143 00144 #define MMAL_BUFFER_HEADER_VIDEO_FLAG_PROTECTED (1<<4) 00145 /* @} */ 00146 00155 void mmal_buffer_header_acquire(MMAL_BUFFER_HEADER_T *header); 00156 00162 void mmal_buffer_header_reset(MMAL_BUFFER_HEADER_T *header); 00163 00175 void mmal_buffer_header_release(MMAL_BUFFER_HEADER_T *header); 00176 00183 void mmal_buffer_header_release_continue(MMAL_BUFFER_HEADER_T *header); 00184 00198 typedef MMAL_BOOL_T (*MMAL_BH_PRE_RELEASE_CB_T)(MMAL_BUFFER_HEADER_T *header, void *userdata); 00199 00208 void mmal_buffer_header_pre_release_cb_set(MMAL_BUFFER_HEADER_T *header, MMAL_BH_PRE_RELEASE_CB_T cb, void *userdata); 00209 00219 MMAL_STATUS_T mmal_buffer_header_replicate(MMAL_BUFFER_HEADER_T *dest, MMAL_BUFFER_HEADER_T *src); 00220 00227 MMAL_STATUS_T mmal_buffer_header_mem_lock(MMAL_BUFFER_HEADER_T *header); 00228 00235 void mmal_buffer_header_mem_unlock(MMAL_BUFFER_HEADER_T *header); 00236 00237 /* @} */ 00238 00239 #ifdef __cplusplus 00240 } 00241 #endif 00242 00243 #endif /* MMAL_BUFFER_H */