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 #include "content/browser/renderer_host/media/media_stream_manager.h" | 5 #include "content/browser/renderer_host/media/media_stream_manager.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/rand_util.h" | 14 #include "base/rand_util.h" |
15 #include "base/run_loop.h" | 15 #include "base/run_loop.h" |
16 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" |
17 #include "content/browser/renderer_host/media/audio_input_device_manager.h" | 17 #include "content/browser/renderer_host/media/audio_input_device_manager.h" |
18 #include "content/browser/renderer_host/media/device_request_message_filter.h" | 18 #include "content/browser/renderer_host/media/device_request_message_filter.h" |
19 #include "content/browser/renderer_host/media/media_stream_requester.h" | 19 #include "content/browser/renderer_host/media/media_stream_requester.h" |
20 #include "content/browser/renderer_host/media/media_stream_ui_proxy.h" | 20 #include "content/browser/renderer_host/media/media_stream_ui_proxy.h" |
21 #include "content/browser/renderer_host/media/video_capture_manager.h" | 21 #include "content/browser/renderer_host/media/video_capture_manager.h" |
22 #include "content/browser/renderer_host/media/web_contents_capture_util.h" | 22 #include "content/browser/renderer_host/media/web_contents_capture_util.h" |
23 #include "content/public/browser/browser_thread.h" | 23 #include "content/public/browser/browser_thread.h" |
24 #include "content/public/browser/content_browser_client.h" | 24 #include "content/public/browser/content_browser_client.h" |
25 #include "content/public/browser/media_device_id.h" | 25 #include "content/public/browser/media_device_id.h" |
26 #include "content/public/browser/media_observer.h" | 26 #include "content/public/browser/media_observer.h" |
27 #include "content/public/browser/media_request_state.h" | 27 #include "content/public/browser/media_request_state.h" |
28 #include "content/public/common/content_switches.h" | 28 #include "content/public/common/content_switches.h" |
29 #include "content/public/common/desktop_media_id.h" | |
30 #include "content/public/common/media_stream_request.h" | 29 #include "content/public/common/media_stream_request.h" |
31 #include "media/audio/audio_manager_base.h" | 30 #include "media/audio/audio_manager_base.h" |
32 #include "media/audio/audio_parameters.h" | 31 #include "media/audio/audio_parameters.h" |
33 #include "media/base/channel_layout.h" | 32 #include "media/base/channel_layout.h" |
34 #include "url/gurl.h" | 33 #include "url/gurl.h" |
35 | 34 |
36 #if defined(OS_WIN) | 35 #if defined(OS_WIN) |
37 #include "base/win/scoped_com_initializer.h" | 36 #include "base/win/scoped_com_initializer.h" |
38 #endif | 37 #endif |
39 | 38 |
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1089 bool mandatory = false; | 1088 bool mandatory = false; |
1090 if (!request->options.GetFirstVideoConstraintByName( | 1089 if (!request->options.GetFirstVideoConstraintByName( |
1091 kMediaStreamSource, | 1090 kMediaStreamSource, |
1092 &video_stream_source, | 1091 &video_stream_source, |
1093 &mandatory)) { | 1092 &mandatory)) { |
1094 LOG(ERROR) << kMediaStreamSource << " not found."; | 1093 LOG(ERROR) << kMediaStreamSource << " not found."; |
1095 return false; | 1094 return false; |
1096 } | 1095 } |
1097 DCHECK(mandatory); | 1096 DCHECK(mandatory); |
1098 | 1097 |
1099 if (video_stream_source == kMediaStreamSourceScreen) { | 1098 if (video_stream_source == kMediaStreamSourceDesktop) { |
1100 video_device_id = | |
1101 DesktopMediaID(DesktopMediaID::TYPE_SCREEN, 0).ToString(); | |
1102 } else if (video_stream_source == kMediaStreamSourceDesktop) { | |
1103 if (!request->options.GetFirstVideoConstraintByName( | 1099 if (!request->options.GetFirstVideoConstraintByName( |
1104 kMediaStreamSourceId, | 1100 kMediaStreamSourceId, |
1105 &video_device_id, | 1101 &video_device_id, |
1106 &mandatory)) { | 1102 &mandatory)) { |
1107 LOG(ERROR) << kMediaStreamSourceId << " not found."; | 1103 LOG(ERROR) << kMediaStreamSourceId << " not found."; |
1108 return false; | 1104 return false; |
1109 } | 1105 } |
1110 DCHECK(mandatory); | 1106 DCHECK(mandatory); |
1111 } | 1107 } |
1112 } | 1108 } |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1639 } | 1635 } |
1640 | 1636 |
1641 // Always do enumeration even though some enumeration is in progress, | 1637 // Always do enumeration even though some enumeration is in progress, |
1642 // because those enumeration commands could be sent before these devices | 1638 // because those enumeration commands could be sent before these devices |
1643 // change. | 1639 // change. |
1644 ++active_enumeration_ref_count_[stream_type]; | 1640 ++active_enumeration_ref_count_[stream_type]; |
1645 GetDeviceManager(stream_type)->EnumerateDevices(stream_type); | 1641 GetDeviceManager(stream_type)->EnumerateDevices(stream_type); |
1646 } | 1642 } |
1647 | 1643 |
1648 } // namespace content | 1644 } // namespace content |
OLD | NEW |