Index: webrtc/api/rtpreceiverinterface.h |
diff --git a/webrtc/api/rtpreceiverinterface.h b/webrtc/api/rtpreceiverinterface.h |
index 8607d935a232be6364327ad0af4d966280ec65c4..59c93db4e6fe8c5d607494d326439416ee60980c 100644 |
--- a/webrtc/api/rtpreceiverinterface.h |
+++ b/webrtc/api/rtpreceiverinterface.h |
@@ -14,7 +14,9 @@ |
#ifndef WEBRTC_API_RTPRECEIVERINTERFACE_H_ |
#define WEBRTC_API_RTPRECEIVERINTERFACE_H_ |
+#include <memory> |
#include <string> |
+#include <vector> |
#include "webrtc/api/mediatypes.h" |
#include "webrtc/api/mediastreaminterface.h" |
@@ -25,6 +27,20 @@ |
namespace webrtc { |
+struct RtpContributingSource { |
+ RtpContributingSource() : timestamp(0), source(0) {} |
+ |
+ RtpContributingSource(int64_t time, uint32_t src) |
+ : timestamp(time), source(src) {} |
+ |
+ int64_t timestamp; |
+ // Can be either the SSRC or the CSRC. |
+ uint32_t source; |
+ // This isn't implemented yet and will always return an empty Optional. |
+ // TODO(zhihuang): Implement this to return real audio level. |
+ rtc::Optional<int8_t> audio_level; |
Taylor Brandstetter
2017/03/31 22:10:50
nit: I'd still be in favor of using getters/setter
Zhi Huang
2017/04/04 04:24:33
Done.
|
+}; |
+ |
class RtpReceiverObserverInterface { |
public: |
// Note: Currently if there are multiple RtpReceivers of the same media type, |
@@ -61,6 +77,13 @@ class RtpReceiverInterface : public rtc::RefCountInterface { |
// Must call SetObserver(nullptr) before the observer is destroyed. |
virtual void SetObserver(RtpReceiverObserverInterface* observer) = 0; |
+ // TODO(zhihuang): Remove the default implementation once the subclasses |
+ // implement this. Currently, the only relevant subclass is the |
+ // content::FakeRtpReceiver in Chromium. |
+ virtual std::vector<RtpContributingSource> GetContributingSources() { |
+ return std::vector<RtpContributingSource>(); |
+ } |
+ |
protected: |
virtual ~RtpReceiverInterface() {} |
}; |
@@ -76,7 +99,8 @@ BEGIN_SIGNALING_PROXY_MAP(RtpReceiver) |
PROXY_CONSTMETHOD0(RtpParameters, GetParameters); |
PROXY_METHOD1(bool, SetParameters, const RtpParameters&) |
PROXY_METHOD1(void, SetObserver, RtpReceiverObserverInterface*); |
-END_PROXY_MAP() |
+ PROXY_METHOD0(std::vector<RtpContributingSource>, GetContributingSources); |
+ END_PROXY_MAP() |
} // namespace webrtc |