blob: fb8bd542eb4c3c8088727600c4e1cf71cf874011 [file] [log] [blame]
andrew@webrtc.orga7b57da2012-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_VIDEO_ENGINE_VIE_RTP_RTCP_IMPL_H_
12#define WEBRTC_VIDEO_ENGINE_VIE_RTP_RTCP_IMPL_H_
13
pbos@webrtc.orgf2e6fb32013-05-17 13:44:48 +000014#include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h"
15#include "webrtc/typedefs.h"
16#include "webrtc/video_engine/include/vie_rtp_rtcp.h"
17#include "webrtc/video_engine/vie_ref_count.h"
andrew@webrtc.orga7b57da2012-10-22 18:19:23 +000018
19namespace webrtc {
20
21class ViESharedData;
22
23class ViERTP_RTCPImpl
24 : public ViERTP_RTCP,
25 public ViERefCount {
26 public:
27 // Implements ViERTP_RTCP.
28 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);
33 virtual int GetLocalSSRC(const int video_channel,
34 unsigned int& SSRC) const; // NOLINT
35 virtual int SetRemoteSSRCType(const int video_channel,
36 const StreamType usage,
37 const unsigned int SSRC) const;
38 virtual int GetRemoteSSRC(const int video_channel,
39 unsigned int& SSRC) const; // NOLINT
40 virtual int GetRemoteCSRCs(const int video_channel,
41 unsigned int CSRCs[kRtpCsrcSize]) const;
mflodman@webrtc.org06077c92013-04-12 14:55:46 +000042 virtual int SetRtxSendPayloadType(const int video_channel,
43 const uint8_t payload_type);
44 virtual int SetRtxReceivePayloadType(const int video_channel,
45 const uint8_t payload_type);
andrew@webrtc.orga7b57da2012-10-22 18:19:23 +000046 virtual int SetStartSequenceNumber(const int video_channel,
47 uint16_t sequence_number);
48 virtual int SetRTCPStatus(const int video_channel,
49 const ViERTCPMode rtcp_mode);
50 virtual int GetRTCPStatus(const int video_channel,
51 ViERTCPMode& rtcp_mode) const;
52 virtual int SetRTCPCName(const int video_channel,
53 const char rtcp_cname[KMaxRTCPCNameLength]);
54 virtual int GetRTCPCName(const int video_channel,
55 char rtcp_cname[KMaxRTCPCNameLength]) const;
56 virtual int GetRemoteRTCPCName(const int video_channel,
57 char rtcp_cname[KMaxRTCPCNameLength]) const;
58 virtual int SendApplicationDefinedRTCPPacket(
59 const int video_channel,
60 const unsigned char sub_type,
61 unsigned int name,
62 const char* data,
63 uint16_t data_length_in_bytes);
64 virtual int SetNACKStatus(const int video_channel, const bool enable);
65 virtual int SetFECStatus(const int video_channel, const bool enable,
66 const unsigned char payload_typeRED,
67 const unsigned char payload_typeFEC);
68 virtual int SetHybridNACKFECStatus(const int video_channel, const bool enable,
69 const unsigned char payload_typeRED,
70 const unsigned char payload_typeFEC);
mikhal@webrtc.org4db69af2013-02-15 23:22:18 +000071 virtual int SetSenderBufferingMode(int video_channel,
72 int target_delay_ms);
73 virtual int SetReceiverBufferingMode(int video_channel,
74 int target_delay_ms);
andrew@webrtc.orga7b57da2012-10-22 18:19:23 +000075 virtual int SetKeyFrameRequestMethod(const int video_channel,
76 const ViEKeyFrameRequestMethod method);
77 virtual int SetTMMBRStatus(const int video_channel, const bool enable);
78 virtual int SetRembStatus(int video_channel, bool sender, bool receiver);
andrew@webrtc.orga7b57da2012-10-22 18:19:23 +000079 virtual int SetSendTimestampOffsetStatus(int video_channel,
80 bool enable,
81 int id);
82 virtual int SetReceiveTimestampOffsetStatus(int video_channel,
83 bool enable,
84 int id);
85 virtual int SetTransmissionSmoothingStatus(int video_channel, bool enable);
86 virtual int GetReceivedRTCPStatistics(const int video_channel,
87 uint16_t& fraction_lost,
88 unsigned int& cumulative_lost,
89 unsigned int& extended_max,
90 unsigned int& jitter,
91 int& rtt_ms) const;
92 virtual int GetSentRTCPStatistics(const int video_channel,
93 uint16_t& fraction_lost,
94 unsigned int& cumulative_lost,
95 unsigned int& extended_max,
96 unsigned int& jitter, int& rtt_ms) const;
97 virtual int GetRTPStatistics(const int video_channel,
98 unsigned int& bytes_sent,
99 unsigned int& packets_sent,
100 unsigned int& bytes_received,
101 unsigned int& packets_received) const;
102 virtual int GetBandwidthUsage(const int video_channel,
103 unsigned int& total_bitrate_sent,
104 unsigned int& video_bitrate_sent,
105 unsigned int& fec_bitrate_sent,
106 unsigned int& nackBitrateSent) const;
107 virtual int GetEstimatedSendBandwidth(
108 const int video_channel,
109 unsigned int* estimated_bandwidth) const;
110 virtual int GetEstimatedReceiveBandwidth(
111 const int video_channel,
112 unsigned int* estimated_bandwidth) const;
andrew@webrtc.orga7b57da2012-10-22 18:19:23 +0000113 virtual int StartRTPDump(const int video_channel,
114 const char file_nameUTF8[1024],
115 RTPDirections direction);
116 virtual int StopRTPDump(const int video_channel, RTPDirections direction);
117 virtual int RegisterRTPObserver(const int video_channel,
118 ViERTPObserver& observer);
119 virtual int DeregisterRTPObserver(const int video_channel);
120 virtual int RegisterRTCPObserver(const int video_channel,
121 ViERTCPObserver& observer);
122 virtual int DeregisterRTCPObserver(const int video_channel);
123
124 protected:
125 explicit ViERTP_RTCPImpl(ViESharedData* shared_data);
126 virtual ~ViERTP_RTCPImpl();
127
128 private:
129 ViESharedData* shared_data_;
130};
131
132} // namespace webrtc
133
134#endif // WEBRTC_VIDEO_ENGINE_VIE_RTP_RTCP_IMPL_H_