Merge changes I1477c894,Id3b2cb30 into main
* changes:
Add more picture parameters part 2
Move get picture/sound parameters API to a callback
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ColorRange.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ColorRange.aidl
new file mode 100644
index 0000000..c08c6cc
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ColorRange.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+enum ColorRange {
+ AUTO,
+ LIMITED,
+ FULL,
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ColorSpace.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ColorSpace.aidl
new file mode 100644
index 0000000..9bcddcb
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ColorSpace.aidl
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+enum ColorSpace {
+ AUTO,
+ S_RGB_BT_709,
+ DCI,
+ ADOBE_RGB,
+ BT2020,
+ ON,
+ OFF,
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/Gamma.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/Gamma.aidl
new file mode 100644
index 0000000..89bb808
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/Gamma.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+enum Gamma {
+ DARK,
+ MIDDLE,
+ BRIGHT,
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/IMediaQuality.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/IMediaQuality.aidl
index 006abee..115ada7 100644
--- a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/IMediaQuality.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/IMediaQuality.aidl
@@ -49,12 +49,12 @@
void setAutoAqEnabled(boolean enable);
android.hardware.tv.mediaquality.IPictureProfileChangedListener getPictureProfileListener();
void setPictureProfileAdjustmentListener(android.hardware.tv.mediaquality.IPictureProfileAdjustmentListener listener);
- android.hardware.tv.mediaquality.PictureParameters getPictureParameters(long pictureProfileId);
void sendDefaultPictureParameters(in android.hardware.tv.mediaquality.PictureParameters pictureParameters);
android.hardware.tv.mediaquality.ISoundProfileChangedListener getSoundProfileListener();
void setSoundProfileAdjustmentListener(android.hardware.tv.mediaquality.ISoundProfileAdjustmentListener listener);
- android.hardware.tv.mediaquality.SoundParameters getSoundParameters(long soundProfileId);
void sendDefaultSoundParameters(in android.hardware.tv.mediaquality.SoundParameters soundParameters);
void getParamCaps(in android.hardware.tv.mediaquality.ParameterName[] paramNames, out android.hardware.tv.mediaquality.ParamCapability[] caps);
void getVendorParamCaps(in android.hardware.tv.mediaquality.VendorParameterIdentifier[] names, out android.hardware.tv.mediaquality.VendorParamCapability[] caps);
+ void setPictureParametersCallback(android.hardware.tv.mediaquality.IPictureParametersCallback callback);
+ void setSoundParametersCallback(android.hardware.tv.mediaquality.ISoundParametersCallback callback);
}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/IPictureParametersCallback.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/IPictureParametersCallback.aidl
new file mode 100644
index 0000000..ccb31c4
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/IPictureParametersCallback.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+interface IPictureParametersCallback {
+ android.hardware.tv.mediaquality.PictureParameters getPictureParameters(long pictureProfileId);
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ISoundParametersCallback.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ISoundParametersCallback.aidl
new file mode 100644
index 0000000..9509006
--- /dev/null
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ISoundParametersCallback.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.tv.mediaquality;
+@VintfStability
+interface ISoundParametersCallback {
+ android.hardware.tv.mediaquality.SoundParameters getSoundParameters(long SoundProfileId);
+}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/PictureParameter.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/PictureParameter.aidl
index ae396ad..c38e96f 100644
--- a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/PictureParameter.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/PictureParameter.aidl
@@ -60,4 +60,15 @@
boolean globeDimming;
boolean autoPictureQualityEnabled;
boolean autoSuperResolutionEnabled;
+ android.hardware.tv.mediaquality.ColorRange levelRange;
+ boolean gamutMapping;
+ boolean pcMode;
+ boolean lowLatency;
+ boolean vrr;
+ boolean cvrr;
+ android.hardware.tv.mediaquality.ColorRange hdmiRgbRange;
+ android.hardware.tv.mediaquality.ColorSpace colorSpace;
+ int panelInitMaxLuminceNits;
+ boolean panelInitMaxLuminceValid;
+ android.hardware.tv.mediaquality.Gamma gamma;
}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ColorRange.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ColorRange.aidl
new file mode 100644
index 0000000..29f12ef
--- /dev/null
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ColorRange.aidl
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2024 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.tv.mediaquality;
+
+/**
+ * The range of color the TV can display.
+ */
+@VintfStability
+enum ColorRange {
+ AUTO,
+ LIMITED,
+ FULL,
+}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ColorSpace.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ColorSpace.aidl
new file mode 100644
index 0000000..bd4511d
--- /dev/null
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ColorSpace.aidl
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2024 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.tv.mediaquality;
+
+/**
+ * Specific model used to define and represent colors numerically.
+ */
+@VintfStability
+enum ColorSpace {
+ AUTO,
+ S_RGB_BT_709,
+ DCI,
+ ADOBE_RGB,
+ BT2020,
+ ON,
+ OFF,
+}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/Gamma.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/Gamma.aidl
new file mode 100644
index 0000000..c633557
--- /dev/null
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/Gamma.aidl
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2024 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.tv.mediaquality;
+
+@VintfStability
+enum Gamma {
+ DARK,
+ MIDDLE,
+ BRIGHT,
+}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/IMediaQuality.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/IMediaQuality.aidl
index 6a992a1..e12ded0 100644
--- a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/IMediaQuality.aidl
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/IMediaQuality.aidl
@@ -18,8 +18,10 @@
import android.hardware.tv.mediaquality.AmbientBacklightSettings;
import android.hardware.tv.mediaquality.IMediaQualityCallback;
+import android.hardware.tv.mediaquality.IPictureParametersCallback;
import android.hardware.tv.mediaquality.IPictureProfileAdjustmentListener;
import android.hardware.tv.mediaquality.IPictureProfileChangedListener;
+import android.hardware.tv.mediaquality.ISoundParametersCallback;
import android.hardware.tv.mediaquality.ISoundProfileAdjustmentListener;
import android.hardware.tv.mediaquality.ISoundProfileChangedListener;
import android.hardware.tv.mediaquality.ParamCapability;
@@ -154,14 +156,6 @@
void setPictureProfileAdjustmentListener(IPictureProfileAdjustmentListener listener);
/**
- * Get the picture parameters by PictureProfile id. Check PictureParameters for its' detail.
- *
- * @param pictureProfileId The PictureProfile id that associate with the PictureProfile.
- * @return PictureParameters with all the pre-defined parameters and vendor defined parameters.
- */
- PictureParameters getPictureParameters(long pictureProfileId);
-
- /**
* Send the default picture parameters to the vendor code or HAL to apply the picture
* parameters.
*
@@ -185,14 +179,6 @@
void setSoundProfileAdjustmentListener(ISoundProfileAdjustmentListener listener);
/**
- * Get the sound parameters by SoundProfile id. Check SoundParameters for its' detail.
- *
- * @param soundProfileId The SoundProfile id that associate with a SoundProfile.
- * @return SoundParameters with all the pre-defined parameters and vendor defined parameters.
- */
- SoundParameters getSoundParameters(long soundProfileId);
-
- /**
* Send the default sound parameters to the vendor code or HAL to apply the sound parameters.
*
* @param soundParameters SoundParameters with pre-defined parameters and vendor defined
@@ -209,4 +195,30 @@
* Gets vendor capability information of the given parameters.
*/
void getVendorParamCaps(in VendorParameterIdentifier[] names, out VendorParamCapability[] caps);
+
+ /**
+ * Sets picture parameters callback to get the picture parameters send by the client.
+ *
+ * When the same client registers this callback multiple times, only the most recent
+ * registration will be active. The previous callback will be overwritten.
+ *
+ * When different client registers this callback, it will overwrite the previous registered
+ * client. Only one callback can be active.
+ *
+ * @param callback Callback object to pass PictureParameters.
+ */
+ void setPictureParametersCallback(IPictureParametersCallback callback);
+
+ /**
+ * Sets sound parameters callback to get the sound parameters send by the client.
+ *
+ * When the same client registers this callback multiple times, only the most recent
+ * registration will be active. The previous callback will be overwritten.
+ *
+ * When different client registers this callback, it will overwrite the previous registered
+ * client. Only one callback can be active.
+ *
+ * @param callback Callback object to pass SoundParameters.
+ */
+ void setSoundParametersCallback(ISoundParametersCallback callback);
}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/IPictureParametersCallback.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/IPictureParametersCallback.aidl
new file mode 100644
index 0000000..b92c775
--- /dev/null
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/IPictureParametersCallback.aidl
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2024 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.tv.mediaquality;
+
+import android.hardware.tv.mediaquality.PictureParameters;
+
+@VintfStability
+interface IPictureParametersCallback {
+ /**
+ * Get the picture parameters by PictureProfile id. Check PictureParameters for its' detail.
+ * This is called from the HAL to media quality framework.
+ *
+ * @param pictureProfileId The PictureProfile id that associate with the PictureProfile.
+ * @return PictureParameters with all the pre-defined parameters and vendor defined parameters.
+ */
+ PictureParameters getPictureParameters(long pictureProfileId);
+}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ISoundParametersCallback.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ISoundParametersCallback.aidl
new file mode 100644
index 0000000..856ceb4
--- /dev/null
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ISoundParametersCallback.aidl
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2024 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.tv.mediaquality;
+
+import android.hardware.tv.mediaquality.SoundParameters;
+
+@VintfStability
+interface ISoundParametersCallback {
+ /**
+ * Get the Sound parameters by SoundProfile id. Check SoundParameters for its' detail.
+ * This is called from the HAL to media quality framework.
+ *
+ * @param SoundProfileId The SoundProfile id that associate with the SoundProfile.
+ * @return SoundParameters with all the pre-defined parameters and vendor defined parameters.
+ */
+ SoundParameters getSoundParameters(long SoundProfileId);
+}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/PictureParameter.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/PictureParameter.aidl
index 922368d..b7f2a11 100644
--- a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/PictureParameter.aidl
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/PictureParameter.aidl
@@ -16,8 +16,12 @@
package android.hardware.tv.mediaquality;
+import android.hardware.tv.mediaquality.ColorRange;
+import android.hardware.tv.mediaquality.ColorSpace;
import android.hardware.tv.mediaquality.ColorTemperature;
+import android.hardware.tv.mediaquality.Gamma;
import android.hardware.tv.mediaquality.QualityLevel;
+
/**
* The parameters for Picture Profile.
*/
@@ -187,4 +191,66 @@
* image and uses its knowledge to invent the missing pixel, make the image look sharper.
*/
boolean autoSuperResolutionEnabled;
+
+ /**
+ * The color range of the content. This indicates the range of luminance values
+ * used in the video signal.
+ */
+ ColorRange levelRange;
+
+ /**
+ * Enable/disable gamut mapping. Gamut mapping is a process that adjusts
+ * the colors in the video signal to match the color gamut of the display.
+ */
+ boolean gamutMapping;
+
+ /**
+ * Enable/disable PC mode. PC mode is a display mode that is optimized for
+ * use with computers.
+ */
+ boolean pcMode;
+
+ /**
+ * Enable/disable low latency mode. Low latency mode reduces the delay
+ * between the video source and the display.
+ */
+ boolean lowLatency;
+
+ /**
+ * Enable/disable variable refresh rate (VRR) mode. VRR allows the display to
+ * dynamically adjust its refresh rate to match the frame rate of the video
+ * source, reducing screen tearing.
+ */
+ boolean vrr;
+
+ /**
+ * Enable/disable continuous variable refresh rate (CVRR) mode. CVRR is a type
+ * of VRR that allows for a wider range of refresh rates.
+ */
+ boolean cvrr;
+
+ /**
+ * The color range of the HDMI input. This indicates the range of luminance
+ * values used in the HDMI signal.
+ */
+ ColorRange hdmiRgbRange;
+
+ /**
+ * The color space of the content. This indicates the color gamut and
+ * transfer function used in the video signal.
+ */
+ ColorSpace colorSpace;
+
+ /**
+ * The initial maximum luminance of the panel, in nits.
+ */
+ int panelInitMaxLuminceNits;
+
+ /**
+ * Whether the initial maximum luminance value is valid.
+ */
+ boolean panelInitMaxLuminceValid;
+
+ /* The gamma curve used for the display. */
+ Gamma gamma;
}
diff --git a/tv/mediaquality/aidl/default/hal/media_quality_hal_impl.rs b/tv/mediaquality/aidl/default/hal/media_quality_hal_impl.rs
index 35fb999..190e6a7 100644
--- a/tv/mediaquality/aidl/default/hal/media_quality_hal_impl.rs
+++ b/tv/mediaquality/aidl/default/hal/media_quality_hal_impl.rs
@@ -24,16 +24,16 @@
IPictureProfileChangedListener::IPictureProfileChangedListener,
ParamCapability::ParamCapability,
ParameterName::ParameterName,
- PictureParameter::PictureParameter,
PictureParameters::PictureParameters,
ISoundProfileAdjustmentListener::ISoundProfileAdjustmentListener,
ISoundProfileChangedListener::ISoundProfileChangedListener,
- SoundParameter::SoundParameter,
SoundParameters::SoundParameters,
VendorParamCapability::VendorParamCapability,
VendorParameterIdentifier::VendorParameterIdentifier,
+ IPictureParametersCallback::IPictureParametersCallback,
+ ISoundParametersCallback::ISoundParametersCallback,
};
-use binder::{Interface, ParcelableHolder, Strong};
+use binder::{Interface, Strong};
use std::sync::{Arc, Mutex};
use std::thread;
@@ -54,6 +54,8 @@
Arc<Mutex<Option<Strong<dyn ISoundProfileAdjustmentListener>>>>,
picture_profile_changed_listener: Arc<Mutex<Option<Strong<dyn IPictureProfileChangedListener>>>>,
sound_profile_changed_listener: Arc<Mutex<Option<Strong<dyn ISoundProfileChangedListener>>>>,
+ picture_parameters_callback: Arc<Mutex<Option<Strong<dyn IPictureParametersCallback>>>>,
+ sound_parameters_callback: Arc<Mutex<Option<Strong<dyn ISoundParametersCallback>>>>,
}
impl MediaQualityService {
@@ -75,6 +77,8 @@
sound_profile_adjustment_listener: Arc::new(Mutex::new(None)),
picture_profile_changed_listener: Arc::new(Mutex::new(None)),
sound_profile_changed_listener: Arc::new(Mutex::new(None)),
+ picture_parameters_callback: Arc::new(Mutex::new(None)),
+ sound_parameters_callback: Arc::new(Mutex::new(None)),
}
}
}
@@ -224,25 +228,6 @@
Ok(())
}
- fn getPictureParameters(&self, id: i64) -> binder::Result<PictureParameters>{
- let picture_parameters = match id {
- 1 => {
- vec![
- PictureParameter::Brightness(0.5),
- PictureParameter::Contrast(50),
- ]
- },
- _ => vec![]
- };
-
- let picture_params = PictureParameters {
- pictureParameters: picture_parameters,
- vendorPictureParameters: ParcelableHolder::default(),
- };
-
- Ok(picture_params)
- }
-
fn sendDefaultPictureParameters(&self, _picture_parameters: &PictureParameters) -> binder::Result<()>{
println!("Received picture parameters");
Ok(())
@@ -264,25 +249,6 @@
Ok(())
}
- fn getSoundParameters(&self, id: i64) -> binder::Result<SoundParameters>{
- let sound_parameters = match id {
- 1 => {
- vec![
- SoundParameter::Balance(50),
- SoundParameter::Bass(50),
- ]
- },
- _ => vec![]
- };
-
- let sound_params = SoundParameters {
- soundParameters: sound_parameters,
- vendorSoundParameters: ParcelableHolder::default(),
- };
-
- Ok(sound_params)
- }
-
fn sendDefaultSoundParameters(&self, _sound_parameters: &SoundParameters) -> binder::Result<()>{
println!("Received sound parameters");
Ok(())
@@ -305,4 +271,22 @@
println!("getVendorParamCaps. len= {}", param_names.len());
Ok(())
}
+
+ fn setPictureParametersCallback(
+ &self,
+ callback: &Strong<dyn IPictureParametersCallback>
+ ) -> binder::Result<()> {
+ let mut cb = self.picture_parameters_callback.lock().unwrap();
+ *cb = Some(callback.clone());
+ Ok(())
+ }
+
+ fn setSoundParametersCallback(
+ &self,
+ callback: &Strong<dyn ISoundParametersCallback>
+ ) -> binder::Result<()> {
+ let mut cb = self.sound_parameters_callback.lock().unwrap();
+ *cb = Some(callback.clone());
+ Ok(())
+ }
}
diff --git a/tv/mediaquality/aidl/vts/functional/VtsHalMediaQualityTest.cpp b/tv/mediaquality/aidl/vts/functional/VtsHalMediaQualityTest.cpp
index b508ed6..c3e25a4 100644
--- a/tv/mediaquality/aidl/vts/functional/VtsHalMediaQualityTest.cpp
+++ b/tv/mediaquality/aidl/vts/functional/VtsHalMediaQualityTest.cpp
@@ -23,8 +23,10 @@
#include <aidl/android/hardware/tv/mediaquality/BnPictureProfileAdjustmentListener.h>
#include <aidl/android/hardware/tv/mediaquality/BnSoundProfileAdjustmentListener.h>
#include <aidl/android/hardware/tv/mediaquality/IMediaQuality.h>
+#include <aidl/android/hardware/tv/mediaquality/PictureParameter.h>
#include <aidl/android/hardware/tv/mediaquality/PictureParameters.h>
#include <aidl/android/hardware/tv/mediaquality/PictureProfile.h>
+#include <aidl/android/hardware/tv/mediaquality/SoundParameter.h>
#include <aidl/android/hardware/tv/mediaquality/SoundParameters.h>
#include <aidl/android/hardware/tv/mediaquality/SoundProfile.h>
@@ -43,8 +45,10 @@
using aidl::android::hardware::tv::mediaquality::BnSoundProfileAdjustmentListener;
using aidl::android::hardware::tv::mediaquality::IMediaQuality;
using aidl::android::hardware::tv::mediaquality::ParamCapability;
+using aidl::android::hardware::tv::mediaquality::PictureParameter;
using aidl::android::hardware::tv::mediaquality::PictureParameters;
using aidl::android::hardware::tv::mediaquality::PictureProfile;
+using aidl::android::hardware::tv::mediaquality::SoundParameter;
using aidl::android::hardware::tv::mediaquality::SoundParameters;
using aidl::android::hardware::tv::mediaquality::SoundProfile;
using aidl::android::hardware::tv::mediaquality::VendorParamCapability;
@@ -162,18 +166,20 @@
ASSERT_OK(mediaquality->setPictureProfileAdjustmentListener(listener));
}
-TEST_P(MediaQualityAidl, TestGetPictureParameters) {
- PictureParameters pictureParams;
- auto result = mediaquality->getPictureParameters(1, &pictureParams);
- ASSERT_TRUE(result.isOk());
- ASSERT_EQ(pictureParams.pictureParameters.size(), 2);
-}
-
TEST_P(MediaQualityAidl, TestSendDefaultPictureParameters) {
- PictureParameters pictureParams;
- auto result = mediaquality->getPictureParameters(1, &pictureParams);
- ASSERT_TRUE(result.isOk());
- ASSERT_OK(mediaquality->sendDefaultPictureParameters(pictureParams));
+ PictureParameters pictureParameters;
+ std::vector<PictureParameter> picParams;
+
+ PictureParameter brightnessParam;
+ brightnessParam.set<PictureParameter::Tag::brightness>(0.5f);
+ picParams.push_back(brightnessParam);
+
+ PictureParameter contrastParam;
+ contrastParam.set<PictureParameter::Tag::contrast>(50);
+ picParams.push_back(contrastParam);
+
+ pictureParameters.pictureParameters = picParams;
+ ASSERT_OK(mediaquality->sendDefaultPictureParameters(pictureParameters));
}
TEST_P(MediaQualityAidl, TestSetSoundProfileAdjustmentListener) {
@@ -183,18 +189,20 @@
ASSERT_OK(mediaquality->setSoundProfileAdjustmentListener(listener));
}
-TEST_P(MediaQualityAidl, TestGetSoundParameters) {
- SoundParameters soundParams;
- auto result = mediaquality->getSoundParameters(1, &soundParams);
- ASSERT_TRUE(result.isOk());
- ASSERT_EQ(soundParams.soundParameters.size(), 2);
-}
-
TEST_P(MediaQualityAidl, TestSendDefaultSoundParameters) {
- SoundParameters soundParams;
- auto result = mediaquality->getSoundParameters(1, &soundParams);
- ASSERT_TRUE(result.isOk());
- ASSERT_OK(mediaquality->sendDefaultSoundParameters(soundParams));
+ SoundParameters soundParameters;
+ std::vector<SoundParameter> soundParams;
+
+ SoundParameter balanceParam;
+ balanceParam.set<SoundParameter::Tag::balance>(50);
+ soundParams.push_back(balanceParam);
+
+ SoundParameter bassParam;
+ bassParam.set<SoundParameter::Tag::bass>(50);
+ soundParams.push_back(bassParam);
+
+ soundParameters.soundParameters = soundParams;
+ ASSERT_OK(mediaquality->sendDefaultSoundParameters(soundParameters));
}
TEST_P(MediaQualityAidl, TestSetAmbientBacklightDetector) {