blob: 9c0392b6d08aafacba654ed4a7e9bd3c0beb7cc8 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
leozwang@webrtc.org0975d212012-03-06 20:59:13 +00002 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:25 +00003 *
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
14#include "voe_rtp_rtcp.h"
15
niklase@google.com470e71d2011-07-07 08:21:25 +000016#include "shared_data.h"
17
18namespace webrtc {
19
tommi@webrtc.orga990e122012-04-26 15:28:22 +000020class VoERTP_RTCPImpl : public VoERTP_RTCP
niklase@google.com470e71d2011-07-07 08:21:25 +000021{
22public:
niklase@google.com470e71d2011-07-07 08:21:25 +000023 // 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.org92135212013-05-14 08:31:39 +000053 unsigned char subType,
niklase@google.com470e71d2011-07-07 08:21:25 +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
66 virtual int SetRTPAudioLevelIndicationStatus(int channel,
67 bool enable,
68 unsigned char ID);
69
70 virtual int GetRTPAudioLevelIndicationStatus(int channel,
71 bool& enabled,
72 unsigned char& ID);
73
74 // CSRC
75 virtual int GetRemoteCSRCs(int channel, unsigned int arrCSRC[15]);
76
77 // Statistics
78 virtual int GetRTPStatistics(int channel,
79 unsigned int& averageJitterMs,
80 unsigned int& maxJitterMs,
81 unsigned int& discardedPackets);
82
83 virtual int GetRTCPStatistics(int channel, CallStatistics& stats);
84
henrika@webrtc.org8a2fc882012-08-22 08:53:55 +000085 virtual int GetRemoteRTCPSenderInfo(int channel, SenderInfo* sender_info);
86
87 virtual int GetRemoteRTCPReportBlocks(
88 int channel, std::vector<ReportBlock>* report_blocks);
89
niklase@google.com470e71d2011-07-07 08:21:25 +000090 // FEC
91 virtual int SetFECStatus(int channel,
92 bool enable,
93 int redPayloadtype = -1);
94
95 virtual int GetFECStatus(int channel, bool& enabled, int& redPayloadtype);
96
97 // Store RTP and RTCP packets and dump to file (compatible with rtpplay)
98 virtual int StartRTPDump(int channel,
99 const char fileNameUTF8[1024],
100 RTPDirections direction = kRtpIncoming);
101
102 virtual int StopRTPDump(int channel,
103 RTPDirections direction = kRtpIncoming);
104
105 virtual int RTPDumpIsActive(int channel,
106 RTPDirections direction = kRtpIncoming);
107
108 // Insert (and transmits) extra RTP packet into active RTP audio stream
109 virtual int InsertExtraRTPPacket(int channel,
110 unsigned char payloadType,
111 bool markerBit,
112 const char* payloadData,
113 unsigned short payloadSize);
roosa@google.com0870f022012-12-12 21:31:41 +0000114 virtual int GetLastRemoteTimeStamp(int channel,
115 uint32_t* lastRemoteTimeStamp);
niklase@google.com470e71d2011-07-07 08:21:25 +0000116protected:
tommi@webrtc.org851becd2012-04-04 14:57:19 +0000117 VoERTP_RTCPImpl(voe::SharedData* shared);
niklase@google.com470e71d2011-07-07 08:21:25 +0000118 virtual ~VoERTP_RTCPImpl();
tommi@webrtc.org851becd2012-04-04 14:57:19 +0000119
120private:
121 voe::SharedData* _shared;
niklase@google.com470e71d2011-07-07 08:21:25 +0000122};
123
124} // namespace webrtc
125
126#endif // WEBRTC_VOICE_ENGINE_VOE_RTP_RTCP_IMPL_H
127