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

Unified Diff: media/capture/content/android/screen_capture_machine_android.h

Issue 2468383002: Android ScreenCapture: add support to device rotation. (Closed)
Patch Set: address comments Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: media/capture/content/android/screen_capture_machine_android.h
diff --git a/media/capture/content/android/screen_capture_machine_android.h b/media/capture/content/android/screen_capture_machine_android.h
index 84bf1c71378d03049ee345776971907614eb8921..28c9c85af75c1e5cb6cb4e8e21dfc67ce8b0e490 100644
--- a/media/capture/content/android/screen_capture_machine_android.h
+++ b/media/capture/content/android/screen_capture_machine_android.h
@@ -9,12 +9,13 @@
#include <memory>
#include "base/android/scoped_java_ref.h"
+#include "media/capture/capture_export.h"
#include "media/capture/content/screen_capture_device_core.h"
namespace media {
// ScreenCaptureMachineAndroid captures 32bit RGB or YUV420 triplanar.
-class ScreenCaptureMachineAndroid : public media::VideoCaptureMachine {
+class CAPTURE_EXPORT ScreenCaptureMachineAndroid : public VideoCaptureMachine {
public:
ScreenCaptureMachineAndroid();
~ScreenCaptureMachineAndroid() override;
@@ -51,6 +52,9 @@ class ScreenCaptureMachineAndroid : public media::VideoCaptureMachine {
// Implement org.chromium.media.ScreenCapture.nativeOnActivityResult.
void OnActivityResult(JNIEnv* env, jobject obj, jboolean result);
+ // Implement org.chromium.media.ScreenCaptuer.nativeOnOrientationChange.
+ void OnOrientationChange(JNIEnv* env, jobject obj, jint rotation);
+
// VideoCaptureMachine overrides.
void Start(const scoped_refptr<media::ThreadSafeCaptureOracle>& oracle_proxy,
const media::VideoCaptureParams& params,
@@ -59,6 +63,9 @@ class ScreenCaptureMachineAndroid : public media::VideoCaptureMachine {
void MaybeCaptureForRefresh() override;
private:
+ // Indicates the orientation of the device.
+ enum DeviceOrientation { kLandscape, kPortrait, kDefault };
+
// Makes all the decisions about which frames to copy, and how.
scoped_refptr<media::ThreadSafeCaptureOracle> oracle_proxy_;

Powered by Google App Engine
This is Rietveld 408576698