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

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

Issue 2824883005: [Mojo Video Capture] Stop service when last client disconnects. (Closed)
Patch Set: Incorporate suggestions from PatchSet #4 Created 3 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
« no previous file with comments | « media/capture/video/video_capture_device_client.cc ('k') | services/video_capture/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #ifndef MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_SYSTEM_H_ 5 #ifndef MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_SYSTEM_H_
6 #define MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_SYSTEM_H_ 6 #define MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_SYSTEM_H_
7 7
8 #include "media/capture/video/video_capture_device_factory.h" 8 #include "media/capture/video/video_capture_device_factory.h"
9 #include "media/capture/video/video_capture_device_info.h" 9 #include "media/capture/video/video_capture_device_info.h"
10 10
11 namespace media { 11 namespace media {
12 12
13 // GetDeviceInfosAsync() should be called at least once before calling
14 // CreateDevice(), because otherwise CreateDevice() will allways return nullptr.
13 class CAPTURE_EXPORT VideoCaptureSystem { 15 class CAPTURE_EXPORT VideoCaptureSystem {
14 public: 16 public:
15 using DeviceInfoCallback = 17 using DeviceInfoCallback =
16 base::Callback<void(const std::vector<VideoCaptureDeviceInfo>&)>; 18 base::Callback<void(const std::vector<VideoCaptureDeviceInfo>&)>;
17 19
18 virtual ~VideoCaptureSystem() {} 20 virtual ~VideoCaptureSystem() {}
19 21
20 // The passed-in |result_callback| must have ownership of the called 22 // The passed-in |result_callback| must have ownership of the called
21 // VideoCaptureSystem instance to guarantee that it stays alive during the 23 // VideoCaptureSystem instance to guarantee that it stays alive during the
22 // asynchronous operation. 24 // asynchronous operation.
23 virtual void GetDeviceInfosAsync( 25 virtual void GetDeviceInfosAsync(
24 const DeviceInfoCallback& result_callback) = 0; 26 const DeviceInfoCallback& result_callback) = 0;
25 27
26 // Creates a VideoCaptureDevice object. Returns nullptr if something goes 28 // Creates a VideoCaptureDevice object. Returns nullptr if something goes
27 // wrong. 29 // wrong.
28 virtual std::unique_ptr<VideoCaptureDevice> CreateDevice( 30 virtual std::unique_ptr<VideoCaptureDevice> CreateDevice(
29 const std::string& device_id) = 0; 31 const std::string& device_id) = 0;
30 }; 32 };
31 33
32 } // namespace media 34 } // namespace media
33 35
34 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_SYSTEM_H_ 36 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_SYSTEM_H_
OLDNEW
« no previous file with comments | « media/capture/video/video_capture_device_client.cc ('k') | services/video_capture/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698