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 <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 public base::SupportsWeakPtr<MediaStreamImpl>, | 44 public base::SupportsWeakPtr<MediaStreamImpl>, |
45 NON_EXPORTED_BASE(public base::NonThreadSafe) { | 45 NON_EXPORTED_BASE(public base::NonThreadSafe) { |
46 public: | 46 public: |
47 MediaStreamImpl( | 47 MediaStreamImpl( |
48 content::RenderView* render_view, | 48 content::RenderView* render_view, |
49 MediaStreamDispatcher* media_stream_dispatcher, | 49 MediaStreamDispatcher* media_stream_dispatcher, |
50 VideoCaptureImplManager* vc_manager, | 50 VideoCaptureImplManager* vc_manager, |
51 MediaStreamDependencyFactory* dependency_factory); | 51 MediaStreamDependencyFactory* dependency_factory); |
52 virtual ~MediaStreamImpl(); | 52 virtual ~MediaStreamImpl(); |
53 | 53 |
54 // Stops a local MediaStream by notifying the MediaStreamDispatcher that the | |
55 // stream no longer may be used. | |
56 virtual void StopLocalMediaStream( | |
57 const WebKit::WebMediaStreamDescriptor& stream); | |
58 | |
59 // WebKit::WebUserMediaClient implementation | 54 // WebKit::WebUserMediaClient implementation |
60 virtual void requestUserMedia( | 55 virtual void requestUserMedia( |
61 const WebKit::WebUserMediaRequest& user_media_request, | 56 const WebKit::WebUserMediaRequest& user_media_request, |
62 const WebKit::WebVector<WebKit::WebMediaStreamSource>& audio_sources, | 57 const WebKit::WebVector<WebKit::WebMediaStreamSource>& audio_sources, |
63 const WebKit::WebVector<WebKit::WebMediaStreamSource>& video_sources) | 58 const WebKit::WebVector<WebKit::WebMediaStreamSource>& video_sources) |
64 OVERRIDE; | 59 OVERRIDE; |
65 virtual void cancelUserMediaRequest( | 60 virtual void cancelUserMediaRequest( |
66 const WebKit::WebUserMediaRequest& user_media_request) OVERRIDE; | 61 const WebKit::WebUserMediaRequest& user_media_request) OVERRIDE; |
67 | 62 |
68 // webkit_media::MediaStreamClient implementation. | 63 // webkit_media::MediaStreamClient implementation. |
(...skipping 21 matching lines...) Expand all Loading... |
90 virtual void OnDeviceOpened( | 85 virtual void OnDeviceOpened( |
91 int request_id, | 86 int request_id, |
92 const std::string& label, | 87 const std::string& label, |
93 const media_stream::StreamDeviceInfo& device_info) OVERRIDE; | 88 const media_stream::StreamDeviceInfo& device_info) OVERRIDE; |
94 virtual void OnDeviceOpenFailed(int request_id) OVERRIDE; | 89 virtual void OnDeviceOpenFailed(int request_id) OVERRIDE; |
95 | 90 |
96 // content::RenderViewObserver OVERRIDE | 91 // content::RenderViewObserver OVERRIDE |
97 virtual void FrameWillClose(WebKit::WebFrame* frame) OVERRIDE; | 92 virtual void FrameWillClose(WebKit::WebFrame* frame) OVERRIDE; |
98 | 93 |
99 protected: | 94 protected: |
| 95 // Stops a local MediaStream by notifying the MediaStreamDispatcher that the |
| 96 // stream no longer may be used. |
| 97 void OnLocalMediaStreamStop(const std::string& label); |
100 // This function is virtual for test purposes. A test can override this to | 98 // This function is virtual for test purposes. A test can override this to |
101 // test requesting local media streams. The function notifies WebKit that the | 99 // test requesting local media streams. The function notifies WebKit that the |
102 // |request| have completed and generated the MediaStream |stream|. | 100 // |request| have completed and generated the MediaStream |stream|. |
103 virtual void CompleteGetUserMediaRequest( | 101 virtual void CompleteGetUserMediaRequest( |
104 const WebKit::WebMediaStreamDescriptor& stream, | 102 const WebKit::WebMediaStreamDescriptor& stream, |
105 WebKit::WebUserMediaRequest* request); | 103 WebKit::WebUserMediaRequest* request); |
106 // This function is virtual for test purposes. | 104 // This function is virtual for test purposes. |
107 // Returns the WebKit representation of a MediaStream given an URL. | 105 // Returns the WebKit representation of a MediaStream given an URL. |
108 virtual WebKit::WebMediaStreamDescriptor GetMediaStream(const GURL& url); | 106 virtual WebKit::WebMediaStreamDescriptor GetMediaStream(const GURL& url); |
109 | 107 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 140 |
143 scoped_refptr<VideoCaptureImplManager> vc_manager_; | 141 scoped_refptr<VideoCaptureImplManager> vc_manager_; |
144 | 142 |
145 MediaRequestMap user_media_requests_; | 143 MediaRequestMap user_media_requests_; |
146 LocalNativeStreamMap local_media_streams_; | 144 LocalNativeStreamMap local_media_streams_; |
147 | 145 |
148 DISALLOW_COPY_AND_ASSIGN(MediaStreamImpl); | 146 DISALLOW_COPY_AND_ASSIGN(MediaStreamImpl); |
149 }; | 147 }; |
150 | 148 |
151 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_IMPL_H_ | 149 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_IMPL_H_ |
OLD | NEW |