• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 "ohos_adapter/bridge/ark_audio_decoder_format_adapter_impl.h"
17 #include "base/bridge/ark_web_bridge_macros.h"
18 
19 namespace OHOS::ArkWeb {
20 
ArkAudioDecoderFormatAdapterImpl(std::shared_ptr<OHOS::NWeb::AudioDecoderFormatAdapter> ref)21 ArkAudioDecoderFormatAdapterImpl::ArkAudioDecoderFormatAdapterImpl(
22     std::shared_ptr<OHOS::NWeb::AudioDecoderFormatAdapter> ref) : real_(ref)
23 {}
24 
GetSampleRate()25 int32_t ArkAudioDecoderFormatAdapterImpl::GetSampleRate()
26 {
27     return real_->GetSampleRate();
28 }
29 
GetChannelCount()30 int32_t ArkAudioDecoderFormatAdapterImpl::GetChannelCount()
31 {
32     return real_->GetChannelCount();
33 }
34 
GetBitRate()35 int64_t ArkAudioDecoderFormatAdapterImpl::GetBitRate()
36 {
37     return real_->GetBitRate();
38 }
39 
GetMaxInputSize()40 int32_t ArkAudioDecoderFormatAdapterImpl::GetMaxInputSize()
41 {
42     return real_->GetMaxInputSize();
43 }
44 
GetAACIsAdts()45 bool ArkAudioDecoderFormatAdapterImpl::GetAACIsAdts()
46 {
47     return real_->GetAACIsAdts();
48 }
49 
GetAudioSampleFormat()50 int32_t ArkAudioDecoderFormatAdapterImpl::GetAudioSampleFormat()
51 {
52     return real_->GetAudioSampleFormat();
53 }
54 
GetIdentificationHeader()55 int32_t ArkAudioDecoderFormatAdapterImpl::GetIdentificationHeader()
56 {
57     return real_->GetIdentificationHeader();
58 }
59 
GetSetupHeader()60 int32_t ArkAudioDecoderFormatAdapterImpl::GetSetupHeader()
61 {
62     return real_->GetSetupHeader();
63 }
64 
GetCodecConfig()65 uint8_t* ArkAudioDecoderFormatAdapterImpl::GetCodecConfig()
66 {
67     return real_->GetCodecConfig();
68 }
69 
GetCodecConfigSize()70 uint32_t ArkAudioDecoderFormatAdapterImpl::GetCodecConfigSize()
71 {
72     return real_->GetCodecConfigSize();
73 }
74 
SetSampleRate(int32_t sampleRate)75 void ArkAudioDecoderFormatAdapterImpl::SetSampleRate(int32_t sampleRate)
76 {
77     real_->SetSampleRate(sampleRate);
78 }
79 
SetChannelCount(int32_t channelCount)80 void ArkAudioDecoderFormatAdapterImpl::SetChannelCount(int32_t channelCount)
81 {
82     real_->SetChannelCount(channelCount);
83 }
84 
SetBitRate(int64_t bitRate)85 void ArkAudioDecoderFormatAdapterImpl::SetBitRate(int64_t bitRate)
86 {
87     real_->SetBitRate(bitRate);
88 }
89 
SetMaxInputSize(int32_t maxInputSize)90 void ArkAudioDecoderFormatAdapterImpl::SetMaxInputSize(int32_t maxInputSize)
91 {
92     real_->SetMaxInputSize(maxInputSize);
93 }
94 
SetAACIsAdts(bool isAdts)95 void ArkAudioDecoderFormatAdapterImpl::SetAACIsAdts(bool isAdts)
96 {
97     real_->SetAACIsAdts(isAdts);
98 }
99 
SetAudioSampleFormat(int32_t audioSampleFormat)100 void ArkAudioDecoderFormatAdapterImpl::SetAudioSampleFormat(int32_t audioSampleFormat)
101 {
102     real_->SetSetupHeader(audioSampleFormat);
103 }
104 
SetSetupHeader(int32_t setupHeader)105 void ArkAudioDecoderFormatAdapterImpl::SetSetupHeader(int32_t setupHeader)
106 {
107     real_->SetSetupHeader(setupHeader);
108 }
109 
SetIdentificationHeader(int32_t idHeader)110 void ArkAudioDecoderFormatAdapterImpl::SetIdentificationHeader(int32_t idHeader)
111 {
112     real_->SetIdentificationHeader(idHeader);
113 }
114 
SetCodecConfig(uint8_t * codecConfig)115 void ArkAudioDecoderFormatAdapterImpl::SetCodecConfig(uint8_t *codecConfig)
116 {
117     real_->SetCodecConfig(codecConfig);
118 }
119 
SetCodecConfigSize(uint32_t size)120 void ArkAudioDecoderFormatAdapterImpl::SetCodecConfigSize(uint32_t size)
121 {
122     real_->SetCodecConfigSize(size);
123 }
124 
125 } // namespace OHOS::ArkWeb
126