Lines Matching refs:buffer
25 * 1. buffer get / put / reference management / external commit / get info.
36 * 2. user buffer working flow control abstraction.
37 * buffer should attach to certain group, and buffer mode control the buffer usage flow.
48 * 3. buffer allocator management
50 * it will support normal buffer, ion buffer, Linux v4l2 vb2 buffer
56 * mpp buffer group support two work flow mode:
58 * normal flow: all buffer are generated by MPP
59 * under this mode, buffer pool is maintained internally
70 * commit flow: all buffer are commited out of MPP
94 * mpp buffer group has two buffer limit mode: normal and limit
96 * normal mode: allows any buffer size and always general new buffer is no unused buffer
98 * This mode normally use with normal flow and is used for table / stream buffer
100 * limit mode : restrict the buffer's size and count in the buffer group. if try to calloc
101 * buffer with different size or extra count it will fail.
102 * This mode normally use with commit flow and is used for frame buffer
116 * the mpp buffer has serval types:
118 * normal : normal malloc buffer for unit test or hardware simulation
138 * DRM CMA buffer : MPP_BUFFER_TYPE_DRM | MPP_BUFFER_FLAGS_CONTIG
140 * DRM SECURE buffer: MPP_BUFFER_TYPE_DRM | MPP_BUFFER_FLAGS_SECURE
156 * index - the buffer index used to track buffer in buffer pool
157 * size - the buffer size
161 * ptr - virtual address of normal malloced buffer
163 * internal buffer counter number
167 * ptr - virtual address of ion buffer in user space
169 * fd - ion buffer file handle for map / unmap
184 * mpp_buffer_import_with_tag(MppBufferGroup group, MppBufferInfo *info, MppBuffer *buffer)
187 * group can be NULL then this buffer will attached to default legecy group
193 * 3. buffer - generated MppBuffer from MppBufferInfo.
194 * buffer can be NULL then the buffer is commit to group with unused status.
195 * Otherwise generated buffer will be directly got and ref_count increased.
200 * Add a external buffer info to group. This buffer will be on unused status.
201 * Typical usage is on MediaPlayer gralloc Graphic buffer then commit these buffer
202 * to decoder's buffer group. Then decoder will recycle these buffer and return buffer reference
207 * Transfer a external buffer info to MppBuffer but it is not expected to attached to certain
208 * buffer group. So the group is set to NULL. Then this buffer can be used for MppFrame/MppPacket.
211 * imported buffer is leak or not and trace its usage inside mpp process. So we attach this kind
212 * of buffer to default misc buffer group for management.
216 #define mpp_buffer_import(buffer, info) mpp_buffer_import_with_tag(NULL, info, buffer, MODULE_TAG, __FUNCTION__)
218 #define mpp_buffer_get(group, buffer, size) mpp_buffer_get_with_tag(group, buffer, size, MODULE_TAG, __FUNCTION__)
220 #define mpp_buffer_put(buffer) mpp_buffer_put_with_caller(buffer, __FUNCTION__)
222 #define mpp_buffer_inc_ref(buffer) mpp_buffer_inc_ref_with_caller(buffer, __FUNCTION__)
224 #define mpp_buffer_info_get(buffer, info) mpp_buffer_info_get_with_caller(buffer, info, __FUNCTION__)
226 #define mpp_buffer_read(buffer, offset, data, size) \
227 mpp_buffer_read_with_caller(buffer, offset, data, size, __FUNCTION__)
229 #define mpp_buffer_write(buffer, offset, data, size) \
230 mpp_buffer_write_with_caller(buffer, offset, data, size, __FUNCTION__)
232 #define mpp_buffer_get_ptr(buffer) mpp_buffer_get_ptr_with_caller(buffer, __FUNCTION__)
234 #define mpp_buffer_get_fd(buffer) mpp_buffer_get_fd_with_caller(buffer, __FUNCTION__)
236 #define mpp_buffer_get_size(buffer) mpp_buffer_get_size_with_caller(buffer, __FUNCTION__)
238 #define mpp_buffer_get_index(buffer) mpp_buffer_get_index_with_caller(buffer, __FUNCTION__)
240 #define mpp_buffer_set_index(buffer, index) mpp_buffer_set_index_with_caller(buffer, index, __FUNCTION__)
242 #define mpp_buffer_get_offset(buffer) mpp_buffer_get_offset_with_caller(buffer, __FUNCTION__)
244 #define mpp_buffer_set_offset(buffer, offset) mpp_buffer_set_offset_with_caller(buffer, offset, __FUNCTION__)
258 * these interface will change value of group and buffer so before calling functions
265 MPP_RET mpp_buffer_import_with_tag(MppBufferGroup group, MppBufferInfo *info, MppBuffer *buffer, const char *tag,
267 MPP_RET mpp_buffer_get_with_tag(MppBufferGroup group, MppBuffer *buffer, size_t size, const char *tag,
269 MPP_RET mpp_buffer_put_with_caller(MppBuffer buffer, const char *caller);
270 MPP_RET mpp_buffer_inc_ref_with_caller(MppBuffer buffer, const char *caller);
272 MPP_RET mpp_buffer_info_get_with_caller(MppBuffer buffer, MppBufferInfo *info, const char *caller);
273 MPP_RET mpp_buffer_read_with_caller(MppBuffer buffer, size_t offset, void *data, size_t size, const char *caller);
274 MPP_RET mpp_buffer_write_with_caller(MppBuffer buffer, size_t offset, void *data, size_t size, const char *caller);
275 void *mpp_buffer_get_ptr_with_caller(MppBuffer buffer, const char *caller);
276 int mpp_buffer_get_fd_with_caller(MppBuffer buffer, const char *caller);
277 size_t mpp_buffer_get_size_with_caller(MppBuffer buffer, const char *caller);
278 int mpp_buffer_get_index_with_caller(MppBuffer buffer, const char *caller);
279 MPP_RET mpp_buffer_set_index_with_caller(MppBuffer buffer, int index, const char *caller);
280 size_t mpp_buffer_get_offset_with_caller(MppBuffer buffer, const char *caller);
281 MPP_RET mpp_buffer_set_offset_with_caller(MppBuffer buffer, size_t offset, const char *caller);
293 * size : 0 - no limit, other - max buffer size
294 * count : 0 - no limit, other - max buffer count