1 /** 2 * Copyright (C) 2022 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef IAUDIO_PLAYER_NODE_H_INCLUDED 18 #define IAUDIO_PLAYER_NODE_H_INCLUDED 19 20 #include <BaseNode.h> 21 #include <JitterBufferControlNode.h> 22 #include <IImsMediaThread.h> 23 #include <ImsMediaCondition.h> 24 #include <ImsMediaAudioPlayer.h> 25 #include <AudioConfig.h> 26 #include <mutex> 27 28 /** 29 * @brief This class describes an interface between depacketization module and audio device 30 */ 31 class IAudioPlayerNode : public JitterBufferControlNode, IImsMediaThread 32 { 33 public: 34 IAudioPlayerNode(BaseSessionCallback* callback = nullptr); 35 virtual ~IAudioPlayerNode(); 36 virtual kBaseNodeId GetNodeId(); 37 virtual ImsMediaResult Start(); 38 virtual void Stop(); 39 virtual bool IsRunTime(); 40 virtual bool IsSourceNode(); 41 virtual void SetConfig(void* config); 42 virtual bool IsSameConfig(void* config); 43 virtual void* run(); 44 void ProcessCmr(const uint32_t cmrType, const uint32_t cmrDefine); 45 void AdjustDelay(const int32_t delayMs); 46 47 private: 48 AudioConfig* mConfig; 49 std::unique_ptr<ImsMediaAudioPlayer> mAudioPlayer; 50 int32_t mCodecType; 51 uint32_t mMode; 52 ImsMediaCondition mCondition; 53 int8_t mEvsChannelAwOffset; 54 kEvsBandwidth mEvsBandwidth; 55 int8_t mSamplingRate; 56 int32_t mEvsPayloadHeaderMode; 57 int32_t mAnbrDownlinkMode; 58 bool mIsDtxEnabled; 59 bool mIsOctetAligned; 60 uint32_t mRunningCodecMode; 61 }; 62 63 #endif 64