| 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_WEBRTC_WEBRTC_VIDEO_CAPTURER_ADAPTER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_VIDEO_CAPTURER_ADAPTER_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_VIDEO_CAPTURER_ADAPTER_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_VIDEO_CAPTURER_ADAPTER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 class CONTENT_EXPORT WebRtcVideoCapturerAdapter | 31 class CONTENT_EXPORT WebRtcVideoCapturerAdapter |
| 32 : NON_EXPORTED_BASE(public cricket::VideoCapturer) { | 32 : NON_EXPORTED_BASE(public cricket::VideoCapturer) { |
| 33 public: | 33 public: |
| 34 explicit WebRtcVideoCapturerAdapter(bool is_screencast); | 34 explicit WebRtcVideoCapturerAdapter(bool is_screencast); |
| 35 ~WebRtcVideoCapturerAdapter() override; | 35 ~WebRtcVideoCapturerAdapter() override; |
| 36 | 36 |
| 37 // OnFrameCaptured delivers video frames to libjingle. It must be called on | 37 // OnFrameCaptured delivers video frames to libjingle. It must be called on |
| 38 // libjingles worker thread. | 38 // libjingles worker thread. |
| 39 // This method is virtual for testing purposes. | 39 // This method is virtual for testing purposes. |
| 40 virtual void OnFrameCaptured(const scoped_refptr<media::VideoFrame>& frame); | 40 virtual void OnFrameCaptured(const scoped_refptr<media::VideoFrame>& frame); |
| 41 void OnFrameCopied(int64_t translated_camera_time_us, |
| 42 const scoped_refptr<media::VideoFrame>& frame); |
| 41 | 43 |
| 42 private: | 44 private: |
| 43 // cricket::VideoCapturer implementation. | 45 // cricket::VideoCapturer implementation. |
| 44 // These methods are accessed from a libJingle worker thread. | 46 // These methods are accessed from a libJingle worker thread. |
| 45 cricket::CaptureState Start( | 47 cricket::CaptureState Start( |
| 46 const cricket::VideoFormat& capture_format) override; | 48 const cricket::VideoFormat& capture_format) override; |
| 47 void Stop() override; | 49 void Stop() override; |
| 48 bool IsRunning() override; | 50 bool IsRunning() override; |
| 49 bool GetPreferredFourccs(std::vector<uint32_t>* fourccs) override; | 51 bool GetPreferredFourccs(std::vector<uint32_t>* fourccs) override; |
| 50 bool GetBestCaptureFormat(const cricket::VideoFormat& desired, | 52 bool GetBestCaptureFormat(const cricket::VideoFormat& desired, |
| 51 cricket::VideoFormat* best_format) override; | 53 cricket::VideoFormat* best_format) override; |
| 52 bool IsScreencast() const override; | 54 bool IsScreencast() const override; |
| 53 | 55 |
| 56 // Helper class used for copying texture backed frames. |
| 57 class TextureFrameCopier; |
| 58 const scoped_refptr<TextureFrameCopier> texture_copier_; |
| 59 |
| 54 // |thread_checker_| is bound to the libjingle worker thread. | 60 // |thread_checker_| is bound to the libjingle worker thread. |
| 55 base::ThreadChecker thread_checker_; | 61 base::ThreadChecker thread_checker_; |
| 56 | 62 |
| 57 const bool is_screencast_; | 63 const bool is_screencast_; |
| 58 bool running_; | 64 bool running_; |
| 59 | 65 |
| 60 media::VideoFramePool scaled_frame_pool_; | 66 media::VideoFramePool scaled_frame_pool_; |
| 61 | 67 |
| 62 DISALLOW_COPY_AND_ASSIGN(WebRtcVideoCapturerAdapter); | 68 DISALLOW_COPY_AND_ASSIGN(WebRtcVideoCapturerAdapter); |
| 63 }; | 69 }; |
| 64 | 70 |
| 65 } // namespace content | 71 } // namespace content |
| 66 | 72 |
| 67 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_VIDEO_CAPTURER_ADAPTER_H_ | 73 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_VIDEO_CAPTURER_ADAPTER_H_ |
| OLD | NEW |