Index: talk/app/webrtc/rtpreceiverinterface.h |
diff --git a/talk/app/webrtc/mediastreamproxy.h b/talk/app/webrtc/rtpreceiverinterface.h |
similarity index 61% |
copy from talk/app/webrtc/mediastreamproxy.h |
copy to talk/app/webrtc/rtpreceiverinterface.h |
index bde7dcfe2d5f9dbba9dc6ebe956ff4dea4cb354f..099699efc4be7a6d729558144131a4163eeed865 100644 |
--- a/talk/app/webrtc/mediastreamproxy.h |
+++ b/talk/app/webrtc/rtpreceiverinterface.h |
@@ -1,6 +1,6 @@ |
/* |
* libjingle |
- * Copyright 2011 Google Inc. |
+ * Copyright 2015 Google Inc. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are met: |
@@ -25,30 +25,42 @@ |
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef TALK_APP_WEBRTC_MEDIASTREAMPROXY_H_ |
-#define TALK_APP_WEBRTC_MEDIASTREAMPROXY_H_ |
+// This file contains interfaces for RtpReceivers |
+// http://w3c.github.io/webrtc-pc/#rtcrtpreceiver-interface |
+ |
+#ifndef TALK_APP_WEBRTC_RTPRECEIVERINTERFACE_H_ |
+#define TALK_APP_WEBRTC_RTPRECEIVERINTERFACE_H_ |
+ |
+#include <string> |
-#include "talk/app/webrtc/mediastreaminterface.h" |
#include "talk/app/webrtc/proxy.h" |
+#include "talk/app/webrtc/mediastreaminterface.h" |
+#include "webrtc/base/refcount.h" |
+#include "webrtc/base/scoped_ref_ptr.h" |
namespace webrtc { |
-BEGIN_PROXY_MAP(MediaStream) |
- PROXY_CONSTMETHOD0(std::string, label) |
- PROXY_METHOD0(AudioTrackVector, GetAudioTracks) |
- PROXY_METHOD0(VideoTrackVector, GetVideoTracks) |
- PROXY_METHOD1(rtc::scoped_refptr<AudioTrackInterface>, |
- FindAudioTrack, const std::string&) |
- PROXY_METHOD1(rtc::scoped_refptr<VideoTrackInterface>, |
- FindVideoTrack, const std::string&) |
- PROXY_METHOD1(bool, AddTrack, AudioTrackInterface*) |
- PROXY_METHOD1(bool, AddTrack, VideoTrackInterface*) |
- PROXY_METHOD1(bool, RemoveTrack, AudioTrackInterface*) |
- PROXY_METHOD1(bool, RemoveTrack, VideoTrackInterface*) |
- PROXY_METHOD1(void, RegisterObserver, ObserverInterface*) |
- PROXY_METHOD1(void, UnregisterObserver, ObserverInterface*) |
+class RtpReceiverInterface : public rtc::RefCountInterface { |
+ public: |
+ virtual rtc::scoped_refptr<MediaStreamTrackInterface> track() const = 0; |
+ |
+ // Not to be confused with "mid", this is a field we can temporarily use |
+ // to uniquely identify a receiver until we implement Unified Plan SDP. |
+ virtual std::string id() const = 0; |
+ |
+ virtual void Stop() = 0; |
+ |
+ protected: |
+ virtual ~RtpReceiverInterface() {} |
+}; |
+ |
+// Define proxy for RtpReceiverInterface. |
+BEGIN_PROXY_MAP(RtpReceiver) |
+PROXY_CONSTMETHOD0(rtc::scoped_refptr<MediaStreamTrackInterface>, track) |
+PROXY_CONSTMETHOD0(std::string, id) |
+PROXY_METHOD0(void, Stop) |
END_PROXY() |
} // namespace webrtc |
-#endif // TALK_APP_WEBRTC_MEDIASTREAMPROXY_H_ |
+#endif // TALK_APP_WEBRTC_RTPRECEIVERINTERFACE_H_ |