Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 776b6c87 authored by Haofan Wang's avatar Haofan Wang
Browse files

Add notify status change api per vendor request

When the stream status change, HDR to SDR, the framework needs to know
to get different picture parameters.

Bug: 381198607
Test: atest VtsHalMediaQualityTargetTest
Flag: android.media.tv.flags.media_quality_fw

Change-Id: Ib793b6ec33113f22ef4624935bb1b702d3775d4d
parent e11e002e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -38,4 +38,5 @@ interface IPictureProfileAdjustmentListener {
  oneway void onParamCapabilityChanged(long pictureProfileId, in android.hardware.tv.mediaquality.ParamCapability[] caps);
  oneway void onVendorParamCapabilityChanged(long pictureProfileId, in android.hardware.tv.mediaquality.VendorParamCapability[] caps);
  oneway void requestPictureParameters(long pictureProfileId);
  oneway void onStreamStatusChanged(long pictureProfileId, android.hardware.tv.mediaquality.StreamStatus status);
}
+54 −0
Original line number Diff line number Diff line
/*
 * Copyright 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 StreamStatus {
  SDR,
  DOLBYVISION,
  HDR10,
  TCH,
  HLG,
  HDR10PLUS,
  HDRVIVID,
  IMAXSDR,
  IMAXHDR10,
  IMAXHDR10PLUS,
  FMMSDR,
  FMMHDR10,
  FMMHDR10PLUS,
  FMMHLG,
  FMMDOLBY,
  FMMTCH,
  FMMHDRVIVID,
}
+10 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.hardware.tv.mediaquality;

import android.hardware.tv.mediaquality.ParamCapability;
import android.hardware.tv.mediaquality.PictureProfile;
import android.hardware.tv.mediaquality.StreamStatus;
import android.hardware.tv.mediaquality.VendorParamCapability;

@VintfStability
@@ -60,4 +61,13 @@ oneway interface IPictureProfileAdjustmentListener {
     * @param pictureProfileId The PictureProfile id that associate with the PictureProfile.
     */
    void requestPictureParameters(long pictureProfileId);

    /**
     * Notifies Media Quality Manager when stream status changed.
     *
     * @param pictureProfileId the ID of the profile used by the media content. -1 if there
     *                         is no associated profile.
     * @param status the status of the current stream.
     */
    void onStreamStatusChanged(long pictureProfileId, StreamStatus status);
}
+38 −0
Original line number Diff line number Diff line
/*
 * Copyright 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 StreamStatus {
    SDR,
    DOLBYVISION,
    HDR10,
    TCH,
    HLG,
    HDR10PLUS,
    HDRVIVID,
    IMAXSDR,
    IMAXHDR10,
    IMAXHDR10PLUS,
    FMMSDR,
    FMMHDR10,
    FMMHDR10PLUS,
    FMMHLG,
    FMMDOLBY,
    FMMTCH,
    FMMHDRVIVID,
}
+4 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@
#include <aidl/android/hardware/tv/mediaquality/SoundParameter.h>
#include <aidl/android/hardware/tv/mediaquality/SoundParameters.h>
#include <aidl/android/hardware/tv/mediaquality/SoundProfile.h>
#include <aidl/android/hardware/tv/mediaquality/StreamStatus.h>

#include <android/binder_auto_utils.h>
#include <android/binder_manager.h>
@@ -51,6 +52,7 @@ 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::StreamStatus;
using aidl::android::hardware::tv::mediaquality::VendorParamCapability;
using aidl::android::hardware::tv::mediaquality::VendorParameterIdentifier;
using android::ProcessState;
@@ -97,6 +99,8 @@ class PictureProfileAdjustmentListener : public BnPictureProfileAdjustmentListen

    ScopedAStatus requestPictureParameters(int64_t) { return ScopedAStatus::ok(); }

    ScopedAStatus onStreamStatusChanged(int64_t, StreamStatus) { return ScopedAStatus::ok(); }

  private:
    std::function<void(const PictureProfile& pictureProfile)> on_hal_picture_profile_adjust_;
};