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 // MediaStreamManager is used to open/enumerate media capture devices (video | 5 // MediaStreamManager is used to open/enumerate media capture devices (video |
6 // supported now). Call flow: | 6 // supported now). Call flow: |
7 // 1. GenerateStream is called when a render process wants to use a capture | 7 // 1. GenerateStream is called when a render process wants to use a capture |
8 // device. | 8 // device. |
9 // 2. MediaStreamManager will ask MediaStreamUIController for permission to | 9 // 2. MediaStreamManager will ask MediaStreamUIController for permission to |
10 // use devices and for which device to use. | 10 // use devices and for which device to use. |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 | 328 |
329 void TranslateDeviceIdToSourceId(DeviceRequest* request, | 329 void TranslateDeviceIdToSourceId(DeviceRequest* request, |
330 MediaStreamDevice* device); | 330 MediaStreamDevice* device); |
331 | 331 |
332 // Helper method that sends log messages to the render process hosts whose | 332 // Helper method that sends log messages to the render process hosts whose |
333 // corresponding render processes are in |render_process_ids|, to be used by | 333 // corresponding render processes are in |render_process_ids|, to be used by |
334 // the webrtcLoggingPrivate API if requested. | 334 // the webrtcLoggingPrivate API if requested. |
335 void AddLogMessageOnUIThread(const std::set<int>& render_process_ids, | 335 void AddLogMessageOnUIThread(const std::set<int>& render_process_ids, |
336 const std::string& message); | 336 const std::string& message); |
337 | 337 |
| 338 public: |
338 // Finds and returns the device id corresponding to the given | 339 // Finds and returns the device id corresponding to the given |
339 // |source_id|. Returns true if there was a raw device id that matched the | 340 // |source_id|. Returns true if there was a raw device id that matched the |
340 // given |source_id|, false if nothing matched it. | 341 // given |source_id|, false if nothing matched it. |
341 bool TranslateSourceIdToDeviceId( | 342 bool TranslateSourceIdToDeviceId( |
342 MediaStreamType stream_type, | 343 MediaStreamType stream_type, |
343 const ResourceContext::SaltCallback& rc, | 344 const ResourceContext::SaltCallback& rc, |
344 const GURL& security_origin, | 345 const GURL& security_origin, |
345 const std::string& source_id, | 346 const std::string& source_id, |
346 std::string* device_id) const; | 347 std::string* device_id) const; |
| 348 private: |
347 | 349 |
348 // Handles the callback from MediaStreamUIProxy to receive the UI window id, | 350 // Handles the callback from MediaStreamUIProxy to receive the UI window id, |
349 // used for excluding the notification window in desktop capturing. | 351 // used for excluding the notification window in desktop capturing. |
350 void OnMediaStreamUIWindowId(MediaStreamType video_type, | 352 void OnMediaStreamUIWindowId(MediaStreamType video_type, |
351 StreamDeviceInfoArray devices, | 353 StreamDeviceInfoArray devices, |
352 gfx::NativeViewId window_id); | 354 gfx::NativeViewId window_id); |
353 | 355 |
354 // Task runner shared by VideoCaptureManager and AudioInputDeviceManager. | 356 // Task runner shared by VideoCaptureManager and AudioInputDeviceManager. |
355 // Note: Enumeration tasks may take seconds to complete so must never be run | 357 // Note: Enumeration tasks may take seconds to complete so must never be run |
356 // on any of the BrowserThreads (UI, IO, etc). See http://crbug.com/256945. | 358 // on any of the BrowserThreads (UI, IO, etc). See http://crbug.com/256945. |
(...skipping 24 matching lines...) Expand all Loading... |
381 | 383 |
382 bool use_fake_ui_; | 384 bool use_fake_ui_; |
383 scoped_ptr<FakeMediaStreamUIProxy> fake_ui_; | 385 scoped_ptr<FakeMediaStreamUIProxy> fake_ui_; |
384 | 386 |
385 DISALLOW_COPY_AND_ASSIGN(MediaStreamManager); | 387 DISALLOW_COPY_AND_ASSIGN(MediaStreamManager); |
386 }; | 388 }; |
387 | 389 |
388 } // namespace content | 390 } // namespace content |
389 | 391 |
390 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_MANAGER_H_ | 392 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_MANAGER_H_ |
OLD | NEW |