Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(917)

Unified Diff: talk/app/webrtc/mediastreamobserver.h

Issue 1507973003: Restoring behavior where PeerConnection tracks changes to MediaStreams. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Check that iterator is valid before erasing. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | talk/app/webrtc/mediastreamobserver.cc » ('j') | talk/app/webrtc/peerconnection.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/mediastreamobserver.h
diff --git a/talk/app/webrtc/rtpreceiverinterface.h b/talk/app/webrtc/mediastreamobserver.h
similarity index 61%
copy from talk/app/webrtc/rtpreceiverinterface.h
copy to talk/app/webrtc/mediastreamobserver.h
index 099699efc4be7a6d729558144131a4163eeed865..5aa7c12550154789811a1581ecebae0c6abf20c6 100644
--- a/talk/app/webrtc/rtpreceiverinterface.h
+++ b/talk/app/webrtc/mediastreamobserver.h
@@ -25,42 +25,41 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// This file contains interfaces for RtpReceivers
-// http://w3c.github.io/webrtc-pc/#rtcrtpreceiver-interface
+#ifndef APP_WEBRTC_MEDIASTREAMOBSERVER_H_
+#define APP_WEBRTC_MEDIASTREAMOBSERVER_H_
-#ifndef TALK_APP_WEBRTC_RTPRECEIVERINTERFACE_H_
-#define TALK_APP_WEBRTC_RTPRECEIVERINTERFACE_H_
-
-#include <string>
-
-#include "talk/app/webrtc/proxy.h"
#include "talk/app/webrtc/mediastreaminterface.h"
-#include "webrtc/base/refcount.h"
#include "webrtc/base/scoped_ref_ptr.h"
+#include "webrtc/base/sigslot.h"
namespace webrtc {
-class RtpReceiverInterface : public rtc::RefCountInterface {
+// Helper class which will listen for changes to a stream and emit the
+// corresponding signals.
+class MediaStreamObserver : public ObserverInterface {
public:
- virtual rtc::scoped_refptr<MediaStreamTrackInterface> track() const = 0;
+ explicit MediaStreamObserver(MediaStreamInterface* stream);
+ ~MediaStreamObserver();
- // 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;
+ const MediaStreamInterface* stream() const { return stream_; }
- virtual void Stop() = 0;
+ void OnChanged() override;
- protected:
- virtual ~RtpReceiverInterface() {}
-};
+ sigslot::signal2<AudioTrackInterface*, MediaStreamInterface*>
+ SignalAudioTrackAdded;
+ sigslot::signal2<AudioTrackInterface*, MediaStreamInterface*>
+ SignalAudioTrackRemoved;
+ sigslot::signal2<VideoTrackInterface*, MediaStreamInterface*>
+ SignalVideoTrackAdded;
+ sigslot::signal2<VideoTrackInterface*, MediaStreamInterface*>
+ SignalVideoTrackRemoved;
-// 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()
+ private:
+ rtc::scoped_refptr<MediaStreamInterface> stream_;
+ AudioTrackVector cached_audio_tracks_;
+ VideoTrackVector cached_video_tracks_;
+};
} // namespace webrtc
-#endif // TALK_APP_WEBRTC_RTPRECEIVERINTERFACE_H_
+#endif // APP_WEBRTC_MEDIASTREAMOBSERVER_H_
« no previous file with comments | « no previous file | talk/app/webrtc/mediastreamobserver.cc » ('j') | talk/app/webrtc/peerconnection.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698