mirror of
https://github.com/openharmony/multimedia_camera_lite.git
synced 2026-07-20 01:03:35 -04:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user