blob: f902b662cdba74f0fc1abba82c8d5904b42b7f27 [file] [log] [blame]
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +00001/*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#ifndef WEBRTC_VOICE_ENGINE_VOE_RTP_RTCP_IMPL_H
12#define WEBRTC_VOICE_ENGINE_VOE_RTP_RTCP_IMPL_H
13
pbos@webrtc.org471ae722013-05-21 13:52:32 +000014#include "webrtc/voice_engine/include/voe_rtp_rtcp.h"
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000015
pbos@webrtc.org471ae722013-05-21 13:52:32 +000016#include "webrtc/voice_engine/shared_data.h"
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000017
18namespace webrtc {
19
20class VoERTP_RTCPImpl : public VoERTP_RTCP
21{
22public:
23 // Registration of observers for RTP and RTCP callbacks
24 virtual int RegisterRTPObserver(int channel, VoERTPObserver& observer);
25
26 virtual int DeRegisterRTPObserver(int channel);
27
28 virtual int RegisterRTCPObserver(int channel, VoERTCPObserver& observer);
29
30 virtual int DeRegisterRTCPObserver(int channel);
31
32 // RTCP
33 virtual int SetRTCPStatus(int channel, bool enable);
34
35 virtual int GetRTCPStatus(int channel, bool& enabled);
36
37 virtual int SetRTCP_CNAME(int channel, const char cName[256]);
38
39 virtual int GetRTCP_CNAME(int channel, char cName[256]);
40
41 virtual int GetRemoteRTCP_CNAME(int channel, char cName[256]);
42
43 virtual int GetRemoteRTCPData(int channel,
44 unsigned int& NTPHigh,
45 unsigned int& NTPLow,
46 unsigned int& timestamp,
47 unsigned int& playoutTimestamp,
48 unsigned int* jitter = NULL,
49 unsigned short* fractionLost = NULL);
50
51 virtual int SendApplicationDefinedRTCPPacket(
52 int channel,
pbos@webrtc.orgca7a9a22013-05-14 08:31:39 +000053 unsigned char subType,
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000054 unsigned int name,
55 const char* data,
56 unsigned short dataLengthInBytes);
57
58 // SSRC
59 virtual int SetLocalSSRC(int channel, unsigned int ssrc);
60
61 virtual int GetLocalSSRC(int channel, unsigned int& ssrc);
62
63 virtual int GetRemoteSSRC(int channel, unsigned int& ssrc);
64
65 // RTP Header Extension for Client-to-Mixer Audio Level Indication
wu@webrtc.org9a823222014-03-06 23:49:08 +000066 virtual int SetSendAudioLevelIndicationStatus(int channel,
67 bool enable,
68 unsigned char id);
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000069
wu@webrtc.org9a823222014-03-06 23:49:08 +000070 // RTP Header Extension for Absolute Sender Time
71 virtual int SetSendAbsoluteSenderTimeStatus(int channel,
72 bool enable,
73 unsigned char id);
74 virtual int SetReceiveAbsoluteSenderTimeStatus(int channel,
75 bool enable,
76 unsigned char id);
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000077
henrika@webrtc.org4845ee02014-02-19 08:58:08 +000078 // CSRC
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000079 virtual int GetRemoteCSRCs(int channel, unsigned int arrCSRC[15]);
80
81 // Statistics
82 virtual int GetRTPStatistics(int channel,
83 unsigned int& averageJitterMs,
84 unsigned int& maxJitterMs,
85 unsigned int& discardedPackets);
86
87 virtual int GetRTCPStatistics(int channel, CallStatistics& stats);
88
89 virtual int GetRemoteRTCPSenderInfo(int channel, SenderInfo* sender_info);
90
91 virtual int GetRemoteRTCPReportBlocks(
92 int channel, std::vector<ReportBlock>* report_blocks);
93
94 // FEC
95 virtual int SetFECStatus(int channel,
96 bool enable,
97 int redPayloadtype = -1);
98
99 virtual int GetFECStatus(int channel, bool& enabled, int& redPayloadtype);
100
niklas.enbom@webrtc.org2753b762013-05-31 21:13:52 +0000101 //NACK
102 virtual int SetNACKStatus(int channel,
103 bool enable,
104 int maxNoPackets);
105
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +0000106 // Store RTP and RTCP packets and dump to file (compatible with rtpplay)
107 virtual int StartRTPDump(int channel,
108 const char fileNameUTF8[1024],
109 RTPDirections direction = kRtpIncoming);
110
111 virtual int StopRTPDump(int channel,
112 RTPDirections direction = kRtpIncoming);
113
114 virtual int RTPDumpIsActive(int channel,
115 RTPDirections direction = kRtpIncoming);
116
roosa@google.comca771492012-12-12 21:31:41 +0000117 virtual int GetLastRemoteTimeStamp(int channel,
118 uint32_t* lastRemoteTimeStamp);
solenberg@webrtc.orgfec6b6e2014-03-24 10:38:25 +0000119 virtual int SetVideoEngineBWETarget(int channel, ViENetwork* vie_network,
120 int video_channel);
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +0000121protected:
122 VoERTP_RTCPImpl(voe::SharedData* shared);
123 virtual ~VoERTP_RTCPImpl();
124
125private:
126 voe::SharedData* _shared;
127};
128
129} // namespace webrtc
130
131#endif // WEBRTC_VOICE_ENGINE_VOE_RTP_RTCP_IMPL_H