mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-07 18:11:02 +08:00
[mpp_allocator]: disable std allocator.
Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com> Change-Id: I27441d49c2072176b848b5d80d408ebcb50926df
This commit is contained in:
@@ -29,39 +29,29 @@ typedef struct {
|
||||
|
||||
static MPP_RET allocator_std_open(void **ctx, MppAllocatorCfg *cfg)
|
||||
{
|
||||
MPP_RET ret = MPP_OK;
|
||||
allocator_ctx *p = NULL;
|
||||
|
||||
if (NULL == ctx) {
|
||||
mpp_err_f("do not accept NULL input\n");
|
||||
return MPP_ERR_NULL_PTR;
|
||||
}
|
||||
|
||||
p = mpp_malloc(allocator_ctx, 1);
|
||||
if (NULL == p) {
|
||||
mpp_err_f("failed to allocate context\n");
|
||||
ret = MPP_ERR_MALLOC;
|
||||
} else
|
||||
p->alignment = cfg->alignment;
|
||||
mpp_err_f("Warning: std allocator should be used on simulation mode only\n");
|
||||
(void)cfg;
|
||||
|
||||
p->fd_count = 0;
|
||||
|
||||
*ctx = p;
|
||||
return ret;
|
||||
*ctx = NULL;
|
||||
return MPP_NOK;
|
||||
}
|
||||
|
||||
static MPP_RET allocator_std_alloc(void *ctx, MppBufferInfo *info)
|
||||
{
|
||||
allocator_ctx *p = NULL;
|
||||
|
||||
if (NULL == ctx) {
|
||||
mpp_err_f("found NULL context input\n");
|
||||
return MPP_ERR_NULL_PTR;
|
||||
}
|
||||
|
||||
p = (allocator_ctx *)ctx;
|
||||
info->fd = p->fd_count++;
|
||||
return (MPP_RET)os_malloc(&info->ptr, p->alignment, info->size);
|
||||
mpp_err_f("Warning: std allocator should be used on simulation mode only\n");
|
||||
(void)info;
|
||||
|
||||
return MPP_NOK;
|
||||
}
|
||||
|
||||
static MPP_RET allocator_std_free(void *ctx, MppBufferInfo *info)
|
||||
|
@@ -139,7 +139,6 @@ MPP_RET mpp_allocator_get(MppAllocator *allocator,
|
||||
p->flags = flags;
|
||||
}
|
||||
|
||||
|
||||
MPP_RET ret = os_allocator_get(&p->os_api, buffer_type);
|
||||
|
||||
if (MPP_OK == ret) {
|
||||
|
Reference in New Issue
Block a user