Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: webrtc/api/androidvideocapturer.h

Issue 2276593003: Android Screen Capturer. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix comments. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 24 matching lines...) Expand all
35 virtual void Stop() = 0; 35 virtual void Stop() = 0;
36 36
37 virtual std::vector<cricket::VideoFormat> GetSupportedFormats() = 0; 37 virtual std::vector<cricket::VideoFormat> GetSupportedFormats() = 0;
38 }; 38 };
39 39
40 // Android implementation of cricket::VideoCapturer for use with WebRtc 40 // Android implementation of cricket::VideoCapturer for use with WebRtc
41 // PeerConnection. 41 // PeerConnection.
42 class AndroidVideoCapturer : public cricket::VideoCapturer { 42 class AndroidVideoCapturer : public cricket::VideoCapturer {
43 public: 43 public:
44 explicit AndroidVideoCapturer( 44 explicit AndroidVideoCapturer(
45 const rtc::scoped_refptr<AndroidVideoCapturerDelegate>& delegate); 45 const rtc::scoped_refptr<AndroidVideoCapturerDelegate>& delegate,
46 bool is_screencast = false);
46 virtual ~AndroidVideoCapturer(); 47 virtual ~AndroidVideoCapturer();
47 48
48 // Called from JNI when the capturer has been started. 49 // Called from JNI when the capturer has been started.
49 void OnCapturerStarted(bool success); 50 void OnCapturerStarted(bool success);
50 51
51 // Called from JNI to request a new video format. 52 // Called from JNI to request a new video format.
52 void OnOutputFormatRequest(int width, int height, int fps); 53 void OnOutputFormatRequest(int width, int height, int fps);
53 54
54 AndroidVideoCapturerDelegate* delegate() { return delegate_.get(); } 55 AndroidVideoCapturerDelegate* delegate() { return delegate_.get(); }
55 56
56 // cricket::VideoCapturer implementation. 57 // cricket::VideoCapturer implementation.
57 bool GetBestCaptureFormat(const cricket::VideoFormat& desired, 58 bool GetBestCaptureFormat(const cricket::VideoFormat& desired,
58 cricket::VideoFormat* best_format) override; 59 cricket::VideoFormat* best_format) override;
59 60
60 // Expose these protected methods as public, to be used by the 61 // Expose these protected methods as public, to be used by the
61 // AndroidVideoCapturerJni. 62 // AndroidVideoCapturerJni.
62 using VideoCapturer::AdaptFrame; 63 using VideoCapturer::AdaptFrame;
63 using VideoCapturer::OnFrame; 64 using VideoCapturer::OnFrame;
64 65
65 private: 66 private:
66 // cricket::VideoCapturer implementation. 67 // cricket::VideoCapturer implementation.
67 // Video frames will be delivered using 68 // Video frames will be delivered using
68 // cricket::VideoCapturer::SignalFrameCaptured on the thread that calls Start. 69 // cricket::VideoCapturer::SignalFrameCaptured on the thread that calls Start.
69 cricket::CaptureState Start( 70 cricket::CaptureState Start(
70 const cricket::VideoFormat& capture_format) override; 71 const cricket::VideoFormat& capture_format) override;
71 void Stop() override; 72 void Stop() override;
72 bool IsRunning() override; 73 bool IsRunning() override;
73 bool IsScreencast() const override { return false; } 74 bool IsScreencast() const override { return is_screencast_; }
74 bool GetPreferredFourccs(std::vector<uint32_t>* fourccs) override; 75 bool GetPreferredFourccs(std::vector<uint32_t>* fourccs) override;
75 76
76 bool running_; 77 bool running_;
77 rtc::scoped_refptr<AndroidVideoCapturerDelegate> delegate_; 78 rtc::scoped_refptr<AndroidVideoCapturerDelegate> delegate_;
79 bool is_screencast_;
magjed_webrtc 2016/08/24 12:19:22 Make this variable const.
arsany 2016/08/26 02:07:36 Done.
78 80
79 rtc::ThreadChecker thread_checker_; 81 rtc::ThreadChecker thread_checker_;
80 }; 82 };
81 83
82 } // namespace webrtc 84 } // namespace webrtc
83 85
84 #endif // WEBRTC_API_ANDROIDVIDEOCAPTURER_H_ 86 #endif // WEBRTC_API_ANDROIDVIDEOCAPTURER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698