• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2023 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 "avcodec_log.h"
17 #ifndef CLIENT_SUPPORT_CODEC
18 #include "fcodec.h"
19 #endif
20 #include "avcodec_errors.h"
21 #include "audio_codeclist_info.h"
22 #include "codeclist_builder.h"
23 
24 namespace {
25 constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN, "CodecList_builder"};
26 }
27 namespace OHOS {
28 namespace MediaAVCodec {
29 #ifndef CLIENT_SUPPORT_CODEC
GetCapabilityList(std::vector<CapabilityData> & caps)30 int32_t VideoCodecList::GetCapabilityList(std::vector<CapabilityData> &caps)
31 {
32     auto ret = Codec::FCodec::GetCodecCapability(caps);
33     if (ret == AVCS_ERR_OK) {
34         AVCODEC_LOGI("Get capability from fcodec successful");
35     }
36     return ret;
37 }
38 #endif
GetCapabilityList(std::vector<CapabilityData> & caps)39 int32_t AudioCodecList::GetCapabilityList(std::vector<CapabilityData> &caps)
40 {
41     auto audioCapabilities = AudioCodeclistInfo::GetInstance().GetAudioCapabilities();
42     for (const auto &v : audioCapabilities) {
43         caps.emplace_back(v);
44     }
45     AVCODEC_LOGI("Get capability from audio codec list successful");
46     return AVCS_ERR_OK;
47 }
48 } // namespace MediaAVCodec
49 } // namespace OHOS