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

Commit f4ce838d authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "CCodec: convert dataspace to V0" into main

parents 8e45cd12 1c867271
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -12,6 +12,16 @@ flag {
  bug: "201479783"
}

flag {
  name: "dataspace_v0_partial"
  namespace: "codec_fwk"
  description: "Bugfix flag for using V0 dataspace in some cases"
  bug: "313827126"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}

flag {
  name: "dynamic_color_aspects"
  is_exported: true
+6 −1
Original line number Diff line number Diff line
@@ -512,9 +512,14 @@ public:
        uint64_t usage = mConfig.mUsage;
        (void)(*node)->setConsumerUsage((int64_t)usage);

        // AIDL does not define legacy dataspace.
        android_dataspace_t dataspace = mDataSpace;
        if (android::media::codec::provider_->dataspace_v0_partial()) {
            ColorUtils::convertDataSpaceToV0(dataspace);
        }
        return fromAidlStatus(mSource->configure(
                (*node), static_cast<::aidl::android::hardware::graphics::common::Dataspace>(
                        mDataSpace)));
                        dataspace)));
    }

    void disconnect() override {
+7 −0
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@
#include <utils/Log.h>
#include <utils/Trace.h>

#include <android_media_codec.h>

#include <aidl/android/hardware/graphics/common/Cta861_3.h>
#include <aidl/android/hardware/graphics/common/Smpte2086.h>
#include <android-base/no_destructor.h>
@@ -33,6 +35,7 @@
#include <media/stagefright/foundation/ABuffer.h>
#include <media/stagefright/foundation/AMessage.h>
#include <media/stagefright/foundation/AUtils.h>
#include <media/stagefright/foundation/ColorUtils.h>
#include <mediadrm/ICrypto.h>
#include <nativebase/nativebase.h>
#include <ui/GraphicBufferMapper.h>
@@ -735,6 +738,10 @@ c2_status_t SetMetadataToGralloc4Handle(
        // Gralloc4 not supported; nothing to do
        return err;
    }
    // Use V0 dataspaces for Gralloc4+
    if (android::media::codec::provider_->dataspace_v0_partial()) {
        ColorUtils::convertDataSpaceToV0(dataSpace);
    }
    status_t status = mapper.setDataspace(buffer.get(), static_cast<ui::Dataspace>(dataSpace));
    if (status != OK) {
       err = C2_CORRUPTED;