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

Unified Diff: content/renderer/media/remote_media_stream_impl.h

Issue 14200016: Added implementation of RemoteMediaStreams. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nits Created 7 years, 8 months 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
Index: content/renderer/media/remote_media_stream_impl.h
diff --git a/content/renderer/media/remote_media_stream_impl.h b/content/renderer/media/remote_media_stream_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..361cc702ee4dbabcae0172e213fefd16b79cb73e
--- /dev/null
+++ b/content/renderer/media/remote_media_stream_impl.h
@@ -0,0 +1,51 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_RENDERER_MEDIA_REMOTE_MEDIA_STREAM_IMPL_H_
+#define CONTENT_RENDERER_MEDIA_REMOTE_MEDIA_STREAM_IMPL_H_
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_vector.h"
+#include "base/threading/non_thread_safe.h"
+#include "content/common/content_export.h"
+#include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h"
+#include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStream.h"
+#include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamSource.h"
+#include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamTrack.h"
+
+namespace content {
+
+class RemoteMediaStreamTrackObserver;
+
+// RemoteMediaStreamImpl serves as a container and glue between remote webrtc
+// MediaStreams and WebKit MediaStreams. For each remote MediaStream received
+// on a PeerConnection a RemoteMediaStreamImpl instance is created and
+// owned by RtcPeerConnection.
+class CONTENT_EXPORT RemoteMediaStreamImpl
+ : NON_EXPORTED_BASE(public webrtc::ObserverInterface),
+ NON_EXPORTED_BASE(public base::NonThreadSafe) {
+ public:
+ explicit RemoteMediaStreamImpl(
+ webrtc::MediaStreamInterface* webrtc_stream);
+ virtual ~RemoteMediaStreamImpl();
+
+ const WebKit::WebMediaStream& webkit_stream() { return webkit_stream_; }
+
+ private:
+ // webrtc::ObserverInterface implementation.
+ virtual void OnChanged() OVERRIDE;
+
+ scoped_refptr<webrtc::MediaStreamInterface> webrtc_stream_;
+ ScopedVector<RemoteMediaStreamTrackObserver> audio_track_observers_;
+ ScopedVector<RemoteMediaStreamTrackObserver> video_track_observers_;
+ WebKit::WebMediaStream webkit_stream_;
+
+ DISALLOW_COPY_AND_ASSIGN(RemoteMediaStreamImpl);
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_MEDIA_REMOTE_MEDIA_STREAM_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698