| 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> |
| 9 |
| 8 #include <vector> | 10 #include <vector> |
| 9 | 11 |
| 10 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/macros.h" |
| 11 #include "base/threading/thread_checker.h" | 14 #include "base/threading/thread_checker.h" |
| 12 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
| 13 #include "media/base/video_capture_types.h" | 16 #include "media/base/video_capture_types.h" |
| 14 #include "media/base/video_frame.h" | 17 #include "media/base/video_frame.h" |
| 15 #include "third_party/libjingle/source/talk/media/base/videocapturer.h" | 18 #include "third_party/libjingle/source/talk/media/base/videocapturer.h" |
| 16 | 19 |
| 17 namespace content { | 20 namespace content { |
| 18 | 21 |
| 19 // WebRtcVideoCapturerAdapter implements a simple cricket::VideoCapturer that is | 22 // WebRtcVideoCapturerAdapter implements a simple cricket::VideoCapturer that is |
| 20 // used for VideoCapturing in libJingle and especially in PeerConnections. | 23 // used for VideoCapturing in libJingle and especially in PeerConnections. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 35 // This method is virtual for testing purposes. | 38 // This method is virtual for testing purposes. |
| 36 virtual void OnFrameCaptured(const scoped_refptr<media::VideoFrame>& frame); | 39 virtual void OnFrameCaptured(const scoped_refptr<media::VideoFrame>& frame); |
| 37 | 40 |
| 38 private: | 41 private: |
| 39 // cricket::VideoCapturer implementation. | 42 // cricket::VideoCapturer implementation. |
| 40 // These methods are accessed from a libJingle worker thread. | 43 // These methods are accessed from a libJingle worker thread. |
| 41 cricket::CaptureState Start( | 44 cricket::CaptureState Start( |
| 42 const cricket::VideoFormat& capture_format) override; | 45 const cricket::VideoFormat& capture_format) override; |
| 43 void Stop() override; | 46 void Stop() override; |
| 44 bool IsRunning() override; | 47 bool IsRunning() override; |
| 45 bool GetPreferredFourccs(std::vector<uint32>* fourccs) override; | 48 bool GetPreferredFourccs(std::vector<uint32_t>* fourccs) override; |
| 46 bool GetBestCaptureFormat(const cricket::VideoFormat& desired, | 49 bool GetBestCaptureFormat(const cricket::VideoFormat& desired, |
| 47 cricket::VideoFormat* best_format) override; | 50 cricket::VideoFormat* best_format) override; |
| 48 bool IsScreencast() const override; | 51 bool IsScreencast() const override; |
| 49 | 52 |
| 50 // |thread_checker_| is bound to the libjingle worker thread. | 53 // |thread_checker_| is bound to the libjingle worker thread. |
| 51 base::ThreadChecker thread_checker_; | 54 base::ThreadChecker thread_checker_; |
| 52 | 55 |
| 53 const bool is_screencast_; | 56 const bool is_screencast_; |
| 54 bool running_; | 57 bool running_; |
| 55 | 58 |
| 56 class MediaVideoFrameFactory; | 59 class MediaVideoFrameFactory; |
| 57 | 60 |
| 58 DISALLOW_COPY_AND_ASSIGN(WebRtcVideoCapturerAdapter); | 61 DISALLOW_COPY_AND_ASSIGN(WebRtcVideoCapturerAdapter); |
| 59 }; | 62 }; |
| 60 | 63 |
| 61 } // namespace content | 64 } // namespace content |
| 62 | 65 |
| 63 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_VIDEO_CAPTURER_ADAPTER_H_ | 66 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_VIDEO_CAPTURER_ADAPTER_H_ |
| OLD | NEW |