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 <vector> |
| 9 |
8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
9 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
10 #include "media/base/video_frame.h" | 12 #include "media/base/video_frame.h" |
11 #include "media/video/capture/video_capture_types.h" | 13 #include "media/video/capture/video_capture_types.h" |
12 #include "third_party/libjingle/source/talk/media/base/videocapturer.h" | 14 #include "third_party/libjingle/source/talk/media/base/videocapturer.h" |
13 | 15 |
14 namespace content { | 16 namespace content { |
15 | 17 |
16 // WebRtcVideoCapturerAdapter implements a simple cricket::VideoCapturer that is | 18 // WebRtcVideoCapturerAdapter implements a simple cricket::VideoCapturer that is |
17 // used for VideoCapturing in libJingle and especially in PeerConnections. | 19 // used for VideoCapturing in libJingle and especially in PeerConnections. |
(...skipping 19 matching lines...) Expand all Loading... |
37 // These methods are accessed from a libJingle worker thread. | 39 // These methods are accessed from a libJingle worker thread. |
38 virtual cricket::CaptureState Start( | 40 virtual cricket::CaptureState Start( |
39 const cricket::VideoFormat& capture_format) OVERRIDE; | 41 const cricket::VideoFormat& capture_format) OVERRIDE; |
40 virtual void Stop() OVERRIDE; | 42 virtual void Stop() OVERRIDE; |
41 virtual bool IsRunning() OVERRIDE; | 43 virtual bool IsRunning() OVERRIDE; |
42 virtual bool GetPreferredFourccs(std::vector<uint32>* fourccs) OVERRIDE; | 44 virtual bool GetPreferredFourccs(std::vector<uint32>* fourccs) OVERRIDE; |
43 virtual bool GetBestCaptureFormat(const cricket::VideoFormat& desired, | 45 virtual bool GetBestCaptureFormat(const cricket::VideoFormat& desired, |
44 cricket::VideoFormat* best_format) OVERRIDE; | 46 cricket::VideoFormat* best_format) OVERRIDE; |
45 virtual bool IsScreencast() const OVERRIDE; | 47 virtual bool IsScreencast() const OVERRIDE; |
46 | 48 |
| 49 void UpdateI420Buffer(const scoped_refptr<media::VideoFrame>& src); |
| 50 |
47 private: | 51 private: |
48 const bool is_screencast_; | 52 const bool is_screencast_; |
49 bool running_; | 53 bool running_; |
50 base::TimeDelta first_frame_timestamp_; | 54 base::TimeDelta first_frame_timestamp_; |
| 55 // |buffer_| used if cropping is needed. It is created only if needed and |
| 56 // owned by WebRtcVideoCapturerAdapter. If its created, it exists until |
| 57 // WebRtcVideoCapturerAdapter is destroyed. |
| 58 uint8* buffer_; |
| 59 size_t buffer_size_; |
| 60 scoped_ptr<cricket::CapturedFrame> captured_frame_; |
51 | 61 |
52 DISALLOW_COPY_AND_ASSIGN(WebRtcVideoCapturerAdapter); | 62 DISALLOW_COPY_AND_ASSIGN(WebRtcVideoCapturerAdapter); |
53 }; | 63 }; |
54 | 64 |
55 } // namespace content | 65 } // namespace content |
56 | 66 |
57 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_VIDEO_CAPTURER_ADAPTER_H_ | 67 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_VIDEO_CAPTURER_ADAPTER_H_ |
OLD | NEW |