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 REMOTING_PROTOCOL_WEBRTC_VIDEO_CAPTURER_ADAPTER_H_ | 5 #ifndef REMOTING_PROTOCOL_WEBRTC_VIDEO_CAPTURER_ADAPTER_H_ |
6 #define REMOTING_PROTOCOL_WEBRTC_VIDEO_CAPTURER_ADAPTER_H_ | 6 #define REMOTING_PROTOCOL_WEBRTC_VIDEO_CAPTURER_ADAPTER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... | |
36 // This class controls the capture of video frames from the desktop and is used | 36 // This class controls the capture of video frames from the desktop and is used |
37 // to construct a VideoSource as part of the webrtc PeerConnection API. | 37 // to construct a VideoSource as part of the webrtc PeerConnection API. |
38 // WebrtcVideoCapturerAdapter acts as an adapter between webrtc::DesktopCapturer | 38 // WebrtcVideoCapturerAdapter acts as an adapter between webrtc::DesktopCapturer |
39 // and the cricket::VideoCapturer interface, which it implements. It is used | 39 // and the cricket::VideoCapturer interface, which it implements. It is used |
40 // to construct a cricket::VideoSource for a PeerConnection, to capture frames | 40 // to construct a cricket::VideoSource for a PeerConnection, to capture frames |
41 // of the desktop. As indicated in the base implementation, Start() and Stop() | 41 // of the desktop. As indicated in the base implementation, Start() and Stop() |
42 // should be called on the same thread. | 42 // should be called on the same thread. |
43 class WebrtcVideoCapturerAdapter : public cricket::VideoCapturer, | 43 class WebrtcVideoCapturerAdapter : public cricket::VideoCapturer, |
44 public webrtc::DesktopCapturer::Callback { | 44 public webrtc::DesktopCapturer::Callback { |
45 public: | 45 public: |
46 typedef base::Callback<void(const webrtc::DesktopSize& size)> SizeCallback; | 46 typedef base::Callback<void(const webrtc::DesktopSize& size, |
47 const webrtc::DesktopVector& dpi)> | |
48 SizeCallback; | |
Jamie
2016/03/31 00:35:53
Do we need to define this twice?
Sergey Ulanov
2016/03/31 06:25:14
Removed this one now.
| |
47 | 49 |
48 explicit WebrtcVideoCapturerAdapter( | 50 explicit WebrtcVideoCapturerAdapter( |
49 scoped_ptr<webrtc::DesktopCapturer> capturer); | 51 scoped_ptr<webrtc::DesktopCapturer> capturer); |
50 ~WebrtcVideoCapturerAdapter() override; | 52 ~WebrtcVideoCapturerAdapter() override; |
51 | 53 |
52 void SetSizeCallback(const SizeCallback& size_callback); | 54 void SetSizeCallback(const SizeCallback& size_callback); |
53 bool PauseCapturer(bool pause); | 55 bool PauseCapturer(bool pause); |
54 base::WeakPtr<WebrtcVideoCapturerAdapter> GetWeakPtr(); | 56 base::WeakPtr<WebrtcVideoCapturerAdapter> GetWeakPtr(); |
55 | 57 |
56 // cricket::VideoCapturer implementation. | 58 // cricket::VideoCapturer implementation. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
91 base::WeakPtrFactory<WebrtcVideoCapturerAdapter> weak_factory_; | 93 base::WeakPtrFactory<WebrtcVideoCapturerAdapter> weak_factory_; |
92 | 94 |
93 DISALLOW_COPY_AND_ASSIGN(WebrtcVideoCapturerAdapter); | 95 DISALLOW_COPY_AND_ASSIGN(WebrtcVideoCapturerAdapter); |
94 }; | 96 }; |
95 | 97 |
96 } // namespace protocol | 98 } // namespace protocol |
97 } // namespace remoting | 99 } // namespace remoting |
98 | 100 |
99 #endif // REMOTING_PROTOCOL_WEBRTC_VIDEO_CAPTURER_ADAPTER_H_ | 101 #endif // REMOTING_PROTOCOL_WEBRTC_VIDEO_CAPTURER_ADAPTER_H_ |
100 | 102 |
OLD | NEW |