| 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_MEDIA_STREAM_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_IMPL_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_IMPL_H_ | 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_IMPL_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 public MediaStreamDispatcherEventHandler, | 63 public MediaStreamDispatcherEventHandler, |
| 64 NON_EXPORTED_BASE(public base::NonThreadSafe), | 64 NON_EXPORTED_BASE(public base::NonThreadSafe), |
| 65 public base::RefCountedThreadSafe<MediaStreamImpl>, | 65 public base::RefCountedThreadSafe<MediaStreamImpl>, |
| 66 public base::SupportsWeakPtr<MediaStreamImpl> { | 66 public base::SupportsWeakPtr<MediaStreamImpl> { |
| 67 public: | 67 public: |
| 68 MediaStreamImpl( | 68 MediaStreamImpl( |
| 69 MediaStreamDispatcher* media_stream_dispatcher, | 69 MediaStreamDispatcher* media_stream_dispatcher, |
| 70 content::P2PSocketDispatcher* p2p_socket_dispatcher, | 70 content::P2PSocketDispatcher* p2p_socket_dispatcher, |
| 71 VideoCaptureImplManager* vc_manager, | 71 VideoCaptureImplManager* vc_manager, |
| 72 MediaStreamDependencyFactory* dependency_factory); | 72 MediaStreamDependencyFactory* dependency_factory); |
| 73 virtual ~MediaStreamImpl(); | |
| 74 | 73 |
| 75 virtual WebKit::WebPeerConnectionHandler* CreatePeerConnectionHandler( | 74 virtual WebKit::WebPeerConnectionHandler* CreatePeerConnectionHandler( |
| 76 WebKit::WebPeerConnectionHandlerClient* client); | 75 WebKit::WebPeerConnectionHandlerClient* client); |
| 77 virtual void ClosePeerConnection(); | 76 virtual void ClosePeerConnection(); |
| 78 virtual webrtc::MediaStreamTrackInterface* GetLocalMediaStreamTrack( | 77 virtual webrtc::MediaStreamTrackInterface* GetLocalMediaStreamTrack( |
| 79 const std::string& label); | 78 const std::string& label); |
| 80 | 79 |
| 81 // WebKit::WebUserMediaClient implementation | 80 // WebKit::WebUserMediaClient implementation |
| 82 virtual void requestUserMedia( | 81 virtual void requestUserMedia( |
| 83 const WebKit::WebUserMediaRequest& user_media_request, | 82 const WebKit::WebUserMediaRequest& user_media_request, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 108 virtual void OnDevicesEnumerated( | 107 virtual void OnDevicesEnumerated( |
| 109 int request_id, | 108 int request_id, |
| 110 const media_stream::StreamDeviceInfoArray& device_array) OVERRIDE; | 109 const media_stream::StreamDeviceInfoArray& device_array) OVERRIDE; |
| 111 virtual void OnDevicesEnumerationFailed(int request_id) OVERRIDE; | 110 virtual void OnDevicesEnumerationFailed(int request_id) OVERRIDE; |
| 112 virtual void OnDeviceOpened( | 111 virtual void OnDeviceOpened( |
| 113 int request_id, | 112 int request_id, |
| 114 const std::string& label, | 113 const std::string& label, |
| 115 const media_stream::StreamDeviceInfo& device_info) OVERRIDE; | 114 const media_stream::StreamDeviceInfo& device_info) OVERRIDE; |
| 116 virtual void OnDeviceOpenFailed(int request_id) OVERRIDE; | 115 virtual void OnDeviceOpenFailed(int request_id) OVERRIDE; |
| 117 | 116 |
| 117 protected: |
| 118 friend class base::RefCountedThreadSafe<MediaStreamImpl>; |
| 119 virtual ~MediaStreamImpl(); |
| 120 |
| 118 private: | 121 private: |
| 119 FRIEND_TEST_ALL_PREFIXES(MediaStreamImplTest, Basic); | 122 FRIEND_TEST_ALL_PREFIXES(MediaStreamImplTest, Basic); |
| 120 | 123 |
| 121 class VideoRendererWrapper : public webrtc::VideoRendererWrapperInterface { | 124 class VideoRendererWrapper : public webrtc::VideoRendererWrapperInterface { |
| 122 public: | 125 public: |
| 123 VideoRendererWrapper(); | 126 VideoRendererWrapper(); |
| 124 virtual cricket::VideoRenderer* renderer() OVERRIDE { | 127 virtual cricket::VideoRenderer* renderer() OVERRIDE { |
| 125 return rtc_video_decoder_.get(); | 128 return rtc_video_decoder_.get(); |
| 126 } | 129 } |
| 127 void SetVideoDecoder(RTCVideoDecoder* decoder); | 130 void SetVideoDecoder(RTCVideoDecoder* decoder); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 base::Thread chrome_worker_thread_; | 184 base::Thread chrome_worker_thread_; |
| 182 | 185 |
| 183 static int next_request_id_; | 186 static int next_request_id_; |
| 184 typedef std::map<int, WebKit::WebUserMediaRequest> MediaRequestMap; | 187 typedef std::map<int, WebKit::WebUserMediaRequest> MediaRequestMap; |
| 185 MediaRequestMap user_media_requests_; | 188 MediaRequestMap user_media_requests_; |
| 186 | 189 |
| 187 DISALLOW_COPY_AND_ASSIGN(MediaStreamImpl); | 190 DISALLOW_COPY_AND_ASSIGN(MediaStreamImpl); |
| 188 }; | 191 }; |
| 189 | 192 |
| 190 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_IMPL_H_ | 193 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_IMPL_H_ |
| OLD | NEW |