Index: content/renderer/media/peer_connection_handler_base.h |
diff --git a/content/renderer/media/peer_connection_handler_base.h b/content/renderer/media/peer_connection_handler_base.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2c64d1f541b8c4f56df367cd6152f6fd8da4634a |
--- /dev/null |
+++ b/content/renderer/media/peer_connection_handler_base.h |
@@ -0,0 +1,65 @@ |
+// 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_PEER_CONNECTION_HANDLER_BASE_H_ |
+#define CONTENT_RENDERER_MEDIA_PEER_CONNECTION_HANDLER_BASE_H_ |
+ |
+#include <map> |
+#include <string> |
+ |
+#include "base/memory/scoped_ptr.h" |
+#include "base/message_loop_proxy.h" |
+#include "third_party/libjingle/source/talk/app/webrtc/mediastream.h" |
+#include "third_party/libjingle/source/talk/app/webrtc/peerconnection.h" |
+#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStreamDescriptor.h" |
+ |
+class MediaStreamDependencyFactory; |
+class MediaStreamImpl; |
+ |
+// PeerConnectionHandlerBase is the base class of a delegate for the |
+// PeerConnection (JSEP or ROAP) API messages going between WebKit and native |
+// PeerConnection in libjingle. ROAP PeerConnection will be removed soon. |
+class PeerConnectionHandlerBase |
+ : public webrtc::PeerConnectionObserver { |
tommi (sloooow) - chröme
2012/03/15 12:31:52
no need to wrap?
Henrik Grunell
2012/03/23 12:50:45
Done.
|
+ public: |
+ PeerConnectionHandlerBase( |
+ MediaStreamImpl* msi, |
+ MediaStreamDependencyFactory* dependency_factory); |
+ |
+ // Set the video renderer for the specified stream. |
+ virtual void SetVideoRenderer( |
+ const std::string& stream_label, |
+ webrtc::VideoRendererWrapperInterface* renderer); |
+ |
+ protected: |
+ virtual ~PeerConnectionHandlerBase(); |
+ |
+ void AddStream(const WebKit::WebMediaStreamDescriptor& stream); |
+ void RemoveStream(const WebKit::WebMediaStreamDescriptor& stream); |
+ WebKit::WebMediaStreamDescriptor CreateWebKitStreamDescriptor( |
+ webrtc::MediaStreamInterface* stream); |
+ |
+ // media_stream_impl_ is a weak pointer, and is valid for the lifetime of this |
tommi (sloooow) - chröme
2012/03/15 12:31:52
nit: s/weak/raw
since we have WeakPtr<>
Henrik Grunell
2012/03/23 12:50:45
Done.
|
+ // class. Calls to it must be done on the render thread. |
+ MediaStreamImpl* media_stream_impl_; |
+ |
+ // dependency_factory_ is a weak pointer, and is valid for the lifetime of |
+ // MediaStreamImpl. |
+ MediaStreamDependencyFactory* dependency_factory_; |
+ |
+ // native_peer_connection_ is the native PeerConnection object, |
+ // it handles the ICE processing and media engine. |
+ talk_base::scoped_refptr<webrtc::PeerConnectionInterface> |
+ native_peer_connection_; |
+ |
+ typedef std::map<webrtc::MediaStreamInterface*, |
+ WebKit::WebMediaStreamDescriptor> RemoteStreamMap; |
+ RemoteStreamMap remote_streams_; |
+ |
+ scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; |
tommi (sloooow) - chröme
2012/03/15 12:31:52
maybe a note on what we use this for.
also, is thi
Henrik Grunell
2012/03/23 12:50:45
Done.
|
+ |
+ DISALLOW_COPY_AND_ASSIGN(PeerConnectionHandlerBase); |
+}; |
+ |
+#endif // CONTENT_RENDERER_MEDIA_PEER_CONNECTION_HANDLER_BASE_H_ |