Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef MEDIA_SCREEN_CAPTURE_ANDROID_SCREEN_CAPTURER_ANDROID_H_ | |
| 6 #define MEDIA_SCREEN_CAPTURE_ANDROID_SCREEN_CAPTURER_ANDROID_H_ | |
| 7 | |
| 8 #include <jni.h> | |
| 9 | |
| 10 #include "base/android/scoped_java_ref.h" | |
| 11 #include "third_party/webrtc/modules/desktop_capture/desktop_capture_types.h" | |
| 12 #include "third_party/webrtc/modules/desktop_capture/screen_capture_frame_queue. h" | |
| 13 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" | |
| 14 | |
| 15 namespace media { | |
| 16 | |
| 17 // ScreenCapturerAndroid captures 32bit RGB using SurfaceFlinger. | |
| 18 class ScreenCapturerAndroid : public webrtc::ScreenCapturer { | |
|
miu
2015/05/20 03:33:27
After looking at all the code, I really don't thin
jiajia.qin
2015/05/20 12:07:16
Agree with you. Inheriting from webrtc::ScreenCapt
| |
| 19 public: | |
| 20 explicit ScreenCapturerAndroid(); | |
| 21 virtual ~ScreenCapturerAndroid(); | |
| 22 | |
| 23 static bool RegisterScreenCapturer(JNIEnv* env); | |
| 24 | |
| 25 // Implement org.chromium.media.ScreenCapture.nativeOnFrameAvailable. | |
| 26 void OnFrameAvailable( | |
| 27 JNIEnv* env, | |
| 28 jobject obj, | |
| 29 jbyteArray data, | |
| 30 jint width, | |
| 31 jint height); | |
| 32 | |
| 33 // Implement org.chromium.media.ScreenCapture.nativeOnActivityResult. | |
| 34 void OnActivityResult(JNIEnv* env, jobject obj, jint result); | |
| 35 | |
| 36 // Overridden from ScreenCapturer: | |
| 37 void Start(webrtc::DesktopCapturer::Callback* callback) override; | |
| 38 void Capture(const webrtc::DesktopRegion& region) override; | |
| 39 bool GetScreenList(ScreenList* screens) override; | |
| 40 bool SelectScreen(webrtc::ScreenId id) override; | |
| 41 | |
| 42 private: | |
| 43 // Queue of the frames buffers. | |
| 44 webrtc::ScreenCaptureFrameQueue queue_; | |
| 45 | |
| 46 // Java ScreenCaptureAndroid instance. | |
| 47 base::android::ScopedJavaLocalRef<jobject> j_capture_; | |
| 48 | |
| 49 webrtc::DesktopCapturer::Callback* callback_; | |
| 50 | |
| 51 DISALLOW_COPY_AND_ASSIGN(ScreenCapturerAndroid); | |
| 52 }; | |
| 53 | |
| 54 } // namespace webrtc | |
| 55 | |
| 56 #endif // MEDIA_SCREEN_CAPTURE_ANDROID_SCREEN_CAPTURER_ANDROID_H_ | |
| OLD | NEW |