andrew@webrtc.org | a7b57da | 2012-10-22 18:19:23 +0000 | [diff] [blame^] | 1 | /* |
| 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 | |
| 14 | #include "modules/rtp_rtcp/interface/rtp_rtcp_defines.h" |
| 15 | #include "typedefs.h" // NOLINT |
| 16 | #include "video_engine/include/vie_rtp_rtcp.h" |
| 17 | #include "video_engine/vie_ref_count.h" |
| 18 | |
| 19 | namespace webrtc { |
| 20 | |
| 21 | class ViESharedData; |
| 22 | |
| 23 | class 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; |
| 42 | virtual int SetStartSequenceNumber(const int video_channel, |
| 43 | uint16_t sequence_number); |
| 44 | 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, |
| 59 | uint16_t data_length_in_bytes); |
| 60 | 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); |
| 67 | virtual int SetKeyFrameRequestMethod(const int video_channel, |
| 68 | const ViEKeyFrameRequestMethod method); |
| 69 | virtual int SetTMMBRStatus(const int video_channel, const bool enable); |
| 70 | virtual int SetRembStatus(int video_channel, bool sender, bool receiver); |
| 71 | virtual int SetBandwidthEstimationMode(BandwidthEstimationMode mode); |
| 72 | virtual int SetSendTimestampOffsetStatus(int video_channel, |
| 73 | bool enable, |
| 74 | int id); |
| 75 | virtual int SetReceiveTimestampOffsetStatus(int video_channel, |
| 76 | bool enable, |
| 77 | int id); |
| 78 | virtual int SetTransmissionSmoothingStatus(int video_channel, bool enable); |
| 79 | virtual int GetReceivedRTCPStatistics(const int video_channel, |
| 80 | uint16_t& fraction_lost, |
| 81 | unsigned int& cumulative_lost, |
| 82 | unsigned int& extended_max, |
| 83 | unsigned int& jitter, |
| 84 | int& rtt_ms) const; |
| 85 | virtual int GetSentRTCPStatistics(const int video_channel, |
| 86 | uint16_t& fraction_lost, |
| 87 | unsigned int& cumulative_lost, |
| 88 | unsigned int& extended_max, |
| 89 | unsigned int& jitter, int& rtt_ms) const; |
| 90 | virtual int GetRTPStatistics(const int video_channel, |
| 91 | unsigned int& bytes_sent, |
| 92 | unsigned int& packets_sent, |
| 93 | unsigned int& bytes_received, |
| 94 | unsigned int& packets_received) const; |
| 95 | virtual int GetBandwidthUsage(const int video_channel, |
| 96 | unsigned int& total_bitrate_sent, |
| 97 | unsigned int& video_bitrate_sent, |
| 98 | unsigned int& fec_bitrate_sent, |
| 99 | unsigned int& nackBitrateSent) const; |
| 100 | virtual int GetEstimatedSendBandwidth( |
| 101 | const int video_channel, |
| 102 | unsigned int* estimated_bandwidth) const; |
| 103 | virtual int GetEstimatedReceiveBandwidth( |
| 104 | const int video_channel, |
| 105 | unsigned int* estimated_bandwidth) const; |
| 106 | virtual int SetOverUseDetectorOptions( |
| 107 | const OverUseDetectorOptions& options) const; |
| 108 | virtual int StartRTPDump(const int video_channel, |
| 109 | const char file_nameUTF8[1024], |
| 110 | RTPDirections direction); |
| 111 | virtual int StopRTPDump(const int video_channel, RTPDirections direction); |
| 112 | virtual int RegisterRTPObserver(const int video_channel, |
| 113 | ViERTPObserver& observer); |
| 114 | virtual int DeregisterRTPObserver(const int video_channel); |
| 115 | virtual int RegisterRTCPObserver(const int video_channel, |
| 116 | ViERTCPObserver& observer); |
| 117 | virtual int DeregisterRTCPObserver(const int video_channel); |
| 118 | |
| 119 | protected: |
| 120 | explicit ViERTP_RTCPImpl(ViESharedData* shared_data); |
| 121 | virtual ~ViERTP_RTCPImpl(); |
| 122 | |
| 123 | private: |
| 124 | ViESharedData* shared_data_; |
| 125 | }; |
| 126 | |
| 127 | } // namespace webrtc |
| 128 | |
| 129 | #endif // WEBRTC_VIDEO_ENGINE_VIE_RTP_RTCP_IMPL_H_ |