OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_RECEIVER_H_ | 11 #ifndef WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_RECEIVER_H_ |
12 #define WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_RECEIVER_H_ | 12 #define WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_RECEIVER_H_ |
13 | 13 |
14 #include <vector> | |
15 | |
16 #include "webrtc/api/rtpreceiverinterface.h" | |
14 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | 17 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
15 #include "webrtc/typedefs.h" | 18 #include "webrtc/typedefs.h" |
16 | 19 |
17 namespace webrtc { | 20 namespace webrtc { |
18 | 21 |
19 struct CodecInst; | 22 struct CodecInst; |
20 class RTPPayloadRegistry; | 23 class RTPPayloadRegistry; |
21 class VideoCodec; | 24 class VideoCodec; |
22 | 25 |
26 class RtpContributingSource : public RtpContributingSourceInterface { | |
27 public: | |
28 RtpContributingSource() : timestamp_(0), source_(0) {} | |
29 | |
30 explicit RtpContributingSource(int64_t timestamp, uint32_t source) | |
31 : timestamp_(timestamp), source_(source) {} | |
32 | |
33 int64_t timestamp() const override { return timestamp_; } | |
34 | |
35 uint32_t source() const override { return source_; } | |
36 | |
37 // Always return 0 in the current implementation. | |
38 // TODO(zhihuang): Implement this method to return real audio level. | |
39 int8_t audio_level() const override { return 0; } | |
hbos
2017/03/30 09:51:54
Return a value that doesn't map to a meaningful va
Zhi Huang
2017/03/31 06:44:04
Done.
| |
40 | |
41 void set_timestamp(int64_t timestamp) { timestamp_ = timestamp; } | |
42 | |
43 private: | |
44 int64_t timestamp_; | |
45 uint32_t source_; | |
46 }; | |
47 | |
23 class TelephoneEventHandler { | 48 class TelephoneEventHandler { |
24 public: | 49 public: |
25 virtual ~TelephoneEventHandler() {} | 50 virtual ~TelephoneEventHandler() {} |
26 | 51 |
27 // The following three methods implement the TelephoneEventHandler interface. | 52 // The following three methods implement the TelephoneEventHandler interface. |
28 // Forward DTMFs to decoder for playout. | 53 // Forward DTMFs to decoder for playout. |
29 virtual void SetTelephoneEventForwardToDecoder(bool forward_to_decoder) = 0; | 54 virtual void SetTelephoneEventForwardToDecoder(bool forward_to_decoder) = 0; |
30 | 55 |
31 // Is forwarding of outband telephone events turned on/off? | 56 // Is forwarding of outband telephone events turned on/off? |
32 virtual bool TelephoneEventForwardToDecoder() const = 0; | 57 virtual bool TelephoneEventForwardToDecoder() const = 0; |
(...skipping 49 matching lines...) Loading... | |
82 virtual bool LastReceivedTimeMs(int64_t* receive_time_ms) const = 0; | 107 virtual bool LastReceivedTimeMs(int64_t* receive_time_ms) const = 0; |
83 | 108 |
84 // Returns the remote SSRC of the currently received RTP stream. | 109 // Returns the remote SSRC of the currently received RTP stream. |
85 virtual uint32_t SSRC() const = 0; | 110 virtual uint32_t SSRC() const = 0; |
86 | 111 |
87 // Returns the current remote CSRCs. | 112 // Returns the current remote CSRCs. |
88 virtual int32_t CSRCs(uint32_t array_of_csrc[kRtpCsrcSize]) const = 0; | 113 virtual int32_t CSRCs(uint32_t array_of_csrc[kRtpCsrcSize]) const = 0; |
89 | 114 |
90 // Returns the current energy of the RTP stream received. | 115 // Returns the current energy of the RTP stream received. |
91 virtual int32_t Energy(uint8_t array_of_energy[kRtpCsrcSize]) const = 0; | 116 virtual int32_t Energy(uint8_t array_of_energy[kRtpCsrcSize]) const = 0; |
117 | |
118 virtual const std::vector<RtpContributingSource*>& | |
119 GetContributingSources() = 0; | |
92 }; | 120 }; |
93 } // namespace webrtc | 121 } // namespace webrtc |
94 | 122 |
95 #endif // WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_RECEIVER_H_ | 123 #endif // WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_RECEIVER_H_ |
OLD | NEW |