| 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
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..d3fc87f7c08a12491d38226afa2b03138110ea7c
|
| --- /dev/null
|
| +++ b/media/capture/content/android/screen_capture_machine_android.h
|
| @@ -0,0 +1,59 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef MEDIA_SCREEN_CAPTURE_ANDROID_SCREEN_CAPTURE_MACHINE_ANDROID_H_
|
| +#define MEDIA_SCREEN_CAPTURE_ANDROID_SCREEN_CAPTURE_MACHINE_ANDROID_H_
|
| +
|
| +#include <jni.h>
|
| +#include <memory>
|
| +
|
| +#include "base/android/scoped_java_ref.h"
|
| +#include "base/memory/weak_ptr.h"
|
| +#include "media/capture/content/screen_capture_device_core.h"
|
| +
|
| +namespace media {
|
| +
|
| +// ScreenCaptureMachineAndroid captures 32bit RGB using SurfaceFlinger.
|
| +class MEDIA_EXPORT ScreenCaptureMachineAndroid
|
| + : public media::VideoCaptureMachine,
|
| + public base::SupportsWeakPtr<ScreenCaptureMachineAndroid> {
|
| + public:
|
| + ScreenCaptureMachineAndroid();
|
| + ~ScreenCaptureMachineAndroid() override;
|
| +
|
| + static bool RegisterScreenCaptureMachine(JNIEnv* env);
|
| +
|
| + // Implement org.chromium.media.ScreenCapture.nativeOnFrameAvailable.
|
| + void OnFrameAvailable(JNIEnv* env,
|
| + jobject obj,
|
| + jbyteArray data,
|
| + jint cropWidth,
|
| + jint cropHeight,
|
| + jlong timestamp);
|
| +
|
| + // Implement org.chromium.media.ScreenCapture.nativeOnActivityResult.
|
| + void OnActivityResult(JNIEnv* env, jobject obj, jint result);
|
| +
|
| + // VideoCaptureMachine overrides.
|
| + void Start(const scoped_refptr<media::ThreadSafeCaptureOracle>& oracle_proxy,
|
| + const media::VideoCaptureParams& params,
|
| + const base::Callback<void(bool)> callback) override;
|
| + void Stop(const base::Closure& callback) override;
|
| + void MaybeCaptureForRefresh() override;
|
| +
|
| + private:
|
| + // Makes all the decisions about which frames to copy, and how.
|
| + scoped_refptr<media::ThreadSafeCaptureOracle> oracle_proxy_;
|
| +
|
| + VideoCaptureFormat capture_format_;
|
| +
|
| + // Java VideoCaptureAndroid instance.
|
| + base::android::ScopedJavaLocalRef<jobject> j_capture_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(ScreenCaptureMachineAndroid);
|
| +};
|
| +
|
| +} // namespace media
|
| +
|
| +#endif // MEDIA_SCREEN_CAPTURE_ANDROID_SCREEN_CAPTURE_MACHINE_ANDROID_H_
|
|
|