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