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

Side by Side Diff: media/capture/video/video_capture_system.h

Issue 2769543002: [Mojo Video Capture] Introduce abstraction VideoCaptureSystem (Closed)
Patch Set: Created 3 years, 9 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
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_SYSTEM_H_
6 #define MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_SYSTEM_H_
7
8 #include "media/capture/video/video_capture_device_factory.h"
9 #include "media/capture/video/video_capture_device_info.h"
10
11 namespace media {
12
13 // Layer on top of VideoCaptureDeviceFactory that translates device descriptors
14 // to string identifiers and consolidates and caches device descriptors and
15 // supported formats into VideoCaptureDeviceInfos.
16 class CAPTURE_EXPORT VideoCaptureSystem {
17 public:
18 VideoCaptureSystem(std::unique_ptr<VideoCaptureDeviceFactory> factory);
miu 2017/03/22 22:51:24 explicit
chfremer 2017/03/23 00:34:13 Done.
19 ~VideoCaptureSystem();
20
21 void GetDeviceInfosAsync(
22 const base::Callback<void(const std::vector<VideoCaptureDeviceInfo>&)>&
miu 2017/03/22 22:51:23 nit: Since the callback is used in more than one p
chfremer 2017/03/23 00:34:13 Done.
23 result_callback);
24
25 // Creates a VideoCaptureDevice object. Returns NULL if something goes wrong.
26 std::unique_ptr<VideoCaptureDevice> CreateDevice(const std::string device_id);
27
28 media::VideoCaptureDeviceFactory* video_capture_device_factory() {
miu 2017/03/22 22:51:24 nit: media::VideoCaptureDeviceFactory* video_ca
miu 2017/03/22 22:51:24 Is the plan to remove this accessor in later CLs,
chfremer 2017/03/23 00:34:13 Done.
chfremer 2017/03/23 00:34:13 Yes. This accessor is going to go away in CL19.
29 return factory_.get();
30 }
31
32 private:
33 void OnDescriptorsReceived(
34 const base::Callback<void(const std::vector<VideoCaptureDeviceInfo>&)>&
miu 2017/03/22 22:51:24 DeviceInfoCallback here. (and in the methods in th
chfremer 2017/03/23 00:34:14 Done.
35 result_callback,
36 std::unique_ptr<VideoCaptureDeviceDescriptors> descriptors);
37
38 // Returns false if no descriptor found.
39 bool LookupDescriptorFromId(const std::string& device_id,
40 media::VideoCaptureDeviceDescriptor* descriptor);
41
42 const std::unique_ptr<VideoCaptureDeviceFactory> factory_;
43 std::vector<VideoCaptureDeviceInfo> devices_info_cache_;
44 };
45
46 } // namespace media
47
48 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698