am 6faa3aca: Merge "Camera2: LEGACY: Support prepare(), sort of." into mnc-dev
* commit '6faa3acaad130533a4d597938fc15b04988a02b2': Camera2: LEGACY: Support prepare(), sort of.
This commit is contained in:
@@ -114,6 +114,11 @@ public abstract class CameraCaptureSession implements AutoCloseable {
|
|||||||
* the Surface provided to prepare must not be used as a target of a CaptureRequest submitted
|
* the Surface provided to prepare must not be used as a target of a CaptureRequest submitted
|
||||||
* to this session.</p>
|
* to this session.</p>
|
||||||
*
|
*
|
||||||
|
* <p>{@link android.hardware.camera2.CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY LEGACY}
|
||||||
|
* devices cannot pre-allocate output buffers; for those devices,
|
||||||
|
* {@link StateCallback#onSurfacePrepared} will be immediately called, and no preallocation is
|
||||||
|
* done.</p>
|
||||||
|
*
|
||||||
* @param surface the output Surface for which buffers should be pre-allocated. Must be one of
|
* @param surface the output Surface for which buffers should be pre-allocated. Must be one of
|
||||||
* the output Surfaces used to create this session.
|
* the output Surfaces used to create this session.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -202,6 +202,7 @@ public class CameraDeviceUserShim implements ICameraDeviceUser {
|
|||||||
private static final int CAMERA_IDLE = 1;
|
private static final int CAMERA_IDLE = 1;
|
||||||
private static final int CAPTURE_STARTED = 2;
|
private static final int CAPTURE_STARTED = 2;
|
||||||
private static final int RESULT_RECEIVED = 3;
|
private static final int RESULT_RECEIVED = 3;
|
||||||
|
private static final int PREPARED = 4;
|
||||||
|
|
||||||
private final HandlerThread mHandlerThread;
|
private final HandlerThread mHandlerThread;
|
||||||
private Handler mHandler;
|
private Handler mHandler;
|
||||||
@@ -253,7 +254,9 @@ public class CameraDeviceUserShim implements ICameraDeviceUser {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPrepared(int streamId) {
|
public void onPrepared(int streamId) {
|
||||||
// TODO
|
Message msg = getHandler().obtainMessage(PREPARED,
|
||||||
|
/*arg1*/ streamId, /*arg2*/ 0);
|
||||||
|
getHandler().sendMessage(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -301,6 +304,11 @@ public class CameraDeviceUserShim implements ICameraDeviceUser {
|
|||||||
mCallbacks.onResultReceived(result, resultExtras);
|
mCallbacks.onResultReceived(result, resultExtras);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case PREPARED: {
|
||||||
|
int streamId = msg.arg1;
|
||||||
|
mCallbacks.onPrepared(streamId);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"Unknown callback message " + msg.what);
|
"Unknown callback message " + msg.what);
|
||||||
@@ -631,7 +639,9 @@ public class CameraDeviceUserShim implements ICameraDeviceUser {
|
|||||||
return CameraBinderDecorator.ENODEV;
|
return CameraBinderDecorator.ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Implement and fire callback
|
// LEGACY doesn't support actual prepare, just signal success right away
|
||||||
|
mCameraCallbacks.onPrepared(streamId);
|
||||||
|
|
||||||
return CameraBinderDecorator.NO_ERROR;
|
return CameraBinderDecorator.NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user