[osal]: add normal mode mpp_buffer path to test and fix a lot of bug

git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@134 6e48237b-75ef-9749-8fc9-41990f28c85a
This commit is contained in:
ChenHengming
2015-08-20 03:23:36 +00:00
parent e78f44b2fb
commit 2e5aafaf44
9 changed files with 179 additions and 82 deletions

View File

@@ -15,13 +15,34 @@
*/
#include <stdlib.h>
#include <ion/ion.h>
#include "os_mem.h"
#include "os_allocator.h"
int os_allocator_open(void **ctx)
#include "mpp_mem.h"
#include "mpp_log.h"
typedef struct {
RK_S32 ion_client;
RK_U32 align;
} allocator_ion;
int os_allocator_open(void **ctx, size_t alignment)
{
if (ctx)
if (NULL == ctx) {
mpp_err("os_allocator_open Android do not accept NULL input\n");
return MPP_ERR_NULL_PTR;
}
allocator_ion *p = mpp_malloc(allocator_ion, 1);
if (NULL == p) {
*ctx = NULL;
mpp_err("os_allocator_open Android failed to allocate context\n");
return MPP_ERR_MALLOC;
}
p->ion_client =
*ctx = p;
return 0;
}