Loading media/codec2/sfplugin/CCodecBufferChannel.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -956,9 +956,9 @@ status_t CCodecBufferChannel::renderOutputBuffer( hdrDynamicInfo->m.data + hdrDynamicInfo->flexCount()); } qbi.setHdrMetadata(hdr); SetHdrMetadataToGralloc4Handle(hdrStaticInfo, hdrDynamicInfo, block.handle()); } SetMetadataToGralloc4Handle(dataSpace, hdrStaticInfo, hdrDynamicInfo, block.handle()); // we don't have dirty regions qbi.setSurfaceDamage(Region::INVALID_REGION); android::IGraphicBufferProducer::QueueBufferOutput qbo; Loading media/codec2/sfplugin/Codec2Buffer.cpp +15 −1 Original line number Diff line number Diff line Loading @@ -965,9 +965,11 @@ native_handle_t *EncryptedLinearBlockBuffer::handle() const { } using ::aidl::android::hardware::graphics::common::Cta861_3; using ::aidl::android::hardware::graphics::common::Dataspace; using ::aidl::android::hardware::graphics::common::Smpte2086; using ::android::gralloc4::MetadataType_Cta861_3; using ::android::gralloc4::MetadataType_Dataspace; using ::android::gralloc4::MetadataType_Smpte2086; using ::android::gralloc4::MetadataType_Smpte2094_40; Loading Loading @@ -1123,7 +1125,8 @@ c2_status_t GetHdrMetadataFromGralloc4Handle( return err; } c2_status_t SetHdrMetadataToGralloc4Handle( c2_status_t SetMetadataToGralloc4Handle( android_dataspace_t dataSpace, const std::shared_ptr<const C2StreamHdrStaticMetadataInfo::output> &staticInfo, const std::shared_ptr<const C2StreamHdrDynamicMetadataInfo::output> &dynamicInfo, const C2Handle *const handle) { Loading @@ -1134,6 +1137,17 @@ c2_status_t SetHdrMetadataToGralloc4Handle( // Gralloc4 not supported; nothing to do return err; } { hidl_vec<uint8_t> metadata; if (gralloc4::encodeDataspace(static_cast<Dataspace>(dataSpace), &metadata) == OK) { Return<Error4> ret = mapper->set(buffer.get(), MetadataType_Dataspace, metadata); if (!ret.isOk()) { err = C2_REFUSED; } else if (ret != Error4::NONE) { err = C2_CORRUPTED; } } } if (staticInfo && *staticInfo) { ALOGV("Setting static HDR info as gralloc4 metadata"); std::optional<Smpte2086> smpte2086 = Smpte2086{ Loading media/codec2/sfplugin/Codec2Buffer.h +4 −2 Original line number Diff line number Diff line Loading @@ -410,14 +410,16 @@ c2_status_t GetHdrMetadataFromGralloc4Handle( std::shared_ptr<C2StreamHdrDynamicMetadataInfo::input> *dynamicInfo); /** * Set HDR metadata to Gralloc4 handle. * Set metadata to Gralloc4 handle. * * \param[in] dataSpace Dataspace to set. * \param[in] staticInfo HDR static info to set. Ignored if null or invalid. * \param[in] dynamicInfo HDR dynamic info to set. Ignored if null or invalid. * \param[out] handle handle of the allocation. * \return C2_OK if successful */ c2_status_t SetHdrMetadataToGralloc4Handle( c2_status_t SetMetadataToGralloc4Handle( const android_dataspace_t dataSpace, const std::shared_ptr<const C2StreamHdrStaticMetadataInfo::output> &staticInfo, const std::shared_ptr<const C2StreamHdrDynamicMetadataInfo::output> &dynamicInfo, const C2Handle *const handle); Loading Loading
media/codec2/sfplugin/CCodecBufferChannel.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -956,9 +956,9 @@ status_t CCodecBufferChannel::renderOutputBuffer( hdrDynamicInfo->m.data + hdrDynamicInfo->flexCount()); } qbi.setHdrMetadata(hdr); SetHdrMetadataToGralloc4Handle(hdrStaticInfo, hdrDynamicInfo, block.handle()); } SetMetadataToGralloc4Handle(dataSpace, hdrStaticInfo, hdrDynamicInfo, block.handle()); // we don't have dirty regions qbi.setSurfaceDamage(Region::INVALID_REGION); android::IGraphicBufferProducer::QueueBufferOutput qbo; Loading
media/codec2/sfplugin/Codec2Buffer.cpp +15 −1 Original line number Diff line number Diff line Loading @@ -965,9 +965,11 @@ native_handle_t *EncryptedLinearBlockBuffer::handle() const { } using ::aidl::android::hardware::graphics::common::Cta861_3; using ::aidl::android::hardware::graphics::common::Dataspace; using ::aidl::android::hardware::graphics::common::Smpte2086; using ::android::gralloc4::MetadataType_Cta861_3; using ::android::gralloc4::MetadataType_Dataspace; using ::android::gralloc4::MetadataType_Smpte2086; using ::android::gralloc4::MetadataType_Smpte2094_40; Loading Loading @@ -1123,7 +1125,8 @@ c2_status_t GetHdrMetadataFromGralloc4Handle( return err; } c2_status_t SetHdrMetadataToGralloc4Handle( c2_status_t SetMetadataToGralloc4Handle( android_dataspace_t dataSpace, const std::shared_ptr<const C2StreamHdrStaticMetadataInfo::output> &staticInfo, const std::shared_ptr<const C2StreamHdrDynamicMetadataInfo::output> &dynamicInfo, const C2Handle *const handle) { Loading @@ -1134,6 +1137,17 @@ c2_status_t SetHdrMetadataToGralloc4Handle( // Gralloc4 not supported; nothing to do return err; } { hidl_vec<uint8_t> metadata; if (gralloc4::encodeDataspace(static_cast<Dataspace>(dataSpace), &metadata) == OK) { Return<Error4> ret = mapper->set(buffer.get(), MetadataType_Dataspace, metadata); if (!ret.isOk()) { err = C2_REFUSED; } else if (ret != Error4::NONE) { err = C2_CORRUPTED; } } } if (staticInfo && *staticInfo) { ALOGV("Setting static HDR info as gralloc4 metadata"); std::optional<Smpte2086> smpte2086 = Smpte2086{ Loading
media/codec2/sfplugin/Codec2Buffer.h +4 −2 Original line number Diff line number Diff line Loading @@ -410,14 +410,16 @@ c2_status_t GetHdrMetadataFromGralloc4Handle( std::shared_ptr<C2StreamHdrDynamicMetadataInfo::input> *dynamicInfo); /** * Set HDR metadata to Gralloc4 handle. * Set metadata to Gralloc4 handle. * * \param[in] dataSpace Dataspace to set. * \param[in] staticInfo HDR static info to set. Ignored if null or invalid. * \param[in] dynamicInfo HDR dynamic info to set. Ignored if null or invalid. * \param[out] handle handle of the allocation. * \return C2_OK if successful */ c2_status_t SetHdrMetadataToGralloc4Handle( c2_status_t SetMetadataToGralloc4Handle( const android_dataspace_t dataSpace, const std::shared_ptr<const C2StreamHdrStaticMetadataInfo::output> &staticInfo, const std::shared_ptr<const C2StreamHdrDynamicMetadataInfo::output> &dynamicInfo, const C2Handle *const handle); Loading