Lines Matching refs:p

23 #define MPP_ALLOCATOR_LOCK(p)   pthread_mutex_lock(&(p)->lock);  argument
24 #define MPP_ALLOCATOR_UNLOCK(p) pthread_mutex_unlock(&(p)->lock); argument
48 MppAllocatorImpl *p = (MppAllocatorImpl *)allocator; in mpp_allocator_api_wrapper() local
52 if (!p || !info || id >= ALLOC_API_BUTT) { in mpp_allocator_api_wrapper()
58 MPP_ALLOCATOR_LOCK(p); in mpp_allocator_api_wrapper()
61 func = p->os_api.alloc; in mpp_allocator_api_wrapper()
64 func = p->os_api.free; in mpp_allocator_api_wrapper()
67 func = p->os_api.import; in mpp_allocator_api_wrapper()
70 func = p->os_api.release; in mpp_allocator_api_wrapper()
73 func = p->os_api.mmap; in mpp_allocator_api_wrapper()
80 if (func && p->ctx) in mpp_allocator_api_wrapper()
81 ret = func(p->ctx, info); in mpp_allocator_api_wrapper()
83 MPP_ALLOCATOR_UNLOCK(p); in mpp_allocator_api_wrapper()
128 MppAllocatorImpl *p = NULL; in mpp_allocator_get() local
137 p = mpp_malloc(MppAllocatorImpl, 1); in mpp_allocator_get()
138 if (!p) { in mpp_allocator_get()
143 p->type = buffer_type; in mpp_allocator_get()
144 p->flags = flags; in mpp_allocator_get()
148 p->os_api = allocator_std; in mpp_allocator_get()
151 p->os_api = (mpp_rt_allcator_is_valid(MPP_BUFFER_TYPE_DMA_HEAP)) ? allocator_dma_heap : in mpp_allocator_get()
157 p->os_api = allocator_ext_dma; in mpp_allocator_get()
160 p->os_api = (mpp_rt_allcator_is_valid(MPP_BUFFER_TYPE_DMA_HEAP)) ? allocator_dma_heap : in mpp_allocator_get()
166 p->os_api = (mpp_rt_allcator_is_valid(MPP_BUFFER_TYPE_DMA_HEAP)) ? allocator_dma_heap : in mpp_allocator_get()
175 if (p->os_api.open(&p->ctx, SZ_4K, flags)) in mpp_allocator_get()
179 p->type = p->os_api.type; in mpp_allocator_get()
180 if (p->os_api.flags) in mpp_allocator_get()
181 p->flags = p->os_api.flags(p->ctx); in mpp_allocator_get()
188 pthread_mutex_init(&p->lock, &attr); in mpp_allocator_get()
192 *allocator = p; in mpp_allocator_get()
198 MPP_FREE(p); in mpp_allocator_get()
207 MppAllocatorImpl *p = (MppAllocatorImpl *)*allocator; in mpp_allocator_put() local
209 if (!p) { in mpp_allocator_put()
214 if (!p) in mpp_allocator_put()
218 if (p->os_api.close && p->ctx) in mpp_allocator_put()
219 p->os_api.close(p->ctx); in mpp_allocator_put()
220 pthread_mutex_destroy(&p->lock); in mpp_allocator_put()
221 mpp_free(p); in mpp_allocator_put()
228 MppAllocatorImpl *p = (MppAllocatorImpl *)allocator; in mpp_allocator_get_flags() local
230 return p ? p->flags : MPP_ALLOC_FLAG_NONE; in mpp_allocator_get_flags()