[mpp_buffer]: Add offset property

1. Add offset set / get function to MppBuffer
2. Add U32 register address converstion function.

Change-Id: Id297b7a05e47d4e249f5e33c1924a0539729c808
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
Herman Chen
2020-03-19 19:46:31 +08:00
parent ad0d2179a9
commit 6a76bfc3f5
4 changed files with 58 additions and 0 deletions

View File

@@ -235,6 +235,30 @@ MPP_RET mpp_buffer_set_index_with_caller(MppBuffer buffer, int index,
return MPP_OK;
}
size_t mpp_buffer_get_offset_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->offset;
}
MPP_RET mpp_buffer_set_offset_with_caller(MppBuffer buffer, size_t offset, const char *caller)
{
if (NULL == buffer) {
mpp_err_f("invalid NULL input\n");
return MPP_ERR_UNKNOW;
}
MppBufferImpl *p = (MppBufferImpl*)buffer;
p->offset = offset;
(void)caller;
return MPP_OK;
}
MPP_RET mpp_buffer_info_get_with_caller(MppBuffer buffer, MppBufferInfo *info, const char *caller)
{