| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // the first video frame delivered may not have timestamp equal to 0. | 43 // the first video frame delivered may not have timestamp equal to 0. |
| 44 using VideoCaptureDeliverFrameCB = | 44 using VideoCaptureDeliverFrameCB = |
| 45 base::Callback<void(const scoped_refptr<media::VideoFrame>& video_frame, | 45 base::Callback<void(const scoped_refptr<media::VideoFrame>& video_frame, |
| 46 base::TimeTicks estimated_capture_time)>; | 46 base::TimeTicks estimated_capture_time)>; |
| 47 | 47 |
| 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. | |
| 54 // |max_requested_height|, |max_requested_width|, and | |
| 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 | |
| 57 // have been collected. | |
| 58 // TODO(guidou): Remove this method. http://crbug.com/706408 | |
| 59 virtual void GetCurrentSupportedFormats( | |
| 60 int max_requested_width, | |
| 61 int max_requested_height, | |
| 62 double max_requested_frame_rate, | |
| 63 const VideoCaptureDeviceFormatsCB& callback); | |
| 64 | |
| 65 // Returns formats that are preferred and can currently be used. May be empty | 53 // Returns formats that are preferred and can currently be used. May be empty |
| 66 // if no formats are available or known. | 54 // if no formats are available or known. |
| 67 virtual VideoCaptureFormats GetPreferredFormats() = 0; | 55 virtual VideoCaptureFormats GetPreferredFormats() = 0; |
| 68 | 56 |
| 69 // Starts capturing frames using the capture |params|. |new_frame_callback| is | 57 // Starts capturing frames using the capture |params|. |new_frame_callback| is |
| 70 // triggered when a new video frame is available. | 58 // triggered when a new video frame is available. |
| 71 // If capturing is started successfully then |running_callback| will be | 59 // If capturing is started successfully then |running_callback| will be |
| 72 // called with a parameter of true. Note that some implementations may | 60 // called with a parameter of true. Note that some implementations may |
| 73 // simply reject StartCapture (by calling running_callback with a false | 61 // simply reject StartCapture (by calling running_callback with a false |
| 74 // argument) if called with the wrong task runner. | 62 // argument) if called with the wrong task runner. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // Stops capturing frames and clears all callbacks including the | 105 // Stops capturing frames and clears all callbacks including the |
| 118 // SupportedFormatsCallback callback. Note that queued frame callbacks | 106 // SupportedFormatsCallback callback. Note that queued frame callbacks |
| 119 // may still occur after this call, so the caller must take care to | 107 // may still occur after this call, so the caller must take care to |
| 120 // use refcounted or weak references in |new_frame_callback|. | 108 // use refcounted or weak references in |new_frame_callback|. |
| 121 virtual void StopCapture() = 0; | 109 virtual void StopCapture() = 0; |
| 122 }; | 110 }; |
| 123 | 111 |
| 124 } // namespace media | 112 } // namespace media |
| 125 | 113 |
| 126 #endif // MEDIA_CAPTURE_VIDEO_CAPTURER_SOURCE_H_ | 114 #endif // MEDIA_CAPTURE_VIDEO_CAPTURER_SOURCE_H_ |
| OLD | NEW |