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 TEXT_SESSION_H
18 #define TEXT_SESSION_H
19 
20 #include <ImsMediaDefine.h>
21 #include <BaseSession.h>
22 #include <TextStreamGraphRtpTx.h>
23 #include <TextStreamGraphRtpRx.h>
24 #include <TextStreamGraphRtcp.h>
25 #include <RtpConfig.h>
26 
27 class TextSession : public BaseSession
28 {
29 public:
30     TextSession();
31     virtual ~TextSession();
32     virtual SessionState getState();
33     virtual ImsMediaResult startGraph(RtpConfig* config);
34     // BaseSessionCallback
35     virtual void onEvent(int32_t type, uint64_t param1, uint64_t param2);
36     ImsMediaResult sendRtt(const android::String8* text);
37 
38     /**
39      * @brief move session to inactive. i.e., Rtp Tx and Rtp Rx graphs are stopped
40      *
41      * @return bool false if failed to move session to inactive
42      */
43     bool deactivate();
44 
45 private:
46     TextStreamGraphRtpTx* mGraphRtpTx;
47     TextStreamGraphRtpRx* mGraphRtpRx;
48     TextStreamGraphRtcp* mGraphRtcp;
49 };
50 
51 #endif