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

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

Issue 1140113002: Implement screen capture for android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make ScreenCapturerAndroid inherit VideoCaptureDevice Created 5 years, 7 months 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
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 <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
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
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) {
mcasas 2015/05/22 02:30:58 indent. No need for {}
425 video_capture_device = media::ScreenCaptureFactoryAndroid::Create();
426 }
427 #else
420 video_capture_device = DesktopCaptureDevice::Create(desktop_id); 428 video_capture_device = DesktopCaptureDevice::Create(desktop_id);
429 #endif
421 } 430 }
422 #endif // defined(ENABLE_SCREEN_CAPTURE) 431 #endif // defined(ENABLE_SCREEN_CAPTURE)
423 break; 432 break;
424 } 433 }
425 default: { 434 default: {
426 NOTIMPLEMENTED(); 435 NOTIMPLEMENTED();
427 break; 436 break;
428 } 437 }
429 } 438 }
430 439
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 DCHECK(IsOnDeviceThread()); 866 DCHECK(IsOnDeviceThread());
858 #if defined(ENABLE_SCREEN_CAPTURE) 867 #if defined(ENABLE_SCREEN_CAPTURE)
859 DesktopCaptureDevice* desktop_device = 868 DesktopCaptureDevice* desktop_device =
860 static_cast<DesktopCaptureDevice*>(device); 869 static_cast<DesktopCaptureDevice*>(device);
861 desktop_device->SetNotificationWindowId(window_id); 870 desktop_device->SetNotificationWindowId(window_id);
862 VLOG(2) << "Screen capture notification window passed on device thread."; 871 VLOG(2) << "Screen capture notification window passed on device thread.";
863 #endif 872 #endif
864 } 873 }
865 874
866 } // namespace content 875 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698