From fd887436bd111e4d2c7307578a51b5070025b7f2 Mon Sep 17 00:00:00 2001 From: Eino-Ville Talvala Date: Thu, 4 Sep 2014 13:07:40 -0700 Subject: 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 --- .../media/filterfw/samples/simplecamera/Camera2Source.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/Camera2Tests/SmartCamera') 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(); -- cgit v1.1