Skip to content

Commit

Permalink
Merge tag 'android-14.0.0_r17' of https://android.googlesource.com/pl…
Browse files Browse the repository at this point in the history
…atform/frameworks/av into 14

Android 14.0.0 Release 17 (UQ1A.231205.015)
  • Loading branch information
NurKeinNeid committed Dec 9, 2023
2 parents a1ad1e4 + 05f0c2a commit 1c9c893
Show file tree
Hide file tree
Showing 228 changed files with 5,644 additions and 4,022 deletions.
24 changes: 24 additions & 0 deletions Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,27 @@ cc_library_headers {
},
},
}

aidl_interface {
name: "av-audio-types-aidl",
unstable: true,
host_supported: true,
vendor_available: true,
double_loadable: true,
local_include_dir: "aidl",
srcs: [
"aidl/android/media/audio/IHalAdapterVendorExtension.aidl",
],
imports: [
"android.hardware.audio.core-V1",
],
backend: {
// The C++ backend is disabled transitively due to use of FMQ by the audio core HAL.
cpp: {
enabled: false,
},
java: {
sdk_version: "module_current",
},
},
}
1 change: 1 addition & 0 deletions PREUPLOAD.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ clang_format = --commit ${PREUPLOAD_COMMIT} --style file --extensions c,h,cc,cpp
media/libmediatranscoding/
services/mediatranscoding/
media/libaudioclient/tests/
media/libaudiohal/tests/
136 changes: 136 additions & 0 deletions aidl/android/media/audio/IHalAdapterVendorExtension.aidl
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
/*
* Copyright (C) 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package android.media.audio;

import android.hardware.audio.core.VendorParameter;

/**
* This interface is used by the HAL adapter of the Audio Server. Implementation
* is optional. Vendors may provide an implementation on the system_ext
* partition. The default instance of this interface, if provided, must be
* registered prior to the moment when the audio server connects to HAL modules.
*
* {@hide}
*/
interface IHalAdapterVendorExtension {
enum ParameterScope {
MODULE = 0,
STREAM = 1,
}

/**
* Parse raw parameter keys into vendor parameter ids.
*
* This method prepares arguments for a call to the 'getVendorParameters'
* method of an 'IModule' or an 'IStreamCommon' interface instance,
* depending on the provided scope.
*
* The client calls this method in order to prepare arguments for a call to
* the particular Core HAL interface. The result returned by the HAL is then
* processed using the 'processVendorParameters' method. It is not required
* to maintain a 1:1 correspondence between the provided raw keys and the
* elements of the parsed result. If the returned list is empty, the call of
* 'getVendorParameters' is skipped. The implementation can either ignore
* keys which it does not recognize, or throw an error. The latter is
* preferred as it can help in discovering malformed key names.
*
* @param scope The scope of all raw parameter keys.
* @param rawKeys Raw parameter keys, joined into a string using a semicolon
* (';') as the delimiter.
* @return A list of vendor parameter IDs, see android.hardware.audio.core.VendorParameter.
* @throws EX_ILLEGAL_ARGUMENT If the implementation can not parse the raw keys
* and prefers to signal an error.
*/
@utf8InCpp String[] parseVendorParameterIds(
ParameterScope scope, in @utf8InCpp String rawKeys);

/**
* Parse raw parameter key-value pairs into vendor parameters.
*
* This method prepares arguments for a call to the 'setVendorParameters'
* method of an 'IModule' or an 'IStreamCommon' interface instance,
* depending on the provided scope.
*
* The vendor parameters returned using 'syncParameters' argument is then
* used to call the 'setVendorParameters' method with 'async = false', and
* 'asyncParameters' is used in a subsequent call to the same method, but
* with 'async = true'. It is not required to maintain a 1:1 correspondence
* between the provided key-value pairs and the elements of parsed
* results. If any of the returned lists of vendor parameters is empty, then
* the corresponding call is skipped. The implementation can either ignore
* keys which it does not recognize, and invalid values, or throw an
* error. The latter is preferred as it can help in discovering malformed
* key names and values.
*
* @param scope The scope of all raw key-value pairs.
* @param rawKeys Raw key-value pairs, separated by the "equals" sign ('='),
* joined into a string using a semicolon (';') as the delimiter.
* @param syncParameters A list of vendor parameters to be set synchronously.
* @param asyncParameters A list of vendor parameters to be set asynchronously.
* @throws EX_ILLEGAL_ARGUMENT If the implementation can not parse raw key-value
* pairs and prefers to signal an error.
*/
void parseVendorParameters(
ParameterScope scope, in @utf8InCpp String rawKeysAndValues,
out VendorParameter[] syncParameters, out VendorParameter[] asyncParameters);

/**
* Parse raw value of the parameter for BT A2DP reconfiguration.
*
* This method may return any number of vendor parameters (including zero)
* which will be passed to the 'IBluetoothA2dp.reconfigureOffload' method.
*
* @param rawValue An unparsed value of the legacy parameter.
* @return A list of vendor parameters.
* @throws EX_ILLEGAL_ARGUMENT If the implementation can not parse the raw value.
*/
VendorParameter[] parseBluetoothA2dpReconfigureOffload(in @utf8InCpp String rawValue);

/**
* Parse raw value of the parameter for BT LE reconfiguration.
*
* This method may return any number of vendor parameters (including zero)
* which will be passed to the 'IBluetoothLe.reconfigureOffload' method.
*
* @param rawValue An unparsed value of the legacy parameter.
* @return A list of vendor parameters.
* @throws EX_ILLEGAL_ARGUMENT If the implementation can not parse the raw value.
*/
VendorParameter[] parseBluetoothLeReconfigureOffload(in @utf8InCpp String rawValue);

/**
* Process vendor parameters returned by the Audio Core HAL.
*
* This processes the result returned from a call to the
* 'getVendorParameters' method of an 'IModule' or an 'IStreamCommon'
* interface instance, depending on the provided scope.
*
* See 'parseVendorParameterIds' method for the flow description. It is not
* required to maintain a 1:1 correspondence between the elements of the
* provided list and the emitted key-value pairs. The returned string with
* raw key-value pairs is passed back to the framework.
*
* @param scope The scope of vendor parameters.
* @param parameters Vendor parameters, see android.hardware.audio.core.VendorParameter.
* @return Key-value pairs, separated by the "equals" sign ('='),
* joined into a string using a semicolon (';') as the delimiter.
* @throws EX_ILLEGAL_ARGUMENT If the implementation can not emit raw key-value
* pairs and prefers to signal an error.
*/
@utf8InCpp String processVendorParameters(
ParameterScope scope, in VendorParameter[] parameters);
}
1 change: 1 addition & 0 deletions camera/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ filegroup {
srcs: [
"aidl/android/hardware/CameraExtensionSessionStats.aidl",
"aidl/android/hardware/ICameraService.aidl",
"aidl/android/hardware/CameraIdRemapping.aidl",
"aidl/android/hardware/ICameraServiceListener.aidl",
"aidl/android/hardware/ICameraServiceProxy.aidl",
"aidl/android/hardware/camera2/ICameraDeviceCallbacks.aidl",
Expand Down
50 changes: 50 additions & 0 deletions camera/aidl/android/hardware/CameraIdRemapping.aidl
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Copyright (C) 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package android.hardware;

/**
* Specifies a remapping of Camera Ids.
*
* Example: For a given package, a remapping of camera id0 to id1 specifies
* that any operation to perform on id0 should instead be performed on id1.
*
* @hide
*/
parcelable CameraIdRemapping {
/**
* Specifies remapping of Camera Ids per package.
*/
parcelable PackageIdRemapping {
/** Package Name (e.g. com.android.xyz). */
String packageName;
/**
* Ordered list of Camera Ids to replace. Only Camera Ids present in this list will be
* affected.
*/
List<String> cameraIdsToReplace;
/**
* Ordered list of updated Camera Ids, where updatedCameraIds[i] corresponds to
* the updated camera id for cameraIdsToReplace[i].
*/
List<String> updatedCameraIds;
}

/**
* List of Camera Id remappings to perform.
*/
List<PackageIdRemapping> packageIdRemappings;
}
17 changes: 17 additions & 0 deletions camera/aidl/android/hardware/ICameraService.aidl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import android.hardware.camera2.utils.CameraIdAndSessionConfiguration;
import android.hardware.camera2.impl.CameraMetadataNative;
import android.hardware.ICameraServiceListener;
import android.hardware.CameraInfo;
import android.hardware.CameraIdRemapping;
import android.hardware.CameraStatus;
import android.hardware.CameraExtensionSessionStats;

Expand Down Expand Up @@ -130,6 +131,22 @@ interface ICameraService
in CameraIdAndSessionConfiguration[] sessions,
int targetSdkVersion);

/**
* Remap Camera Ids in the CameraService.
*
* Once this is in effect, all binder calls in the ICameraService that
* use logicalCameraId should consult remapping state to arrive at the
* correct cameraId to perform the operation on.
*
* Note: Before the new cameraIdRemapping state is applied, the previous
* state is cleared.
*
* @param cameraIdRemapping the camera ids to remap. Sending an unpopulated
* cameraIdRemapping object will result in clearing of any previous
* cameraIdRemapping state in the camera service.
*/
void remapCameraIds(in CameraIdRemapping cameraIdRemapping);

/**
* Remove listener for changes to camera device and flashlight state.
*/
Expand Down
1 change: 0 additions & 1 deletion camera/ndk/impl/ACameraMetadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,6 @@ ACameraMetadata::getConstEntry(uint32_t tag, ACameraMetadata_const_entry* entry)

camera_metadata_ro_entry rawEntry = static_cast<const CameraMetadata*>(mData.get())->find(tag);
if (rawEntry.count == 0) {
ALOGE("%s: cannot find metadata tag %d", __FUNCTION__, tag);
return ACAMERA_ERROR_METADATA_NOT_FOUND;
}
entry->tag = tag;
Expand Down
27 changes: 23 additions & 4 deletions camera/ndk/include/camera/NdkCameraMetadataTags.h
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,19 @@ typedef enum acamera_metadata_tag {
* <p>Only constrains auto-exposure (AE) algorithm, not
* manual control of ACAMERA_SENSOR_EXPOSURE_TIME and
* ACAMERA_SENSOR_FRAME_DURATION.</p>
* <p>Note that the actual achievable max framerate also depends on the minimum frame
* duration of the output streams. The max frame rate will be
* <code>min(aeTargetFpsRange.maxFps, 1 / max(individual stream min durations)</code>. For example,
* if the application sets this key to <code>{60, 60}</code>, but the maximum minFrameDuration among
* all configured streams is 33ms, the maximum framerate won't be 60fps, but will be
* 30fps.</p>
* <p>To start a CaptureSession with a target FPS range different from the
* capture request template's default value, the application
* is strongly recommended to call
* {@link ACameraDevice_createCaptureSessionWithSessionParameters }
* with the target fps range before creating the capture session. The aeTargetFpsRange is
* typically a session parameter. Specifying it at session creation time helps avoid
* session reconfiguration delays in cases like 60fps or high speed recording.</p>
*
* @see ACAMERA_SENSOR_EXPOSURE_TIME
* @see ACAMERA_SENSOR_FRAME_DURATION
Expand Down Expand Up @@ -1128,6 +1141,12 @@ typedef enum acamera_metadata_tag {
* ACAMERA_CONTROL_VIDEO_STABILIZATION_MODE field will return
* OFF if the recording output is not stabilized, or if there are no output
* Surface types that can be stabilized.</p>
* <p>The application is strongly recommended to call
* {@link ACameraDevice_createCaptureSessionWithSessionParameters }
* with the desired video stabilization mode before creating the capture session.
* Video stabilization mode is a session parameter on many devices. Specifying
* it at session creation time helps avoid reconfiguration delay caused by difference
* between the default value and the first CaptureRequest.</p>
* <p>If a camera device supports both this mode and OIS
* (ACAMERA_LENS_OPTICAL_STABILIZATION_MODE), turning both modes on may
* produce undesirable interaction, so it is recommended not to enable
Expand Down Expand Up @@ -5384,7 +5403,7 @@ typedef enum acamera_metadata_tag {
* <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_DEFAULT">CameraMetadata#SENSOR_PIXEL_MODE_DEFAULT</a> mode.
* They can be queried through
* <a href="https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.html#get">CameraCharacteristics#get</a> with
* <a href="https://developer.android.com/reference/CameraCharacteristics.html#SCALER_STREAM_CONFIGURATION_MAP_MAXIMUM_RESOLUTION)">CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP_MAXIMUM_RESOLUTION)</a>.
* <a href="https://developer.android.com/reference/CameraCharacteristics.html#SCALER_STREAM_CONFIGURATION_MAP_MAXIMUM_RESOLUTION">CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP_MAXIMUM_RESOLUTION</a>.
* Unless reported by both
* <a href="https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap.html">StreamConfigurationMap</a>s, the outputs from
* <code>android.scaler.streamConfigurationMapMaximumResolution</code> and
Expand All @@ -5399,13 +5418,12 @@ typedef enum acamera_metadata_tag {
* <ul>
* <li>
* <p>The mandatory stream combinations listed in
* <a href="https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics/mandatoryMaximumResolutionStreamCombinations.html">mandatoryMaximumResolutionStreamCombinations</a>
* would not apply.</p>
* android.scaler.mandatoryMaximumResolutionStreamCombinations would not apply.</p>
* </li>
* <li>
* <p>The bayer pattern of {@code RAW} streams when
* <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>
* is selected will be the one listed in <a href="https://developer.android.com/reference/android/sensor/info/binningFactor.html">binningFactor</a>.</p>
* is selected will be the one listed in ACAMERA_SENSOR_INFO_BINNING_FACTOR.</p>
* </li>
* <li>
* <p>The following keys will always be present:</p>
Expand All @@ -5419,6 +5437,7 @@ typedef enum acamera_metadata_tag {
* </ul>
*
* @see ACAMERA_SENSOR_INFO_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION
* @see ACAMERA_SENSOR_INFO_BINNING_FACTOR
* @see ACAMERA_SENSOR_INFO_PIXEL_ARRAY_SIZE_MAXIMUM_RESOLUTION
* @see ACAMERA_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION
*/
Expand Down
Loading

0 comments on commit 1c9c893

Please sign in to comment.