use of android.hardware.camera2.params.OutputConfiguration in project platform_frameworks_base by android.
the class CameraDeviceBinderTest method testCreateStreamTwo.
@SmallTest
public void testCreateStreamTwo() throws Exception {
// Create first stream
int streamId = mCameraUser.createStream(mOutputConfiguration);
assertEquals(0, streamId);
try {
mCameraUser.createStream(mOutputConfiguration);
fail("Created same stream twice");
} catch (ServiceSpecificException e) {
assertEquals("Created same stream twice", ICameraService.ERROR_ALREADY_EXISTS, e.errorCode);
}
// Create second stream with a different surface.
SurfaceTexture surfaceTexture = new SurfaceTexture(/* ignored */
0);
surfaceTexture.setDefaultBufferSize(640, 480);
Surface surface2 = new Surface(surfaceTexture);
OutputConfiguration output2 = new OutputConfiguration(surface2);
int streamId2 = mCameraUser.createStream(output2);
assertEquals(1, streamId2);
// Clean up streams
mCameraUser.deleteStream(streamId);
mCameraUser.deleteStream(streamId2);
}
use of android.hardware.camera2.params.OutputConfiguration in project platform_frameworks_base by android.
the class CameraDeviceImpl method createCaptureSession.
@Override
public void createCaptureSession(List<Surface> outputs, CameraCaptureSession.StateCallback callback, Handler handler) throws CameraAccessException {
List<OutputConfiguration> outConfigurations = new ArrayList<>(outputs.size());
for (Surface surface : outputs) {
outConfigurations.add(new OutputConfiguration(surface));
}
createCaptureSessionInternal(null, outConfigurations, callback, handler, /*isConstrainedHighSpeed*/
false);
}
use of android.hardware.camera2.params.OutputConfiguration in project platform_frameworks_base by android.
the class CameraDeviceImpl method createConstrainedHighSpeedCaptureSession.
@Override
public void createConstrainedHighSpeedCaptureSession(List<Surface> outputs, android.hardware.camera2.CameraCaptureSession.StateCallback callback, Handler handler) throws CameraAccessException {
if (outputs == null || outputs.size() == 0 || outputs.size() > 2) {
throw new IllegalArgumentException("Output surface list must not be null and the size must be no more than 2");
}
StreamConfigurationMap config = getCharacteristics().get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
SurfaceUtils.checkConstrainedHighSpeedSurfaces(outputs, /*fpsRange*/
null, config);
List<OutputConfiguration> outConfigurations = new ArrayList<>(outputs.size());
for (Surface surface : outputs) {
outConfigurations.add(new OutputConfiguration(surface));
}
createCaptureSessionInternal(null, outConfigurations, callback, handler, /*isConstrainedHighSpeed*/
true);
}
use of android.hardware.camera2.params.OutputConfiguration in project platform_frameworks_base by android.
the class CameraDeviceImpl method configureOutputs.
public void configureOutputs(List<Surface> outputs) throws CameraAccessException {
// Leave this here for backwards compatibility with older code using this directly
ArrayList<OutputConfiguration> outputConfigs = new ArrayList<>(outputs.size());
for (Surface s : outputs) {
outputConfigs.add(new OutputConfiguration(s));
}
configureStreamsChecked(/*inputConfig*/
null, outputConfigs, /*isConstrainedHighSpeed*/
false);
}
use of android.hardware.camera2.params.OutputConfiguration in project android_frameworks_base by DirtyUnicorns.
the class CameraDeviceImpl method createReprocessableCaptureSession.
@Override
public void createReprocessableCaptureSession(InputConfiguration inputConfig, List<Surface> outputs, CameraCaptureSession.StateCallback callback, Handler handler) throws CameraAccessException {
if (DEBUG) {
Log.d(TAG, "createReprocessableCaptureSession");
}
if (inputConfig == null) {
throw new IllegalArgumentException("inputConfig cannot be null when creating a " + "reprocessable capture session");
}
List<OutputConfiguration> outConfigurations = new ArrayList<>(outputs.size());
for (Surface surface : outputs) {
outConfigurations.add(new OutputConfiguration(surface));
}
createCaptureSessionInternal(inputConfig, outConfigurations, callback, handler, /*isConstrainedHighSpeed*/
false);
}
Aggregations