mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-03 16:26:24 +08:00

git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@114 6e48237b-75ef-9749-8fc9-41990f28c85a
67 lines
1.8 KiB
C
67 lines
1.8 KiB
C
/*
|
|
* 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__*/
|