mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-05 17:16:50 +08:00
[mpp_buffer]: access the index field of buffer info
The external buffer would request the index of a buffer to manage it in an array. Change-Id: Ifbb169c75dfb6342b428b1fd640db9ec45ff5f73 Signed-off-by: Randy Li <randy.li@rock-chips.com>
This commit is contained in:
@@ -209,6 +209,33 @@ size_t mpp_buffer_get_size_with_caller(MppBuffer buffer, const char *caller)
|
||||
return p->info.size;
|
||||
}
|
||||
|
||||
int mpp_buffer_get_index_with_caller(MppBuffer buffer, const char *caller)
|
||||
{
|
||||
if (NULL == buffer) {
|
||||
mpp_err_f("invalid NULL input\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
MppBufferImpl *p = (MppBufferImpl*)buffer;
|
||||
(void)caller;
|
||||
return p->info.index;
|
||||
}
|
||||
|
||||
MPP_RET mpp_buffer_set_index_with_caller(MppBuffer buffer, int index,
|
||||
const char *caller)
|
||||
{
|
||||
if (NULL == buffer) {
|
||||
mpp_err_f("invalid NULL input\n");
|
||||
return MPP_ERR_UNKNOW;
|
||||
}
|
||||
|
||||
MppBufferImpl *p = (MppBufferImpl*)buffer;
|
||||
p->info.index = index;
|
||||
(void)caller;
|
||||
return MPP_OK;
|
||||
}
|
||||
|
||||
|
||||
MPP_RET mpp_buffer_info_get_with_caller(MppBuffer buffer, MppBufferInfo *info, const char *caller)
|
||||
{
|
||||
if (NULL == buffer || NULL == info) {
|
||||
|
Reference in New Issue
Block a user