IssueNo:#I40K06

Description:media servicing architecture
Sig:multimedia
Feature or Bgfix:Feature
Binary Source:No

Signed-off-by: z00421080 <zhangjian112@huawei.com>
This commit is contained in:
z00421080
2021-07-31 00:37:18 -07:00
parent a96384ab48
commit 1377d4b85d
36 changed files with 3030 additions and 866 deletions
+37
View File
@@ -14,6 +14,7 @@
*/
#include "frame_config.h"
#include "media_log.h"
#include "securec.h"
using namespace std;
@@ -45,10 +46,46 @@ void *FrameConfig::GetValue(uint32_t key)
return (p == keyMap_.end()) ? nullptr : (&p->second);
}
void FrameConfig::SetVendorParameter(uint8_t *value, uint32_t len)
{
if (value == nullptr) {
MEDIA_ERR_LOG("value is a nullptr");
return;
}
errno_t ret = memset_s(privateTag_, sizeof(privateTag_), 0, sizeof(privateTag_));
if (ret != EOK) {
MEDIA_ERR_LOG("memset failed when set private tag, ret(%d)", ret);
return;
}
ret = memcpy_s(privateTag_, sizeof(privateTag_), value, len);
if (ret != EOK) {
MEDIA_ERR_LOG("memcpy failed when set private tag, ret(%d)", ret);
}
}
void FrameConfig::GetVendorParameter(uint8_t *value, uint32_t len)
{
if (value == nullptr) {
MEDIA_ERR_LOG("value is a nullptr");
return;
}
uint32_t realLength = len > PRIVATE_TAG_LEN ? PRIVATE_TAG_LEN : len;
errno_t ret = memcpy_s(value, realLength, privateTag_, realLength);
if (ret != EOK) {
MEDIA_ERR_LOG("memcpy failed when get private tag, ret(%d)", ret);
}
}
void FrameConfig::SetValue(uint32_t key, const void *value)
{
if (value == nullptr) {
MEDIA_ERR_LOG("value is a nullptr");
return;
}
switch (key) {
case PARAM_KEY_IMAGE_ENCODE_QFACTOR:
case PARAM_KEY_STREAM_FPS:
case CAM_IMAGE_FORMAT:
keyMap_[key] = *(static_cast<const int32_t *>(value));
break;
default: