OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_RENDERER_MEDIA_PEER_CONNECTION_HANDLER_BASE_H_ | |
6 #define CONTENT_RENDERER_MEDIA_PEER_CONNECTION_HANDLER_BASE_H_ | |
7 | |
8 #include <map> | |
9 #include <string> | |
10 | |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "base/message_loop_proxy.h" | |
13 #include "third_party/libjingle/source/talk/app/webrtc/mediastream.h" | |
14 #include "third_party/libjingle/source/talk/app/webrtc/peerconnection.h" | |
15 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStre amDescriptor.h" | |
16 | |
17 class MediaStreamDependencyFactory; | |
18 class MediaStreamImpl; | |
19 | |
20 // PeerConnectionHandlerBase is the base class of a delegate for the | |
21 // PeerConnection (JSEP or ROAP) API messages going between WebKit and native | |
22 // PeerConnection in libjingle. ROAP PeerConnection will be removed soon. | |
23 class PeerConnectionHandlerBase | |
24 : 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.
| |
25 public: | |
26 PeerConnectionHandlerBase( | |
27 MediaStreamImpl* msi, | |
28 MediaStreamDependencyFactory* dependency_factory); | |
29 | |
30 // Set the video renderer for the specified stream. | |
31 virtual void SetVideoRenderer( | |
32 const std::string& stream_label, | |
33 webrtc::VideoRendererWrapperInterface* renderer); | |
34 | |
35 protected: | |
36 virtual ~PeerConnectionHandlerBase(); | |
37 | |
38 void AddStream(const WebKit::WebMediaStreamDescriptor& stream); | |
39 void RemoveStream(const WebKit::WebMediaStreamDescriptor& stream); | |
40 WebKit::WebMediaStreamDescriptor CreateWebKitStreamDescriptor( | |
41 webrtc::MediaStreamInterface* stream); | |
42 | |
43 // 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.
| |
44 // class. Calls to it must be done on the render thread. | |
45 MediaStreamImpl* media_stream_impl_; | |
46 | |
47 // dependency_factory_ is a weak pointer, and is valid for the lifetime of | |
48 // MediaStreamImpl. | |
49 MediaStreamDependencyFactory* dependency_factory_; | |
50 | |
51 // native_peer_connection_ is the native PeerConnection object, | |
52 // it handles the ICE processing and media engine. | |
53 talk_base::scoped_refptr<webrtc::PeerConnectionInterface> | |
54 native_peer_connection_; | |
55 | |
56 typedef std::map<webrtc::MediaStreamInterface*, | |
57 WebKit::WebMediaStreamDescriptor> RemoteStreamMap; | |
58 RemoteStreamMap remote_streams_; | |
59 | |
60 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.
| |
61 | |
62 DISALLOW_COPY_AND_ASSIGN(PeerConnectionHandlerBase); | |
63 }; | |
64 | |
65 #endif // CONTENT_RENDERER_MEDIA_PEER_CONNECTION_HANDLER_BASE_H_ | |
OLD | NEW |