Merge "camera2: rename getConcurrentStreamingCameraIds() -> getConcurrentCameraIds()" into rvc-dev am: 6241aceae8
Change-Id: I8af5b2697d1f0d1080fedf7a26bbb05c1e06e003
This commit is contained in:
@@ -17356,7 +17356,7 @@ package android.hardware.camera2 {
|
|||||||
public final class CameraManager {
|
public final class CameraManager {
|
||||||
method @NonNull public android.hardware.camera2.CameraCharacteristics getCameraCharacteristics(@NonNull String) throws android.hardware.camera2.CameraAccessException;
|
method @NonNull public android.hardware.camera2.CameraCharacteristics getCameraCharacteristics(@NonNull String) throws android.hardware.camera2.CameraAccessException;
|
||||||
method @NonNull public String[] getCameraIdList() throws android.hardware.camera2.CameraAccessException;
|
method @NonNull public String[] getCameraIdList() throws android.hardware.camera2.CameraAccessException;
|
||||||
method @NonNull public java.util.Set<java.util.Set<java.lang.String>> getConcurrentStreamingCameraIds() throws android.hardware.camera2.CameraAccessException;
|
method @NonNull public java.util.Set<java.util.Set<java.lang.String>> getConcurrentCameraIds() throws android.hardware.camera2.CameraAccessException;
|
||||||
method @RequiresPermission(android.Manifest.permission.CAMERA) public boolean isConcurrentSessionConfigurationSupported(@NonNull java.util.Map<java.lang.String,android.hardware.camera2.params.SessionConfiguration>) throws android.hardware.camera2.CameraAccessException;
|
method @RequiresPermission(android.Manifest.permission.CAMERA) public boolean isConcurrentSessionConfigurationSupported(@NonNull java.util.Map<java.lang.String,android.hardware.camera2.params.SessionConfiguration>) throws android.hardware.camera2.CameraAccessException;
|
||||||
method @RequiresPermission(android.Manifest.permission.CAMERA) public void openCamera(@NonNull String, @NonNull android.hardware.camera2.CameraDevice.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
|
method @RequiresPermission(android.Manifest.permission.CAMERA) public void openCamera(@NonNull String, @NonNull android.hardware.camera2.CameraDevice.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
|
||||||
method @RequiresPermission(android.Manifest.permission.CAMERA) public void openCamera(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.hardware.camera2.CameraDevice.StateCallback) throws android.hardware.camera2.CameraAccessException;
|
method @RequiresPermission(android.Manifest.permission.CAMERA) public void openCamera(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.hardware.camera2.CameraDevice.StateCallback) throws android.hardware.camera2.CameraAccessException;
|
||||||
|
|||||||
@@ -1978,7 +1978,7 @@ public abstract class PackageManager {
|
|||||||
* Feature for {@link #getSystemAvailableFeatures} and
|
* Feature for {@link #getSystemAvailableFeatures} and
|
||||||
* {@link #hasSystemFeature}: The device's main front and back cameras can stream
|
* {@link #hasSystemFeature}: The device's main front and back cameras can stream
|
||||||
* concurrently as described in {@link
|
* concurrently as described in {@link
|
||||||
* android.hardware.camera2.CameraManager#getConcurrentStreamingCameraIds()}
|
* android.hardware.camera2.CameraManager#getConcurrentCameraIds()}
|
||||||
*/
|
*/
|
||||||
@SdkConstant(SdkConstantType.FEATURE)
|
@SdkConstant(SdkConstantType.FEATURE)
|
||||||
public static final String FEATURE_CAMERA_CONCURRENT = "android.hardware.camera.concurrent";
|
public static final String FEATURE_CAMERA_CONCURRENT = "android.hardware.camera.concurrent";
|
||||||
|
|||||||
@@ -2884,12 +2884,12 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
|
|||||||
* generated according to the documented
|
* generated according to the documented
|
||||||
* {@link android.hardware.camera2.CameraDevice#createCaptureSession guideline} for each device
|
* {@link android.hardware.camera2.CameraDevice#createCaptureSession guideline} for each device
|
||||||
* which has its Id present in the set returned by
|
* which has its Id present in the set returned by
|
||||||
* {@link android.hardware.camera2.CameraManager#getConcurrentStreamingCameraIds}.
|
* {@link android.hardware.camera2.CameraManager#getConcurrentCameraIds}.
|
||||||
* Clients can use the array as a quick reference to find an appropriate camera stream
|
* Clients can use the array as a quick reference to find an appropriate camera stream
|
||||||
* combination.
|
* combination.
|
||||||
* The mandatory stream combination array will be {@code null} in case the device is not a part
|
* The mandatory stream combination array will be {@code null} in case the device is not a part
|
||||||
* of at least one set of combinations returned by
|
* of at least one set of combinations returned by
|
||||||
* {@link android.hardware.camera2.CameraManager#getConcurrentStreamingCameraIds}.</p>
|
* {@link android.hardware.camera2.CameraManager#getConcurrentCameraIds}.</p>
|
||||||
* <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
|
* <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
|
||||||
*/
|
*/
|
||||||
@PublicKey
|
@PublicKey
|
||||||
|
|||||||
@@ -681,7 +681,7 @@ public abstract class CameraDevice implements AutoCloseable {
|
|||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
*<p>Devices capable of streaming concurrently with other devices as described by
|
*<p>Devices capable of streaming concurrently with other devices as described by
|
||||||
* {@link android.hardware.camera2.CameraManager#getConcurrentStreamingCameraIds} have the
|
* {@link android.hardware.camera2.CameraManager#getConcurrentCameraIds} have the
|
||||||
* following guaranteed streams (when streaming concurrently with other devices)</p>
|
* following guaranteed streams (when streaming concurrently with other devices)</p>
|
||||||
*
|
*
|
||||||
* <table>
|
* <table>
|
||||||
|
|||||||
@@ -160,8 +160,8 @@ public final class CameraManager {
|
|||||||
* @throws CameraAccessException if the camera device has been disconnected.
|
* @throws CameraAccessException if the camera device has been disconnected.
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
public Set<Set<String>> getConcurrentStreamingCameraIds() throws CameraAccessException {
|
public Set<Set<String>> getConcurrentCameraIds() throws CameraAccessException {
|
||||||
return CameraManagerGlobal.get().getConcurrentStreamingCameraIds();
|
return CameraManagerGlobal.get().getConcurrentCameraIds();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -189,11 +189,11 @@ public final class CameraManager {
|
|||||||
*
|
*
|
||||||
* @return {@code true} if the given combination of session configurations and corresponding
|
* @return {@code true} if the given combination of session configurations and corresponding
|
||||||
* camera ids are concurrently supported by the camera sub-system,
|
* camera ids are concurrently supported by the camera sub-system,
|
||||||
* {@code false} otherwise.
|
* {@code false} otherwise OR if the set of camera devices provided is not a subset of
|
||||||
|
* those returned by {@link #getConcurrentCameraIds}.
|
||||||
*
|
*
|
||||||
* @throws IllegalArgumentException if the set of camera devices provided is not a subset of
|
|
||||||
* those returned by getConcurrentStreamingCameraIds()
|
|
||||||
* @throws CameraAccessException if one of the camera devices queried is no longer connected.
|
* @throws CameraAccessException if one of the camera devices queried is no longer connected.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
@RequiresPermission(android.Manifest.permission.CAMERA)
|
@RequiresPermission(android.Manifest.permission.CAMERA)
|
||||||
public boolean isConcurrentSessionConfigurationSupported(
|
public boolean isConcurrentSessionConfigurationSupported(
|
||||||
@@ -1183,7 +1183,7 @@ public final class CameraManager {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
ConcurrentCameraIdCombination[] cameraIdCombinations =
|
ConcurrentCameraIdCombination[] cameraIdCombinations =
|
||||||
cameraService.getConcurrentStreamingCameraIds();
|
cameraService.getConcurrentCameraIds();
|
||||||
for (ConcurrentCameraIdCombination comb : cameraIdCombinations) {
|
for (ConcurrentCameraIdCombination comb : cameraIdCombinations) {
|
||||||
mConcurrentCameraIdCombinations.add(comb.getConcurrentCameraIdCombination());
|
mConcurrentCameraIdCombinations.add(comb.getConcurrentCameraIdCombination());
|
||||||
}
|
}
|
||||||
@@ -1372,7 +1372,7 @@ public final class CameraManager {
|
|||||||
return cameraIds;
|
return cameraIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
public @NonNull Set<Set<String>> getConcurrentStreamingCameraIds() {
|
public @NonNull Set<Set<String>> getConcurrentCameraIds() {
|
||||||
Set<Set<String>> concurrentStreamingCameraIds = null;
|
Set<Set<String>> concurrentStreamingCameraIds = null;
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
// Try to make sure we have an up-to-date list of concurrent camera devices.
|
// Try to make sure we have an up-to-date list of concurrent camera devices.
|
||||||
@@ -1398,7 +1398,7 @@ public final class CameraManager {
|
|||||||
|
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
// Go through all the elements and check if the camera ids are valid at least /
|
// Go through all the elements and check if the camera ids are valid at least /
|
||||||
// belong to one of the combinations returned by getConcurrentStreamingCameraIds()
|
// belong to one of the combinations returned by getConcurrentCameraIds()
|
||||||
boolean subsetFound = false;
|
boolean subsetFound = false;
|
||||||
for (Set<String> combination : mConcurrentCameraIdCombinations) {
|
for (Set<String> combination : mConcurrentCameraIdCombinations) {
|
||||||
if (combination.containsAll(cameraIdsAndSessionConfigurations.keySet())) {
|
if (combination.containsAll(cameraIdsAndSessionConfigurations.keySet())) {
|
||||||
@@ -1406,9 +1406,9 @@ public final class CameraManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!subsetFound) {
|
if (!subsetFound) {
|
||||||
throw new IllegalArgumentException(
|
Log.v(TAG, "isConcurrentSessionConfigurationSupported called with a subset of"
|
||||||
"The set of camera ids provided is not a subset of"
|
+ "camera ids not returned by getConcurrentCameraIds");
|
||||||
+ "getConcurrentStreamingCameraIds");
|
return false;
|
||||||
}
|
}
|
||||||
CameraIdAndSessionConfiguration [] cameraIdsAndConfigs =
|
CameraIdAndSessionConfiguration [] cameraIdsAndConfigs =
|
||||||
new CameraIdAndSessionConfiguration[size];
|
new CameraIdAndSessionConfiguration[size];
|
||||||
@@ -1436,10 +1436,10 @@ public final class CameraManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper function to find out if a camera id is in the set of combinations returned by
|
* Helper function to find out if a camera id is in the set of combinations returned by
|
||||||
* getConcurrentStreamingCameraIds()
|
* getConcurrentCameraIds()
|
||||||
* @param cameraId the unique identifier of the camera device to query
|
* @param cameraId the unique identifier of the camera device to query
|
||||||
* @return Whether the camera device was found in the set of combinations returned by
|
* @return Whether the camera device was found in the set of combinations returned by
|
||||||
* getConcurrentStreamingCameraIds
|
* getConcurrentCameraIds
|
||||||
*/
|
*/
|
||||||
public boolean cameraIdHasConcurrentStreamsLocked(String cameraId) {
|
public boolean cameraIdHasConcurrentStreamsLocked(String cameraId) {
|
||||||
if (!mDeviceStatus.containsKey(cameraId)) {
|
if (!mDeviceStatus.containsKey(cameraId)) {
|
||||||
|
|||||||
@@ -721,7 +721,7 @@ public final class MandatoryStreamCombination {
|
|||||||
/**
|
/**
|
||||||
* Retrieve a list of all available mandatory concurrent stream combinations.
|
* Retrieve a list of all available mandatory concurrent stream combinations.
|
||||||
* This method should only be called for devices which are listed in combinations returned
|
* This method should only be called for devices which are listed in combinations returned
|
||||||
* by CameraManager.getConcurrentStreamingCameraIds.
|
* by CameraManager.getConcurrentCameraIds.
|
||||||
*
|
*
|
||||||
* @return a non-modifiable list of supported mandatory concurrent stream combinations.
|
* @return a non-modifiable list of supported mandatory concurrent stream combinations.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user