blob: 1c1971ae0774aaf5aa7e4906a17796dc7051168f [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
stefan@webrtc.org07b45a52012-02-02 08:37:48 +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
mflodman@webrtc.orge06ca3c2012-06-29 13:20:14 +000011#ifndef WEBRTC_VIDEO_ENGINE_VIE_RTP_RTCP_IMPL_H_
12#define WEBRTC_VIDEO_ENGINE_VIE_RTP_RTCP_IMPL_H_
niklase@google.com470e71d2011-07-07 08:21:25 +000013
mflodman@webrtc.org8da24172011-12-19 14:18:41 +000014#include "modules/rtp_rtcp/interface/rtp_rtcp_defines.h"
mflodman@webrtc.org9ba151b2012-06-21 10:02:13 +000015#include "typedefs.h" // NOLINT
mflodman@webrtc.orga4863db2011-12-22 08:51:52 +000016#include "video_engine/include/vie_rtp_rtcp.h"
mflodman@webrtc.org8da24172011-12-19 14:18:41 +000017#include "video_engine/vie_ref_count.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000018
mflodman@webrtc.org8da24172011-12-19 14:18:41 +000019namespace webrtc {
niklase@google.com470e71d2011-07-07 08:21:25 +000020
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000021class ViESharedData;
22
mflodman@webrtc.org8da24172011-12-19 14:18:41 +000023class ViERTP_RTCPImpl
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000024 : public ViERTP_RTCP,
mflodman@webrtc.org8da24172011-12-19 14:18:41 +000025 public ViERefCount {
26 public:
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000027 // Implements ViERTP_RTCP.
mflodman@webrtc.org8da24172011-12-19 14:18:41 +000028 virtual int Release();
29 virtual int SetLocalSSRC(const int video_channel,
30 const unsigned int SSRC,
31 const StreamType usage,
32 const unsigned char simulcast_idx);
mflodman@webrtc.org9ba151b2012-06-21 10:02:13 +000033 virtual int GetLocalSSRC(const int video_channel,
34 unsigned int& SSRC) const; // NOLINT
mflodman@webrtc.org8da24172011-12-19 14:18:41 +000035 virtual int SetRemoteSSRCType(const int video_channel,
36 const StreamType usage,
37 const unsigned int SSRC) const;
mflodman@webrtc.org9ba151b2012-06-21 10:02:13 +000038 virtual int GetRemoteSSRC(const int video_channel,
39 unsigned int& SSRC) const; // NOLINT
mflodman@webrtc.org8da24172011-12-19 14:18:41 +000040 virtual int GetRemoteCSRCs(const int video_channel,
41 unsigned int CSRCs[kRtpCsrcSize]) const;
42 virtual int SetStartSequenceNumber(const int video_channel,
mflodman@webrtc.org9ba151b2012-06-21 10:02:13 +000043 uint16_t sequence_number);
mflodman@webrtc.org8da24172011-12-19 14:18:41 +000044 virtual int SetRTCPStatus(const int video_channel,
45 const ViERTCPMode rtcp_mode);
46 virtual int GetRTCPStatus(const int video_channel,
47 ViERTCPMode& rtcp_mode) const;
48 virtual int SetRTCPCName(const int video_channel,
49 const char rtcp_cname[KMaxRTCPCNameLength]);
50 virtual int GetRTCPCName(const int video_channel,
51 char rtcp_cname[KMaxRTCPCNameLength]) const;
52 virtual int GetRemoteRTCPCName(const int video_channel,
53 char rtcp_cname[KMaxRTCPCNameLength]) const;
54 virtual int SendApplicationDefinedRTCPPacket(
55 const int video_channel,
56 const unsigned char sub_type,
57 unsigned int name,
58 const char* data,
mflodman@webrtc.org9ba151b2012-06-21 10:02:13 +000059 uint16_t data_length_in_bytes);
mflodman@webrtc.org8da24172011-12-19 14:18:41 +000060 virtual int SetNACKStatus(const int video_channel, const bool enable);
61 virtual int SetFECStatus(const int video_channel, const bool enable,
62 const unsigned char payload_typeRED,
63 const unsigned char payload_typeFEC);
64 virtual int SetHybridNACKFECStatus(const int video_channel, const bool enable,
65 const unsigned char payload_typeRED,
66 const unsigned char payload_typeFEC);
mikhal@webrtc.orgef9f76a2013-02-15 23:22:18 +000067 virtual int SetSenderBufferingMode(int video_channel,
68 int target_delay_ms);
69 virtual int SetReceiverBufferingMode(int video_channel,
70 int target_delay_ms);
mflodman@webrtc.org8da24172011-12-19 14:18:41 +000071 virtual int SetKeyFrameRequestMethod(const int video_channel,
72 const ViEKeyFrameRequestMethod method);
73 virtual int SetTMMBRStatus(const int video_channel, const bool enable);
mflodman@webrtc.org6cf529d2012-01-24 06:16:16 +000074 virtual int SetRembStatus(int video_channel, bool sender, bool receiver);
stefan@webrtc.org976a7e62012-09-21 13:20:21 +000075 virtual int SetBandwidthEstimationMode(BandwidthEstimationMode mode);
mflodman@webrtc.org90071dd2012-08-13 17:13:27 +000076 virtual int SetSendTimestampOffsetStatus(int video_channel,
77 bool enable,
78 int id);
79 virtual int SetReceiveTimestampOffsetStatus(int video_channel,
80 bool enable,
81 int id);
mflodman@webrtc.org5a7507f2012-09-12 13:47:06 +000082 virtual int SetTransmissionSmoothingStatus(int video_channel, bool enable);
mflodman@webrtc.org8da24172011-12-19 14:18:41 +000083 virtual int GetReceivedRTCPStatistics(const int video_channel,
mflodman@webrtc.org9ba151b2012-06-21 10:02:13 +000084 uint16_t& fraction_lost,
mflodman@webrtc.org8da24172011-12-19 14:18:41 +000085 unsigned int& cumulative_lost,
86 unsigned int& extended_max,
87 unsigned int& jitter,
88 int& rtt_ms) const;
89 virtual int GetSentRTCPStatistics(const int video_channel,
mflodman@webrtc.org9ba151b2012-06-21 10:02:13 +000090 uint16_t& fraction_lost,
mflodman@webrtc.org8da24172011-12-19 14:18:41 +000091 unsigned int& cumulative_lost,
92 unsigned int& extended_max,
93 unsigned int& jitter, int& rtt_ms) const;
94 virtual int GetRTPStatistics(const int video_channel,
95 unsigned int& bytes_sent,
96 unsigned int& packets_sent,
97 unsigned int& bytes_received,
98 unsigned int& packets_received) const;
99 virtual int GetBandwidthUsage(const int video_channel,
100 unsigned int& total_bitrate_sent,
101 unsigned int& video_bitrate_sent,
102 unsigned int& fec_bitrate_sent,
103 unsigned int& nackBitrateSent) const;
stefan@webrtc.org439be292012-02-16 14:45:37 +0000104 virtual int GetEstimatedSendBandwidth(
105 const int video_channel,
106 unsigned int* estimated_bandwidth) const;
107 virtual int GetEstimatedReceiveBandwidth(
stefan@webrtc.org07b45a52012-02-02 08:37:48 +0000108 const int video_channel,
109 unsigned int* estimated_bandwidth) const;
astor@webrtc.orgc0496e62012-08-10 10:14:43 +0000110 virtual int SetOverUseDetectorOptions(
111 const OverUseDetectorOptions& options) const;
mflodman@webrtc.org8da24172011-12-19 14:18:41 +0000112 virtual int StartRTPDump(const int video_channel,
113 const char file_nameUTF8[1024],
114 RTPDirections direction);
115 virtual int StopRTPDump(const int video_channel, RTPDirections direction);
116 virtual int RegisterRTPObserver(const int video_channel,
117 ViERTPObserver& observer);
118 virtual int DeregisterRTPObserver(const int video_channel);
119 virtual int RegisterRTCPObserver(const int video_channel,
120 ViERTCPObserver& observer);
121 virtual int DeregisterRTCPObserver(const int video_channel);
niklase@google.com470e71d2011-07-07 08:21:25 +0000122
mflodman@webrtc.org8da24172011-12-19 14:18:41 +0000123 protected:
mflodman@webrtc.org9ba151b2012-06-21 10:02:13 +0000124 explicit ViERTP_RTCPImpl(ViESharedData* shared_data);
mflodman@webrtc.org8da24172011-12-19 14:18:41 +0000125 virtual ~ViERTP_RTCPImpl();
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000126
127 private:
128 ViESharedData* shared_data_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000129};
mflodman@webrtc.org8da24172011-12-19 14:18:41 +0000130
131} // namespace webrtc
132
mflodman@webrtc.orge06ca3c2012-06-29 13:20:14 +0000133#endif // WEBRTC_VIDEO_ENGINE_VIE_RTP_RTCP_IMPL_H_