| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_MEDIA_PEER_CONNECTION_HANDLER_BASE_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_PEER_CONNECTION_HANDLER_BASE_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_PEER_CONNECTION_HANDLER_BASE_H_ | 6 #define CONTENT_RENDERER_MEDIA_PEER_CONNECTION_HANDLER_BASE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/message_loop_proxy.h" | 12 #include "base/message_loop_proxy.h" |
| 13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStream.h" | 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStream.h" |
| 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamTrack
.h" | 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamTrack
.h" |
| 16 #include "third_party/libjingle/source/talk/app/webrtc/mediastream.h" | 16 #include "third_party/libjingle/source/talk/app/webrtc/mediastream.h" |
| 17 #include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h
" | 17 #include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h
" |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 class MediaStreamDependencyFactory; | 20 class MediaStreamDependencyFactory; |
| 21 class RemoteMediaStreamImpl; |
| 21 | 22 |
| 22 // PeerConnectionHandlerBase is the base class of a delegate for the | 23 // PeerConnectionHandlerBase is the base class of a delegate for the |
| 23 // PeerConnection API messages going between WebKit and native | 24 // PeerConnection API messages going between WebKit and native |
| 24 // PeerConnection in libjingle. | 25 // PeerConnection in libjingle. |
| 25 class CONTENT_EXPORT PeerConnectionHandlerBase | 26 class CONTENT_EXPORT PeerConnectionHandlerBase |
| 26 : NON_EXPORTED_BASE(public webrtc::PeerConnectionObserver) { | 27 : NON_EXPORTED_BASE(public webrtc::PeerConnectionObserver) { |
| 27 public: | 28 public: |
| 28 PeerConnectionHandlerBase( | 29 PeerConnectionHandlerBase( |
| 29 MediaStreamDependencyFactory* dependency_factory); | 30 MediaStreamDependencyFactory* dependency_factory); |
| 30 | 31 |
| 31 protected: | 32 protected: |
| 32 virtual ~PeerConnectionHandlerBase(); | 33 virtual ~PeerConnectionHandlerBase(); |
| 33 | 34 |
| 34 void AddStream(const WebKit::WebMediaStream& stream); | 35 void AddStream(const WebKit::WebMediaStream& stream); |
| 35 bool AddStream(const WebKit::WebMediaStream& stream, | 36 bool AddStream(const WebKit::WebMediaStream& stream, |
| 36 const webrtc::MediaConstraintsInterface* constraints); | 37 const webrtc::MediaConstraintsInterface* constraints); |
| 37 void RemoveStream(const WebKit::WebMediaStream& stream); | 38 void RemoveStream(const WebKit::WebMediaStream& stream); |
| 38 WebKit::WebMediaStream CreateRemoteWebKitMediaStream( | |
| 39 webrtc::MediaStreamInterface* stream); | |
| 40 webrtc::MediaStreamTrackInterface* GetNativeMediaStreamTrack( | 39 webrtc::MediaStreamTrackInterface* GetNativeMediaStreamTrack( |
| 41 const WebKit::WebMediaStream& stream, | 40 const WebKit::WebMediaStream& stream, |
| 42 const WebKit::WebMediaStreamTrack& component); | 41 const WebKit::WebMediaStreamTrack& component); |
| 43 | 42 |
| 44 // dependency_factory_ is a raw pointer, and is valid for the lifetime of | 43 // dependency_factory_ is a raw pointer, and is valid for the lifetime of |
| 45 // MediaStreamImpl. | 44 // MediaStreamImpl. |
| 46 MediaStreamDependencyFactory* dependency_factory_; | 45 MediaStreamDependencyFactory* dependency_factory_; |
| 47 | 46 |
| 48 // native_peer_connection_ is the native PeerConnection object, | 47 // native_peer_connection_ is the native PeerConnection object, |
| 49 // it handles the ICE processing and media engine. | 48 // it handles the ICE processing and media engine. |
| 50 scoped_refptr<webrtc::PeerConnectionInterface> native_peer_connection_; | 49 scoped_refptr<webrtc::PeerConnectionInterface> native_peer_connection_; |
| 51 | 50 |
| 52 typedef std::map<webrtc::MediaStreamInterface*, | 51 typedef std::map<webrtc::MediaStreamInterface*, |
| 53 WebKit::WebMediaStream> RemoteStreamMap; | 52 content::RemoteMediaStreamImpl*> RemoteStreamMap; |
| 54 RemoteStreamMap remote_streams_; | 53 RemoteStreamMap remote_streams_; |
| 55 | 54 |
| 56 // The message loop we are created on and on which to make calls to WebKit. | 55 // The message loop we are created on and on which to make calls to WebKit. |
| 57 // This should be the render thread message loop. | 56 // This should be the render thread message loop. |
| 58 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; | 57 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; |
| 59 | 58 |
| 60 DISALLOW_COPY_AND_ASSIGN(PeerConnectionHandlerBase); | 59 DISALLOW_COPY_AND_ASSIGN(PeerConnectionHandlerBase); |
| 61 }; | 60 }; |
| 62 | 61 |
| 63 } // namespace content | 62 } // namespace content |
| 64 | 63 |
| 65 #endif // CONTENT_RENDERER_MEDIA_PEER_CONNECTION_HANDLER_BASE_H_ | 64 #endif // CONTENT_RENDERER_MEDIA_PEER_CONNECTION_HANDLER_BASE_H_ |
| OLD | NEW |