mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-12-26 11:17:44 +01: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:
parent
8900385917
commit
bd43fac60e
2 changed files with 35 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue