OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_CAPTURER_SOURCE_H_ | 5 #ifndef MEDIA_CAPTURE_VIDEO_CAPTURER_SOURCE_H_ |
6 #define MEDIA_CAPTURE_VIDEO_CAPTURER_SOURCE_H_ | 6 #define MEDIA_CAPTURE_VIDEO_CAPTURER_SOURCE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
48 using VideoCaptureDeviceFormatsCB = | 48 using VideoCaptureDeviceFormatsCB = |
49 base::Callback<void(const media::VideoCaptureFormats&)>; | 49 base::Callback<void(const media::VideoCaptureFormats&)>; |
50 | 50 |
51 using RunningCallback = base::Callback<void(bool)>; | 51 using RunningCallback = base::Callback<void(bool)>; |
52 | 52 |
53 // Collects the formats that can currently be used. | 53 // Collects the formats that can currently be used. |
54 // |max_requested_height|, |max_requested_width|, and | 54 // |max_requested_height|, |max_requested_width|, and |
55 // |max_requested_frame_rate| is used by Tab and Screen capture to decide what | 55 // |max_requested_frame_rate| is used by Tab and Screen capture to decide what |
56 // resolution/framerate to generate. |callback| is triggered when the formats | 56 // resolution/framerate to generate. |callback| is triggered when the formats |
57 // have been collected. | 57 // have been collected. |
58 // TODO(guidou): Remove this method. http://crbug.com/706408 | |
58 virtual void GetCurrentSupportedFormats( | 59 virtual void GetCurrentSupportedFormats( |
miu
2017/04/05 20:58:36
Does this still need to be a virtual method (are t
Guido Urdaneta
2017/04/05 21:14:59
Yes, LocalVideoCapturerSource (defined in user_med
| |
59 int max_requested_width, | 60 int max_requested_width, |
60 int max_requested_height, | 61 int max_requested_height, |
61 double max_requested_frame_rate, | 62 double max_requested_frame_rate, |
62 const VideoCaptureDeviceFormatsCB& callback) = 0; | 63 const VideoCaptureDeviceFormatsCB& callback); |
64 | |
65 // Returns formats that are preferred and can currently be used. May be empty | |
66 // if no formats are available or known. | |
67 virtual VideoCaptureFormats GetPreferredFormats() = 0; | |
63 | 68 |
64 // Starts capturing frames using the capture |params|. |new_frame_callback| is | 69 // Starts capturing frames using the capture |params|. |new_frame_callback| is |
65 // triggered when a new video frame is available. | 70 // triggered when a new video frame is available. |
66 // If capturing is started successfully then |running_callback| will be | 71 // If capturing is started successfully then |running_callback| will be |
67 // called with a parameter of true. Note that some implementations may | 72 // called with a parameter of true. Note that some implementations may |
68 // simply reject StartCapture (by calling running_callback with a false | 73 // simply reject StartCapture (by calling running_callback with a false |
69 // argument) if called with the wrong task runner. | 74 // argument) if called with the wrong task runner. |
70 // If capturing fails to start or stopped due to an external event then | 75 // If capturing fails to start or stopped due to an external event then |
71 // |running_callback| will be called with a parameter of false. | 76 // |running_callback| will be called with a parameter of false. |
72 // |running_callback| will always be called on the same thread as the | 77 // |running_callback| will always be called on the same thread as the |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
112 // Stops capturing frames and clears all callbacks including the | 117 // Stops capturing frames and clears all callbacks including the |
113 // SupportedFormatsCallback callback. Note that queued frame callbacks | 118 // SupportedFormatsCallback callback. Note that queued frame callbacks |
114 // may still occur after this call, so the caller must take care to | 119 // may still occur after this call, so the caller must take care to |
115 // use refcounted or weak references in |new_frame_callback|. | 120 // use refcounted or weak references in |new_frame_callback|. |
116 virtual void StopCapture() = 0; | 121 virtual void StopCapture() = 0; |
117 }; | 122 }; |
118 | 123 |
119 } // namespace media | 124 } // namespace media |
120 | 125 |
121 #endif // MEDIA_CAPTURE_VIDEO_CAPTURER_SOURCE_H_ | 126 #endif // MEDIA_CAPTURE_VIDEO_CAPTURER_SOURCE_H_ |
OLD | NEW |