• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 AUDIO_STREAM_GRAPH_RTP_RX_H
18 #define AUDIO_STREAM_GRAPH_RTP_RX_H
19 
20 #include <ImsMediaDefine.h>
21 #include <AudioStreamGraph.h>
22 
23 class AudioStreamGraphRtpRx : public AudioStreamGraph
24 {
25 public:
26     AudioStreamGraphRtpRx(BaseSessionCallback* callback, int localFd = 0);
27     virtual ~AudioStreamGraphRtpRx();
28     virtual ImsMediaResult create(RtpConfig* config);
29     virtual ImsMediaResult update(RtpConfig* config);
30     virtual ImsMediaResult start();
31 
32     /**
33      * @brief Set the cmr value to change the audio mode
34      *
35      * @param cmrType The 3 bit of cmr type for EVS and just cmr bit for AMR/AMR-WB codec
36      * @param cmrDefine The 4 bit of cmr define code for EVS and not used for AMR/AMR-WB codec
37      */
38     void processCmr(const uint32_t cmrType, const uint32_t cmrDefine);
39 
40     /**
41      * @brief Adjust the delay in the jitter buffer to synchronize the audio with the time of video
42      *        frames
43      *
44      * @param delayMs The additional delay to the jitter buffer in milliseconds unit. The value is
45      *        always positive.
46      */
47     void adjustDelay(const int32_t delayMs);
48 };
49 
50 #endif