Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(352)

Side by Side Diff: content/browser/renderer_host/media/video_capture_manager.cc

Issue 100743003: Extend content::DesktopMediaID to allow Aura windows as capture sources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/video_capture_manager.h" 5 #include "content/browser/renderer_host/media/video_capture_manager.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
13 #include "base/stl_util.h" 13 #include "base/stl_util.h"
14 #include "base/task_runner_util.h" 14 #include "base/task_runner_util.h"
15 #include "base/threading/sequenced_worker_pool.h" 15 #include "base/threading/sequenced_worker_pool.h"
16 #include "content/browser/renderer_host/media/video_capture_controller.h" 16 #include "content/browser/renderer_host/media/video_capture_controller.h"
17 #include "content/browser/renderer_host/media/video_capture_controller_event_han dler.h" 17 #include "content/browser/renderer_host/media/video_capture_controller_event_han dler.h"
18 #include "content/browser/renderer_host/media/web_contents_video_capture_device. h" 18 #include "content/browser/renderer_host/media/web_contents_video_capture_device. h"
19 #include "content/public/browser/browser_thread.h" 19 #include "content/public/browser/browser_thread.h"
20 #include "content/public/browser/desktop_media_id.h"
20 #include "content/public/common/content_switches.h" 21 #include "content/public/common/content_switches.h"
21 #include "content/public/common/desktop_media_id.h"
22 #include "content/public/common/media_stream_request.h" 22 #include "content/public/common/media_stream_request.h"
23 #include "media/base/media_switches.h" 23 #include "media/base/media_switches.h"
24 #include "media/base/scoped_histogram_timer.h" 24 #include "media/base/scoped_histogram_timer.h"
25 #include "media/video/capture/fake_video_capture_device.h" 25 #include "media/video/capture/fake_video_capture_device.h"
26 #include "media/video/capture/file_video_capture_device.h" 26 #include "media/video/capture/file_video_capture_device.h"
27 #include "media/video/capture/video_capture_device.h" 27 #include "media/video/capture/video_capture_device.h"
28 28
29 #if defined(ENABLE_SCREEN_CAPTURE) 29 #if defined(ENABLE_SCREEN_CAPTURE)
30 #include "content/browser/renderer_host/media/desktop_capture_device.h" 30 #include "content/browser/renderer_host/media/desktop_capture_device.h"
31 #if defined(OS_CHROMEOS) 31 #if defined(USE_AURA)
32 #include "content/browser/renderer_host/media/desktop_capture_device_aura.h" 32 #include "content/browser/renderer_host/media/desktop_capture_device_aura.h"
33 #endif 33 #endif
34 #endif 34 #endif
35 35
36 namespace content { 36 namespace content {
37 37
38 VideoCaptureManager::DeviceEntry::DeviceEntry( 38 VideoCaptureManager::DeviceEntry::DeviceEntry(
39 MediaStreamType stream_type, 39 MediaStreamType stream_type,
40 const std::string& id, 40 const std::string& id,
41 scoped_ptr<VideoCaptureController> controller) 41 scoped_ptr<VideoCaptureController> controller)
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 break; 186 break;
187 } 187 }
188 case MEDIA_TAB_VIDEO_CAPTURE: { 188 case MEDIA_TAB_VIDEO_CAPTURE: {
189 video_capture_device.reset( 189 video_capture_device.reset(
190 WebContentsVideoCaptureDevice::Create(entry->id)); 190 WebContentsVideoCaptureDevice::Create(entry->id));
191 break; 191 break;
192 } 192 }
193 case MEDIA_DESKTOP_VIDEO_CAPTURE: { 193 case MEDIA_DESKTOP_VIDEO_CAPTURE: {
194 #if defined(ENABLE_SCREEN_CAPTURE) 194 #if defined(ENABLE_SCREEN_CAPTURE)
195 DesktopMediaID id = DesktopMediaID::Parse(entry->id); 195 DesktopMediaID id = DesktopMediaID::Parse(entry->id);
196 if (id.type != DesktopMediaID::TYPE_NONE) { 196 #if defined(USE_AURA)
197 #if defined(OS_CHROMEOS) 197 if (id.type == DesktopMediaID::TYPE_AURA_WINDOW) {
198 // TODO(hshi): enable this path for Ash windows in metro mode.
199 video_capture_device.reset(DesktopCaptureDeviceAura::Create(id)); 198 video_capture_device.reset(DesktopCaptureDeviceAura::Create(id));
200 #else 199 } else
200 #endif
201 if (id.type != DesktopMediaID::TYPE_NONE &&
202 id.type != DesktopMediaID::TYPE_AURA_WINDOW) {
201 video_capture_device = DesktopCaptureDevice::Create(id); 203 video_capture_device = DesktopCaptureDevice::Create(id);
202 #endif
203 } 204 }
204 #endif // defined(ENABLE_SCREEN_CAPTURE) 205 #endif // defined(ENABLE_SCREEN_CAPTURE)
205 break; 206 break;
206 } 207 }
207 default: { 208 default: {
208 NOTIMPLEMENTED(); 209 NOTIMPLEMENTED();
209 break; 210 break;
210 } 211 }
211 } 212 }
212 213
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 DeviceInfos& device_vector) { 527 DeviceInfos& device_vector) {
527 for (DeviceInfos::iterator it = device_vector.begin(); 528 for (DeviceInfos::iterator it = device_vector.begin();
528 it != device_vector.end(); ++it) { 529 it != device_vector.end(); ++it) {
529 if (it->name.id() == id) 530 if (it->name.id() == id)
530 return &(*it); 531 return &(*it);
531 } 532 }
532 return NULL; 533 return NULL;
533 } 534 }
534 535
535 } // namespace content 536 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/media/media_stream_manager.cc ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698