| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 package org.chromium.media; | 5 package org.chromium.device; |
| 6 | 6 |
| 7 import android.annotation.TargetApi; | 7 import android.annotation.TargetApi; |
| 8 import android.app.Activity; | 8 import android.app.Activity; |
| 9 import android.app.Fragment; | 9 import android.app.Fragment; |
| 10 import android.app.FragmentManager; | 10 import android.app.FragmentManager; |
| 11 import android.app.FragmentTransaction; | 11 import android.app.FragmentTransaction; |
| 12 import android.content.Context; | 12 import android.content.Context; |
| 13 import android.content.Intent; | 13 import android.content.Intent; |
| 14 import android.graphics.ImageFormat; | 14 import android.graphics.ImageFormat; |
| 15 import android.graphics.PixelFormat; | 15 import android.graphics.PixelFormat; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 31 import org.chromium.base.annotations.CalledByNative; | 31 import org.chromium.base.annotations.CalledByNative; |
| 32 import org.chromium.base.annotations.JNINamespace; | 32 import org.chromium.base.annotations.JNINamespace; |
| 33 | 33 |
| 34 import java.nio.ByteBuffer; | 34 import java.nio.ByteBuffer; |
| 35 | 35 |
| 36 /** | 36 /** |
| 37 * This class implements Screen Capture using projection API, introduced in Andr
oid | 37 * This class implements Screen Capture using projection API, introduced in Andr
oid |
| 38 * API 21 (L Release). Capture takes place in the current Looper, while pixel | 38 * API 21 (L Release). Capture takes place in the current Looper, while pixel |
| 39 * download takes place in another thread used by ImageReader. | 39 * download takes place in another thread used by ImageReader. |
| 40 **/ | 40 **/ |
| 41 @JNINamespace("media") | 41 @JNINamespace("device") |
| 42 @TargetApi(Build.VERSION_CODES.LOLLIPOP) | 42 @TargetApi(Build.VERSION_CODES.LOLLIPOP) |
| 43 public class ScreenCapture extends Fragment { | 43 public class ScreenCapture extends Fragment { |
| 44 private static final String TAG = "ScreenCaptureMachine"; | 44 private static final String TAG = "ScreenCaptureMachine"; |
| 45 | 45 |
| 46 private static final int REQUEST_MEDIA_PROJECTION = 1; | 46 private static final int REQUEST_MEDIA_PROJECTION = 1; |
| 47 | 47 |
| 48 // Native callback context variable. | 48 // Native callback context variable. |
| 49 private final long mNativeScreenCaptureMachineAndroid; | 49 private final long mNativeScreenCaptureMachineAndroid; |
| 50 private final Context mContext; | 50 private final Context mContext; |
| 51 | 51 |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 long timestamp); | 341 long timestamp); |
| 342 // Method for ScreenCapture implementations to call back native code. | 342 // Method for ScreenCapture implementations to call back native code. |
| 343 private native void nativeOnI420FrameAvailable(long nativeScreenCaptureMachi
neAndroid, | 343 private native void nativeOnI420FrameAvailable(long nativeScreenCaptureMachi
neAndroid, |
| 344 ByteBuffer yBuffer, int yStride, ByteBuffer uBuffer, ByteBuffer vBuf
fer, | 344 ByteBuffer yBuffer, int yStride, ByteBuffer uBuffer, ByteBuffer vBuf
fer, |
| 345 int uvRowStride, int uvPixelStride, int left, int top, int width, in
t height, | 345 int uvRowStride, int uvPixelStride, int left, int top, int width, in
t height, |
| 346 long timestamp); | 346 long timestamp); |
| 347 // Method for ScreenCapture implementations to call back native code. | 347 // Method for ScreenCapture implementations to call back native code. |
| 348 private native void nativeOnActivityResult( | 348 private native void nativeOnActivityResult( |
| 349 long nativeScreenCaptureMachineAndroid, boolean result); | 349 long nativeScreenCaptureMachineAndroid, boolean result); |
| 350 } | 350 } |
| OLD | NEW |