Chromium Code Reviews| 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/video_capture_manager.h" | 5 #include "content/browser/renderer_host/media/video_capture_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 #include "content/browser/renderer_host/media/video_capture_controller_event_han dler.h" | 21 #include "content/browser/renderer_host/media/video_capture_controller_event_han dler.h" |
| 22 #include "content/public/browser/browser_thread.h" | 22 #include "content/public/browser/browser_thread.h" |
| 23 #include "content/public/browser/desktop_media_id.h" | 23 #include "content/public/browser/desktop_media_id.h" |
| 24 #include "content/public/common/media_stream_request.h" | 24 #include "content/public/common/media_stream_request.h" |
| 25 #include "media/base/bind_to_current_loop.h" | 25 #include "media/base/bind_to_current_loop.h" |
| 26 #include "media/video/capture/video_capture_device.h" | 26 #include "media/video/capture/video_capture_device.h" |
| 27 #include "media/video/capture/video_capture_device_factory.h" | 27 #include "media/video/capture/video_capture_device_factory.h" |
| 28 | 28 |
| 29 #if defined(ENABLE_SCREEN_CAPTURE) | 29 #if defined(ENABLE_SCREEN_CAPTURE) |
| 30 #include "content/browser/media/capture/desktop_capture_device.h" | 30 #include "content/browser/media/capture/desktop_capture_device.h" |
| 31 #if defined(OS_ANDROID) | |
| 32 #include "media/screen_capture/android/screen_capture_factory_android.h" | |
| 33 #endif | |
| 31 #if defined(USE_AURA) | 34 #if defined(USE_AURA) |
| 32 #include "content/browser/media/capture/desktop_capture_device_aura.h" | 35 #include "content/browser/media/capture/desktop_capture_device_aura.h" |
| 33 #endif | 36 #endif |
| 34 #endif | 37 #endif |
| 35 | 38 |
| 36 namespace { | 39 namespace { |
| 37 | 40 |
| 38 // Compares two VideoCaptureFormat by checking smallest frame_size area, then | 41 // Compares two VideoCaptureFormat by checking smallest frame_size area, then |
| 39 // by _largest_ frame_rate. Used to order a VideoCaptureFormats vector so that | 42 // by _largest_ frame_rate. Used to order a VideoCaptureFormats vector so that |
| 40 // the first entry for a given resolution has the largest frame rate, as needed | 43 // the first entry for a given resolution has the largest frame rate, as needed |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 410 #if defined(ENABLE_SCREEN_CAPTURE) | 413 #if defined(ENABLE_SCREEN_CAPTURE) |
| 411 DesktopMediaID desktop_id = DesktopMediaID::Parse(id); | 414 DesktopMediaID desktop_id = DesktopMediaID::Parse(id); |
| 412 #if defined(USE_AURA) | 415 #if defined(USE_AURA) |
| 413 if (desktop_id.type == DesktopMediaID::TYPE_AURA_WINDOW) { | 416 if (desktop_id.type == DesktopMediaID::TYPE_AURA_WINDOW) { |
| 414 video_capture_device.reset( | 417 video_capture_device.reset( |
| 415 DesktopCaptureDeviceAura::Create(desktop_id)); | 418 DesktopCaptureDeviceAura::Create(desktop_id)); |
| 416 } else | 419 } else |
| 417 #endif | 420 #endif |
| 418 if (desktop_id.type != DesktopMediaID::TYPE_NONE && | 421 if (desktop_id.type != DesktopMediaID::TYPE_NONE && |
| 419 desktop_id.type != DesktopMediaID::TYPE_AURA_WINDOW) { | 422 desktop_id.type != DesktopMediaID::TYPE_AURA_WINDOW) { |
| 423 #if defined(OS_ANDROID) | |
| 424 if (desktop_id.type == DesktopMediaID::TYPE_SCREEN) | |
|
whywhat
2015/08/17 13:58:46
nit: fix indent (add 2 spaces)?
is it okay to leav
| |
| 425 video_capture_device = media::ScreenCaptureFactoryAndroid::Create(); | |
| 426 #else | |
| 420 video_capture_device = DesktopCaptureDevice::Create(desktop_id); | 427 video_capture_device = DesktopCaptureDevice::Create(desktop_id); |
| 428 #endif | |
| 421 } | 429 } |
| 422 #endif // defined(ENABLE_SCREEN_CAPTURE) | 430 #endif // defined(ENABLE_SCREEN_CAPTURE) |
| 423 break; | 431 break; |
| 424 } | 432 } |
| 425 default: { | 433 default: { |
| 426 NOTIMPLEMENTED(); | 434 NOTIMPLEMENTED(); |
| 427 break; | 435 break; |
| 428 } | 436 } |
| 429 } | 437 } |
| 430 | 438 |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 857 DCHECK(IsOnDeviceThread()); | 865 DCHECK(IsOnDeviceThread()); |
| 858 #if defined(ENABLE_SCREEN_CAPTURE) | 866 #if defined(ENABLE_SCREEN_CAPTURE) |
| 859 DesktopCaptureDevice* desktop_device = | 867 DesktopCaptureDevice* desktop_device = |
| 860 static_cast<DesktopCaptureDevice*>(device); | 868 static_cast<DesktopCaptureDevice*>(device); |
| 861 desktop_device->SetNotificationWindowId(window_id); | 869 desktop_device->SetNotificationWindowId(window_id); |
| 862 VLOG(2) << "Screen capture notification window passed on device thread."; | 870 VLOG(2) << "Screen capture notification window passed on device thread."; |
| 863 #endif | 871 #endif |
| 864 } | 872 } |
| 865 | 873 |
| 866 } // namespace content | 874 } // namespace content |
| OLD | NEW |