[mpp_buffer]: add allocator to normal mode buffer, use orphan group instead of orphan buffer

git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@132 6e48237b-75ef-9749-8fc9-41990f28c85a
This commit is contained in:
ChenHengming
2015-08-20 01:38:12 +00:00
parent 7d0abbd3a8
commit 8378c2f847
4 changed files with 73 additions and 43 deletions

View File

@@ -57,7 +57,7 @@ MPP_RET mpp_allocator_alloc(MppAllocator allocator, MppBufferData **data, size_t
return (0 == ret) ? (MPP_OK) : (MPP_NOK);
}
MPP_RET mpp_allocator_free(MppAllocator allocator, MppBufferData **data)
MPP_RET mpp_allocator_free(MppAllocator allocator, MppBufferData *data)
{
if (NULL == allocator || NULL == data) {
mpp_err("mpp_allocator_alloc invalid input: allocator %p data %p\n",
@@ -67,14 +67,10 @@ MPP_RET mpp_allocator_free(MppAllocator allocator, MppBufferData **data)
MppAllocatorImpl *palloc = (MppAllocatorImpl *)allocator;
MPP_ALLOCATOR_LOCK(palloc);
MppBufferData *pdata = *data;
*data = NULL;
os_allocator_free(palloc->allocator, pdata);
os_allocator_free(palloc->allocator, data);
MPP_ALLOCATOR_UNLOCK(palloc);
mpp_free(pdata);
mpp_free(data);
return MPP_OK;
}