mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-07 10:00:55 +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)
|
static MPP_RET allocator_std_open(void **ctx, MppAllocatorCfg *cfg)
|
||||||
{
|
{
|
||||||
MPP_RET ret = MPP_OK;
|
|
||||||
allocator_ctx *p = NULL;
|
|
||||||
|
|
||||||
if (NULL == ctx) {
|
if (NULL == ctx) {
|
||||||
mpp_err_f("do not accept NULL input\n");
|
mpp_err_f("do not accept NULL input\n");
|
||||||
return MPP_ERR_NULL_PTR;
|
return MPP_ERR_NULL_PTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
p = mpp_malloc(allocator_ctx, 1);
|
mpp_err_f("Warning: std allocator should be used on simulation mode only\n");
|
||||||
if (NULL == p) {
|
(void)cfg;
|
||||||
mpp_err_f("failed to allocate context\n");
|
|
||||||
ret = MPP_ERR_MALLOC;
|
|
||||||
} else
|
|
||||||
p->alignment = cfg->alignment;
|
|
||||||
|
|
||||||
p->fd_count = 0;
|
*ctx = NULL;
|
||||||
|
return MPP_NOK;
|
||||||
*ctx = p;
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static MPP_RET allocator_std_alloc(void *ctx, MppBufferInfo *info)
|
static MPP_RET allocator_std_alloc(void *ctx, MppBufferInfo *info)
|
||||||
{
|
{
|
||||||
allocator_ctx *p = NULL;
|
|
||||||
|
|
||||||
if (NULL == ctx) {
|
if (NULL == ctx) {
|
||||||
mpp_err_f("found NULL context input\n");
|
mpp_err_f("found NULL context input\n");
|
||||||
return MPP_ERR_NULL_PTR;
|
return MPP_ERR_NULL_PTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
p = (allocator_ctx *)ctx;
|
mpp_err_f("Warning: std allocator should be used on simulation mode only\n");
|
||||||
info->fd = p->fd_count++;
|
(void)info;
|
||||||
return (MPP_RET)os_malloc(&info->ptr, p->alignment, info->size);
|
|
||||||
|
return MPP_NOK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static MPP_RET allocator_std_free(void *ctx, MppBufferInfo *info)
|
static MPP_RET allocator_std_free(void *ctx, MppBufferInfo *info)
|
||||||
|
@@ -139,7 +139,6 @@ MPP_RET mpp_allocator_get(MppAllocator *allocator,
|
|||||||
p->flags = flags;
|
p->flags = flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
MPP_RET ret = os_allocator_get(&p->os_api, buffer_type);
|
MPP_RET ret = os_allocator_get(&p->os_api, buffer_type);
|
||||||
|
|
||||||
if (MPP_OK == ret) {
|
if (MPP_OK == ret) {
|
||||||
|
Reference in New Issue
Block a user