[mpi]: add basic mpi empty function

git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@114 6e48237b-75ef-9749-8fc9-41990f28c85a
This commit is contained in:
ChenHengming
2015-08-17 09:16:26 +00:00
parent 70671a1cca
commit 32c1b2f18c
9 changed files with 386 additions and 0 deletions

66
inc/mpp_buffer.h Normal file
View File

@@ -0,0 +1,66 @@
/*
* Copyright 2010 Rockchip Electronics S.LSI Co. LTD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __RK_MPI_BUFFER_H__
#define __RK_MPI_BUFFER_H__
#include "rk_type.h"
#include "mpp_err.h"
typedef void* MppBuffer;
typedef void* MppBufferPool;
typedef struct {
RK_U32 api_size;
RK_U32 api_version;
MPP_RET (*commit)(MppBufferPool pool, MppBuffer buffer);
MPP_RET (*get_unused)(MppBufferPool pool, MppBuffer *buffer);
MPP_RET (*ref_used)(MppBufferPool pool, MppBuffer buffer);
MPP_RET (*unref_used)(MppBufferPool pool, MppBuffer buffer);
MPP_RET (*reset)(MppBufferPool pool);
RK_S32 (*get_unsed_num)(MppBufferPool pool);
RK_U32 reserv[16];
} MppBufferPoolApi;
#ifdef __cplusplus
extern "C" {
#endif
/*
* MppBufferPool interface
*/
MPP_RET mpp_buffer_init(MppBuffer *buffer, RK_U32 type, RK_U32 size);
MPP_RET mpp_buffer_deinit(MppBuffer *buffer);
MPP_RET mpp_buffer_inc_ref(MppBuffer buffer);
MPP_RET mpp_buffer_dec_ref(MppBuffer buffer);
/*
* MppBufferPool interface
*/
MPP_RET mpp_buffer_pool_init(MppBufferPool *pool, RK_U32 count, RK_U32 size);
MPP_RET mpp_buffer_pool_get_api(MppBufferPool pool, MppBufferPoolApi *api);
MPP_RET mpp_buffer_pool_deinit(MppBufferPool *pool);
#ifdef __cplusplus
}
#endif
#endif /*__RK_MPI_BUFFER_H__*/