• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include <sstream>
17 #include <string>
18 #include "hcodec_utils.h"
19 #include "qos.h"
20 
21 namespace OHOS::MediaAVCodec {
StringifyMeta(std::shared_ptr<Media::Meta> & meta)22 std::string StringifyMeta(std::shared_ptr<Media::Meta> &meta)
23 {
24     std::stringstream dumpStream;
25     for (auto iter = meta->begin(); iter != meta->end(); ++iter) {
26         switch (meta->GetValueType(iter->first)) {
27             case OHOS::Media::AnyValueType::INT32_T:
28                 dumpStream << iter->first << " = " << std::to_string(Media::AnyCast<int32_t>(iter->second)) << " | ";
29                 break;
30             case OHOS::Media::AnyValueType::UINT32_T:
31                 dumpStream << iter->first << " = " << std::to_string(Media::AnyCast<uint32_t>(iter->second)) << " | ";
32                 break;
33             case OHOS::Media::AnyValueType::BOOL:
34                 dumpStream << iter->first << " = " << std::to_string(Media::AnyCast<bool>(iter->second)) << " | ";
35                 break;
36             case OHOS::Media::AnyValueType::DOUBLE:
37                 dumpStream << iter->first << " = " << std::to_string(Media::AnyCast<double>(iter->second)) << " | ";
38                 break;
39             case OHOS::Media::AnyValueType::INT64_T:
40                 dumpStream << iter->first << " = " << std::to_string(Media::AnyCast<int64_t>(iter->second)) << " | ";
41                 break;
42             case OHOS::Media::AnyValueType::FLOAT:
43                 dumpStream << iter->first << " = " << std::to_string(Media::AnyCast<float>(iter->second)) << " | ";
44                 break;
45             default:
46                 dumpStream << iter->first << " = " << "unknown type | ";
47                 break;
48         }
49     }
50     return dumpStream.str();
51 }
52 
SetThreadInteractiveQos(bool enable)53 void SetThreadInteractiveQos(bool enable)
54 {
55     (void)enable;
56 }
57 }
58