| 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/WebMediaStreamCompo
nent.h" | 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStream.h" |
| 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamDescr
iptor.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 | 21 |
| 22 // PeerConnectionHandlerBase is the base class of a delegate for the | 22 // PeerConnectionHandlerBase is the base class of a delegate for the |
| 23 // PeerConnection API messages going between WebKit and native | 23 // PeerConnection API messages going between WebKit and native |
| 24 // PeerConnection in libjingle. | 24 // PeerConnection in libjingle. |
| 25 class CONTENT_EXPORT PeerConnectionHandlerBase | 25 class CONTENT_EXPORT PeerConnectionHandlerBase |
| 26 : NON_EXPORTED_BASE(public webrtc::PeerConnectionObserver) { | 26 : NON_EXPORTED_BASE(public webrtc::PeerConnectionObserver) { |
| 27 public: | 27 public: |
| 28 PeerConnectionHandlerBase( | 28 PeerConnectionHandlerBase( |
| 29 MediaStreamDependencyFactory* dependency_factory); | 29 MediaStreamDependencyFactory* dependency_factory); |
| 30 | 30 |
| 31 protected: | 31 protected: |
| 32 virtual ~PeerConnectionHandlerBase(); | 32 virtual ~PeerConnectionHandlerBase(); |
| 33 | 33 |
| 34 void AddStream(const WebKit::WebMediaStreamDescriptor& stream); | 34 void AddStream(const WebKit::WebMediaStream& stream); |
| 35 bool AddStream(const WebKit::WebMediaStreamDescriptor& stream, | 35 bool AddStream(const WebKit::WebMediaStream& stream, |
| 36 const webrtc::MediaConstraintsInterface* constraints); | 36 const webrtc::MediaConstraintsInterface* constraints); |
| 37 void RemoveStream(const WebKit::WebMediaStreamDescriptor& stream); | 37 void RemoveStream(const WebKit::WebMediaStream& stream); |
| 38 WebKit::WebMediaStreamDescriptor CreateWebKitStreamDescriptor( | 38 WebKit::WebMediaStream CreateWebKitStreamDescriptor( |
| 39 webrtc::MediaStreamInterface* stream); | 39 webrtc::MediaStreamInterface* stream); |
| 40 webrtc::MediaStreamTrackInterface* GetLocalNativeMediaStreamTrack( | 40 webrtc::MediaStreamTrackInterface* GetLocalNativeMediaStreamTrack( |
| 41 const WebKit::WebMediaStreamDescriptor& stream, | 41 const WebKit::WebMediaStream& stream, |
| 42 const WebKit::WebMediaStreamComponent& component); | 42 const WebKit::WebMediaStreamTrack& component); |
| 43 | 43 |
| 44 // dependency_factory_ is a raw pointer, and is valid for the lifetime of | 44 // dependency_factory_ is a raw pointer, and is valid for the lifetime of |
| 45 // MediaStreamImpl. | 45 // MediaStreamImpl. |
| 46 MediaStreamDependencyFactory* dependency_factory_; | 46 MediaStreamDependencyFactory* dependency_factory_; |
| 47 | 47 |
| 48 // native_peer_connection_ is the native PeerConnection object, | 48 // native_peer_connection_ is the native PeerConnection object, |
| 49 // it handles the ICE processing and media engine. | 49 // it handles the ICE processing and media engine. |
| 50 scoped_refptr<webrtc::PeerConnectionInterface> native_peer_connection_; | 50 scoped_refptr<webrtc::PeerConnectionInterface> native_peer_connection_; |
| 51 | 51 |
| 52 typedef std::map<webrtc::MediaStreamInterface*, | 52 typedef std::map<webrtc::MediaStreamInterface*, |
| 53 WebKit::WebMediaStreamDescriptor> RemoteStreamMap; | 53 WebKit::WebMediaStream> RemoteStreamMap; |
| 54 RemoteStreamMap remote_streams_; | 54 RemoteStreamMap remote_streams_; |
| 55 | 55 |
| 56 // The message loop we are created on and on which to make calls to WebKit. | 56 // The message loop we are created on and on which to make calls to WebKit. |
| 57 // This should be the render thread message loop. | 57 // This should be the render thread message loop. |
| 58 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; | 58 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; |
| 59 | 59 |
| 60 DISALLOW_COPY_AND_ASSIGN(PeerConnectionHandlerBase); | 60 DISALLOW_COPY_AND_ASSIGN(PeerConnectionHandlerBase); |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 } // namespace content | 63 } // namespace content |
| 64 | 64 |
| 65 #endif // CONTENT_RENDERER_MEDIA_PEER_CONNECTION_HANDLER_BASE_H_ | 65 #endif // CONTENT_RENDERER_MEDIA_PEER_CONNECTION_HANDLER_BASE_H_ |
| OLD | NEW |