| 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_BASE_VIDEO_CAPTURER_SOURCE_H_ | 5 #ifndef MEDIA_BASE_VIDEO_CAPTURER_SOURCE_H_ |
| 6 #define MEDIA_BASE_VIDEO_CAPTURER_SOURCE_H_ | 6 #define MEDIA_BASE_VIDEO_CAPTURER_SOURCE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // argument) if called with the wrong task runner. | 69 // argument) if called with the wrong task runner. |
| 70 // If capturing fails to start or stopped due to an external event then | 70 // If capturing fails to start or stopped due to an external event then |
| 71 // |running_callback| will be called with a parameter of false. | 71 // |running_callback| will be called with a parameter of false. |
| 72 // |running_callback| will always be called on the same thread as the | 72 // |running_callback| will always be called on the same thread as the |
| 73 // StartCapture. | 73 // StartCapture. |
| 74 virtual void StartCapture( | 74 virtual void StartCapture( |
| 75 const media::VideoCaptureParams& params, | 75 const media::VideoCaptureParams& params, |
| 76 const VideoCaptureDeliverFrameCB& new_frame_callback, | 76 const VideoCaptureDeliverFrameCB& new_frame_callback, |
| 77 const RunningCallback& running_callback) = 0; | 77 const RunningCallback& running_callback) = 0; |
| 78 | 78 |
| 79 // Asks source to send a refresh frame. In cases where source does not provide |
| 80 // a continuous rate of new frames (e.g. canvas capture, screen capture where |
| 81 // the screen's content has not changed in a while), consumers may request a |
| 82 // "refresh frame" to be delivered. For instance, this would be needed when |
| 83 // a new sink is added to a MediaStreamTrack. |
| 84 // The default implementation is a no-op and implementations are not required |
| 85 // to honor this request. If they decide to and capturing is started |
| 86 // successfully, then |new_frame_callback| should be called with a frame. |
| 87 virtual void RequestRefreshFrame() {} |
| 88 |
| 79 // Stops capturing frames and clears all callbacks including the | 89 // Stops capturing frames and clears all callbacks including the |
| 80 // SupportedFormatsCallback callback. Note that queued frame callbacks | 90 // SupportedFormatsCallback callback. Note that queued frame callbacks |
| 81 // may still occur after this call, so the caller must take care to | 91 // may still occur after this call, so the caller must take care to |
| 82 // use refcounted or weak references in |new_frame_callback|. | 92 // use refcounted or weak references in |new_frame_callback|. |
| 83 virtual void StopCapture() = 0; | 93 virtual void StopCapture() = 0; |
| 84 }; | 94 }; |
| 85 | 95 |
| 86 } // namespace media | 96 } // namespace media |
| 87 | 97 |
| 88 #endif // MEDIA_BASE_VIDEO_CAPTURER_SOURCE_H_ | 98 #endif // MEDIA_BASE_VIDEO_CAPTURER_SOURCE_H_ |
| OLD | NEW |