singe/thirdparty/rockchip-mpp/osal/mpp_allocator_api.h
2026-09-10 20:17:28 -05:00

30 lines
727 B
C

/* SPDX-License-Identifier: Apache-2.0 OR MIT */
/*
* Copyright (c) 2023 Rockchip Electronics Co., Ltd.
*/
#ifndef MPP_ALLOCATOR_API_H
#define MPP_ALLOCATOR_API_H
#include "mpp_allocator.h"
typedef MPP_RET (*OsAllocatorFunc)(void *ctx, MppBufferInfo *info);
typedef struct os_allocator_t {
MppBufferType type;
const char *name;
MPP_RET (*open)(void **ctx, size_t alignment, MppAllocFlagType flags);
MPP_RET (*close)(void *ctx);
OsAllocatorFunc alloc;
OsAllocatorFunc free;
OsAllocatorFunc import;
OsAllocatorFunc release;
OsAllocatorFunc mmap;
/* allocator real flag update callback */
MppAllocFlagType (*flags)(void *ctx);
} os_allocator;
#endif /* MPP_ALLOCATOR_API_H */