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

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

Issue 2123863004: ScreenCapture for Android phase1, part II (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: UI tweaking and rebase Created 4 years, 4 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 #include <utility> 9 #include <utility>
10 10
(...skipping 21 matching lines...) Expand all
32 #include "media/base/bind_to_current_loop.h" 32 #include "media/base/bind_to_current_loop.h"
33 #include "media/base/media_switches.h" 33 #include "media/base/media_switches.h"
34 #include "media/capture/video/video_capture_device.h" 34 #include "media/capture/video/video_capture_device.h"
35 #include "media/capture/video/video_capture_device_factory.h" 35 #include "media/capture/video/video_capture_device_factory.h"
36 36
37 #if defined(ENABLE_SCREEN_CAPTURE) 37 #if defined(ENABLE_SCREEN_CAPTURE)
38 #include "content/browser/media/capture/desktop_capture_device.h" 38 #include "content/browser/media/capture/desktop_capture_device.h"
39 #if defined(USE_AURA) 39 #if defined(USE_AURA)
40 #include "content/browser/media/capture/desktop_capture_device_aura.h" 40 #include "content/browser/media/capture/desktop_capture_device_aura.h"
41 #endif 41 #endif
42 #if defined(OS_ANDROID)
43 #include "content/browser/media/capture/screen_capture_device_android.h"
44 #endif
42 #endif 45 #endif
43 46
44 #if defined(OS_MACOSX) 47 #if defined(OS_MACOSX)
45 #include "media/base/mac/avfoundation_glue.h" 48 #include "media/base/mac/avfoundation_glue.h"
46 #endif 49 #endif
47 50
48 namespace { 51 namespace {
49 52
50 // Compares two VideoCaptureFormat by checking smallest frame_size area, then 53 // Compares two VideoCaptureFormat by checking smallest frame_size area, then
51 // by _largest_ frame_rate. Used to order a VideoCaptureFormats vector so that 54 // by _largest_ frame_rate. Used to order a VideoCaptureFormats vector so that
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 device_client->OnError(FROM_HERE, "Desktop media ID is null"); 619 device_client->OnError(FROM_HERE, "Desktop media ID is null");
617 return nullptr; 620 return nullptr;
618 } 621 }
619 622
620 if (desktop_id.type == DesktopMediaID::TYPE_WEB_CONTENTS) { 623 if (desktop_id.type == DesktopMediaID::TYPE_WEB_CONTENTS) {
621 video_capture_device.reset(WebContentsVideoCaptureDevice::Create(id)); 624 video_capture_device.reset(WebContentsVideoCaptureDevice::Create(id));
622 IncrementDesktopCaptureCounter(TAB_VIDEO_CAPTURER_CREATED); 625 IncrementDesktopCaptureCounter(TAB_VIDEO_CAPTURER_CREATED);
623 } else { 626 } else {
624 #if defined(USE_AURA) 627 #if defined(USE_AURA)
625 video_capture_device = DesktopCaptureDeviceAura::Create(desktop_id); 628 video_capture_device = DesktopCaptureDeviceAura::Create(desktop_id);
629 #elif defined(OS_ANDROID)
630 DCHECK(desktop_id.type == DesktopMediaID::TYPE_SCREEN);
631 video_capture_device = base::WrapUnique(new ScreenCaptureDeviceAndroid());
626 #endif 632 #endif
627 if (!video_capture_device) 633 if (!video_capture_device)
628 video_capture_device = DesktopCaptureDevice::Create(desktop_id); 634 video_capture_device = DesktopCaptureDevice::Create(desktop_id);
629 } 635 }
630 #endif // defined(ENABLE_SCREEN_CAPTURE) 636 #endif // defined(ENABLE_SCREEN_CAPTURE)
631 637
632 if (!video_capture_device) { 638 if (!video_capture_device) {
633 device_client->OnError(FROM_HERE, "Could not create capture device"); 639 device_client->OnError(FROM_HERE, "Could not create capture device");
634 return nullptr; 640 return nullptr;
635 } 641 }
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
1260 if (!device_in_queue) { 1266 if (!device_in_queue) {
1261 // Session ID is only valid for Screen capture. So we can fake it to 1267 // Session ID is only valid for Screen capture. So we can fake it to
1262 // resume video capture devices here. 1268 // resume video capture devices here.
1263 QueueStartDevice(kFakeSessionId, entry.get(), entry->parameters); 1269 QueueStartDevice(kFakeSessionId, entry.get(), entry->parameters);
1264 } 1270 }
1265 } 1271 }
1266 } 1272 }
1267 #endif // defined(OS_ANDROID) 1273 #endif // defined(OS_ANDROID)
1268 1274
1269 } // namespace content 1275 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698