已合并
fix codecheck #2674
lxgang_1997创建于 7月15日
fix codecheck #2674
已合并
共 2 个文件变更+19-0
| @@ -41,6 +41,8 @@ enum FormatDataType : uint32_t { | |||
| 41 | FORMAT_TYPE_ADDR, | 41 | FORMAT_TYPE_ADDR, |
| 42 | /* Uint32 */ | 42 | /* Uint32 */ |
| 43 | FORMAT_TYPE_UINT32, | 43 | FORMAT_TYPE_UINT32, |
| 44 | + /* Int32 Vector */ | ||
| 45 | + FORMAT_TYPE_INT32_VECTOR, | ||
| 44 | }; | 46 | }; |
| 45 | 47 | ||
| 46 | struct FormatData { | 48 | struct FormatData { |
| @@ -412,6 +412,8 @@ FormatDataType Format::GetValueType(const std::string_view &key) const | |||
| 412 | return FORMAT_TYPE_STRING; | 412 | return FORMAT_TYPE_STRING; |
| 413 | } else if (Any::IsSameTypeWith<std::vector<uint8_t>>(iter->second)) { | 413 | } else if (Any::IsSameTypeWith<std::vector<uint8_t>>(iter->second)) { |
| 414 | return FORMAT_TYPE_ADDR; | 414 | return FORMAT_TYPE_ADDR; |
| 415 | + } else if (Any::IsSameTypeWith<std::vector<int32_t>>(iter->second)) { | ||
| 416 | + return FORMAT_TYPE_INT32_VECTOR; | ||
| 415 | } else { | 417 | } else { |
| 416 | int64_t valueTemp; | 418 | int64_t valueTemp; |
| 417 | bool isLongValue = GetMetaData(*meta_, std::string(key), valueTemp); | 419 | bool isLongValue = GetMetaData(*meta_, std::string(key), valueTemp); |
| @@ -463,6 +465,13 @@ const Format::FormatDataMap &Format::GetFormatMap() const | |||
| 463 | ret = PutBufferToFormatMap(formatTemp, iter->first, addr, size); | 465 | ret = PutBufferToFormatMap(formatTemp, iter->first, addr, size); |
| 464 | break; | 466 | break; |
| 465 | } | 467 | } |
| 468 | + case FORMAT_TYPE_INT32_VECTOR: { | ||
| 469 | + Any *value = const_cast<Any *>(&(iter->second)); | ||
| 470 | + int32_t *addr = (AnyCast<std::vector<int32_t>>(value))->data(); | ||
| 471 | + size_t size = (AnyCast<std::vector<int32_t>>(value))->size(); | ||
| 472 | + ret = PutIntBufferToFormatMap(formatTemp, iter->first, addr, size); | ||
| 473 | + break; | ||
| 474 | + } | ||
| 466 | default: | 475 | default: |
| 467 | MEDIA_LOG_E("Format::Stringify failed. Key: %{public}s", iter->first.c_str()); | 476 | MEDIA_LOG_E("Format::Stringify failed. Key: %{public}s", iter->first.c_str()); |
| 468 | } | 477 | } |
| @@ -510,6 +519,14 @@ std::string Format::Stringify() const | |||
| 510 | } | 519 | } |
| 511 | break; | 520 | break; |
| 512 | } | 521 | } |
| 522 | + case FORMAT_TYPE_INT32_VECTOR: { | ||
| 523 | + Any *value = const_cast<Any *>(&(iter->second)); | ||
| 524 | + if (AnyCast<std::vector<int32_t>>(value) != nullptr) { | ||
| 525 | + dumpStream << iter->first << ", bufferSize = " << (AnyCast<std::vector<int32_t>>(value))->size() | ||
| 526 | + << " | "; | ||
| 527 | + } | ||
| 528 | + break; | ||
| 529 | + } | ||
| 513 | default: | 530 | default: |
| 514 | MEDIA_LOG_E("Format::Stringify failed. Key: %{public}s", iter->first.c_str()); | 531 | MEDIA_LOG_E("Format::Stringify failed. Key: %{public}s", iter->first.c_str()); |
| 515 | } | 532 | } |