diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2014-09-04 13:07:40 -0700 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2014-09-05 12:43:11 -0700 |
commit | fd887436bd111e4d2c7307578a51b5070025b7f2 (patch) | |
tree | 104b760a73dc5b34c36f407384df26b01121e921 /tests/Camera2Tests/SmartCamera | |
parent | 9f30ce3b82acb1f9582e49e9d87ab0d58c8f9ce4 (diff) | |
download | frameworks_base-fd887436bd111e4d2c7307578a51b5070025b7f2.zip frameworks_base-fd887436bd111e4d2c7307578a51b5070025b7f2.tar.gz frameworks_base-fd887436bd111e4d2c7307578a51b5070025b7f2.tar.bz2 |
Camera2: Final API revisions
- Rename listeners to callbacks. Listeners are single-method and are interfaces,
while callbacks are abstract may get more methods in the future.
- Use register/unregister for registering callbacks, not add/remove.
Bug: 17389922
Change-Id: Ic6b46ad79cb43a43a85e2a4b63f059d3af99798b
Diffstat (limited to 'tests/Camera2Tests/SmartCamera')
-rw-r--r-- | tests/Camera2Tests/SmartCamera/SimpleCamera/src/androidx/media/filterfw/samples/simplecamera/Camera2Source.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/Camera2Tests/SmartCamera/SimpleCamera/src/androidx/media/filterfw/samples/simplecamera/Camera2Source.java b/tests/Camera2Tests/SmartCamera/SimpleCamera/src/androidx/media/filterfw/samples/simplecamera/Camera2Source.java index 05057f2..07dfb54 100644 --- a/tests/Camera2Tests/SmartCamera/SimpleCamera/src/androidx/media/filterfw/samples/simplecamera/Camera2Source.java +++ b/tests/Camera2Tests/SmartCamera/SimpleCamera/src/androidx/media/filterfw/samples/simplecamera/Camera2Source.java @@ -38,7 +38,7 @@ import android.util.Log; import android.view.Surface; import com.android.ex.camera2.blocking.BlockingCameraManager; import com.android.ex.camera2.blocking.BlockingCameraManager.BlockingOpenException; -import com.android.ex.camera2.blocking.BlockingSessionListener; +import com.android.ex.camera2.blocking.BlockingSessionCallback; import androidx.media.filterfw.Filter; import androidx.media.filterfw.Frame; import androidx.media.filterfw.FrameImage2D; @@ -72,7 +72,7 @@ public class Camera2Source extends Filter implements Allocation.OnBufferAvailabl private static final long SESSION_TIMEOUT_MS = 2000; - class MyCameraListener extends CameraManager.AvailabilityListener { + class MyCameraListener extends CameraManager.AvailabilityCallback { @Override public void onCameraAvailable(String cameraId) { @@ -88,7 +88,7 @@ public class Camera2Source extends Filter implements Allocation.OnBufferAvailabl } - class MyCaptureListener extends CameraCaptureSession.CaptureListener { + class MyCaptureCallback extends CameraCaptureSession.CaptureCallback { @Override public void onCaptureCompleted(CameraCaptureSession camera, CaptureRequest request, @@ -189,7 +189,7 @@ public class Camera2Source extends Filter implements Allocation.OnBufferAvailabl surfaces.add(mSurface); CaptureRequest.Builder mCaptureRequest = null; try { - BlockingSessionListener blkSession = new BlockingSessionListener(); + BlockingSessionCallback blkSession = new BlockingSessionCallback(); mCamera.createCaptureSession(surfaces, blkSession, mHandler); mCaptureRequest = mCamera.createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW); @@ -203,7 +203,7 @@ public class Camera2Source extends Filter implements Allocation.OnBufferAvailabl } try { - mCameraSession.setRepeatingRequest(mCaptureRequest.build(), new MyCaptureListener(), + mCameraSession.setRepeatingRequest(mCaptureRequest.build(), new MyCaptureCallback(), mHandler); } catch (CameraAccessException e) { e.printStackTrace(); |