| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_CAPTURER_SOURCE_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_CAPTURER_SOURCE_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_CAPTURER_SOURCE_H_ | 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_CAPTURER_SOURCE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 private: | 42 private: |
| 43 friend class CanvasCaptureHandlerTest; | 43 friend class CanvasCaptureHandlerTest; |
| 44 friend class MediaStreamVideoCapturerSourceTest; | 44 friend class MediaStreamVideoCapturerSourceTest; |
| 45 friend class MediaStreamVideoCapturerSourceOldConstraintsTest; | 45 friend class MediaStreamVideoCapturerSourceOldConstraintsTest; |
| 46 | 46 |
| 47 // MediaStreamVideoSource overrides. | 47 // MediaStreamVideoSource overrides. |
| 48 void RequestRefreshFrame() override; | 48 void RequestRefreshFrame() override; |
| 49 void OnHasConsumers(bool has_consumers) override; | 49 void OnHasConsumers(bool has_consumers) override; |
| 50 void OnCapturingLinkSecured(bool is_secure) override; | 50 void OnCapturingLinkSecured(bool is_secure) override; |
| 51 void StartSourceImpl( | 51 void StartSourceImpl( |
| 52 const media::VideoCaptureFormat& format, | |
| 53 const blink::WebMediaConstraints& constraints, | |
| 54 const VideoCaptureDeliverFrameCB& frame_callback) override; | 52 const VideoCaptureDeliverFrameCB& frame_callback) override; |
| 55 void StopSourceImpl() override; | 53 void StopSourceImpl() override; |
| 56 base::Optional<media::VideoCaptureFormat> GetCurrentFormatImpl() | 54 base::Optional<media::VideoCaptureFormat> GetCurrentFormatImpl() |
| 57 const override; | 55 const override; |
| 58 | 56 |
| 59 // RenderFrameObserver implementation. | 57 // RenderFrameObserver implementation. |
| 60 void OnDestruct() final {} | 58 void OnDestruct() final {} |
| 61 | 59 |
| 62 // Method to bind as RunningCallback in VideoCapturerSource::StartCapture(). | 60 // Method to bind as RunningCallback in VideoCapturerSource::StartCapture(). |
| 63 void OnRunStateChanged(bool is_running); | 61 void OnRunStateChanged(bool is_running); |
| 64 | 62 |
| 65 // The source that provides video frames. | 63 // The source that provides video frames. |
| 66 const std::unique_ptr<media::VideoCapturerSource> source_; | 64 const std::unique_ptr<media::VideoCapturerSource> source_; |
| 67 | 65 |
| 68 // Indicates whether the capture is in starting. It is set to true by | 66 // Indicates whether the capture is in starting. It is set to true by |
| 69 // StartSourceImpl() when starting the capture, and is reset after starting | 67 // StartSourceImpl() when starting the capture, and is reset after starting |
| 70 // is completed. | 68 // is completed. |
| 71 bool is_capture_starting_ = false; | 69 bool is_capture_starting_ = false; |
| 72 | 70 |
| 73 media::VideoCaptureParams capture_params_; | 71 media::VideoCaptureParams capture_params_; |
| 74 | 72 |
| 75 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoCapturerSource); | 73 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoCapturerSource); |
| 76 }; | 74 }; |
| 77 | 75 |
| 78 } // namespace content | 76 } // namespace content |
| 79 | 77 |
| 80 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_CAPTURER_SOURCE_H_ | 78 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_CAPTURER_SOURCE_H_ |
| OLD | NEW |