Loading graphics/allocator/aidl/android/hardware/graphics/allocator/AllocationResult.aidl +6 −2 Original line number Original line Diff line number Diff line Loading @@ -25,6 +25,10 @@ import android.hardware.common.NativeHandle; */ */ @VintfStability @VintfStability parcelable AllocationResult { parcelable AllocationResult { /** * The number of pixels between two consecutive rows of an allocated buffer, when the concept * of consecutive rows is defined. Otherwise, it has no meaning. */ int stride; int stride; NativeHandle[] buffers; NativeHandle[] buffers; } } graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/StandardMetadataType.aidl +1 −0 Original line number Original line Diff line number Diff line Loading @@ -58,4 +58,5 @@ enum StandardMetadataType { CTA861_3 = 20, CTA861_3 = 20, SMPTE2094_40 = 21, SMPTE2094_40 = 21, SMPTE2094_10 = 22, SMPTE2094_10 = 22, STRIDE = 23, } } graphics/common/aidl/android/hardware/graphics/common/StandardMetadataType.aidl +13 −0 Original line number Original line Diff line number Diff line Loading @@ -368,4 +368,17 @@ enum StandardMetadataType { * If this is unset when encoded into a byte stream, the byte stream is empty. * If this is unset when encoded into a byte stream, the byte stream is empty. */ */ SMPTE2094_10 = 22, SMPTE2094_10 = 22, /** * Can be used to get the stride in pixels of the buffer allocation. This is the number of * pixels between two consecutive rows of an allocated buffer, when the concept of consecutive * rows is defined. Otherwise, it has no meaning. * * Must match the value returned in android.hardware.graphics.allocator.AllocationResult#stride * * This is required metadata in mapper5 and should be read-only. * * The metadata type is a uint32_t. */ STRIDE = 23, } } graphics/mapper/stable-c/implutils/include/android/hardware/graphics/mapper/utils/IMapperMetadataTypes.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -563,6 +563,7 @@ DEFINE_TYPE(SMPTE2086, std::optional<Smpte2086>); DEFINE_TYPE(CTA861_3, std::optional<Cta861_3>); DEFINE_TYPE(CTA861_3, std::optional<Cta861_3>); DEFINE_TYPE(SMPTE2094_10, std::optional<std::vector<uint8_t>>); DEFINE_TYPE(SMPTE2094_10, std::optional<std::vector<uint8_t>>); DEFINE_TYPE(SMPTE2094_40, std::optional<std::vector<uint8_t>>); DEFINE_TYPE(SMPTE2094_40, std::optional<std::vector<uint8_t>>); DEFINE_TYPE(STRIDE, uint32_t); #undef DEFINE_TYPE #undef DEFINE_TYPE Loading graphics/mapper/stable-c/vts/VtsHalGraphicsMapperStableC_TargetTest.cpp +11 −0 Original line number Original line Diff line number Diff line Loading @@ -1557,6 +1557,16 @@ TEST_P(GraphicsMapperStableCTests, GetSmpte2094_40) { } } } } TEST_P(GraphicsMapperStableCTests, GetStride) { auto buffer = allocateGeneric(); ASSERT_TRUE(buffer); auto bufferHandle = buffer->import(); ASSERT_TRUE(bufferHandle); auto value = getStandardMetadata<StandardMetadataType::STRIDE>(*bufferHandle); ASSERT_TRUE(value.has_value()); EXPECT_EQ(buffer->stride(), *value); } TEST_P(GraphicsMapperStableCTests, SupportsRequiredGettersSetters) { TEST_P(GraphicsMapperStableCTests, SupportsRequiredGettersSetters) { auto buffer = allocateGeneric(); auto buffer = allocateGeneric(); ASSERT_TRUE(buffer); ASSERT_TRUE(buffer); Loading Loading @@ -1587,6 +1597,7 @@ TEST_P(GraphicsMapperStableCTests, SupportsRequiredGettersSetters) { StandardMetadataType::BLEND_MODE, StandardMetadataType::BLEND_MODE, StandardMetadataType::SMPTE2086, StandardMetadataType::SMPTE2086, StandardMetadataType::CTA861_3, StandardMetadataType::CTA861_3, StandardMetadataType::STRIDE, }; }; std::vector<StandardMetadataType> requiredSetters = { std::vector<StandardMetadataType> requiredSetters = { Loading Loading
graphics/allocator/aidl/android/hardware/graphics/allocator/AllocationResult.aidl +6 −2 Original line number Original line Diff line number Diff line Loading @@ -25,6 +25,10 @@ import android.hardware.common.NativeHandle; */ */ @VintfStability @VintfStability parcelable AllocationResult { parcelable AllocationResult { /** * The number of pixels between two consecutive rows of an allocated buffer, when the concept * of consecutive rows is defined. Otherwise, it has no meaning. */ int stride; int stride; NativeHandle[] buffers; NativeHandle[] buffers; } }
graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/StandardMetadataType.aidl +1 −0 Original line number Original line Diff line number Diff line Loading @@ -58,4 +58,5 @@ enum StandardMetadataType { CTA861_3 = 20, CTA861_3 = 20, SMPTE2094_40 = 21, SMPTE2094_40 = 21, SMPTE2094_10 = 22, SMPTE2094_10 = 22, STRIDE = 23, } }
graphics/common/aidl/android/hardware/graphics/common/StandardMetadataType.aidl +13 −0 Original line number Original line Diff line number Diff line Loading @@ -368,4 +368,17 @@ enum StandardMetadataType { * If this is unset when encoded into a byte stream, the byte stream is empty. * If this is unset when encoded into a byte stream, the byte stream is empty. */ */ SMPTE2094_10 = 22, SMPTE2094_10 = 22, /** * Can be used to get the stride in pixels of the buffer allocation. This is the number of * pixels between two consecutive rows of an allocated buffer, when the concept of consecutive * rows is defined. Otherwise, it has no meaning. * * Must match the value returned in android.hardware.graphics.allocator.AllocationResult#stride * * This is required metadata in mapper5 and should be read-only. * * The metadata type is a uint32_t. */ STRIDE = 23, } }
graphics/mapper/stable-c/implutils/include/android/hardware/graphics/mapper/utils/IMapperMetadataTypes.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -563,6 +563,7 @@ DEFINE_TYPE(SMPTE2086, std::optional<Smpte2086>); DEFINE_TYPE(CTA861_3, std::optional<Cta861_3>); DEFINE_TYPE(CTA861_3, std::optional<Cta861_3>); DEFINE_TYPE(SMPTE2094_10, std::optional<std::vector<uint8_t>>); DEFINE_TYPE(SMPTE2094_10, std::optional<std::vector<uint8_t>>); DEFINE_TYPE(SMPTE2094_40, std::optional<std::vector<uint8_t>>); DEFINE_TYPE(SMPTE2094_40, std::optional<std::vector<uint8_t>>); DEFINE_TYPE(STRIDE, uint32_t); #undef DEFINE_TYPE #undef DEFINE_TYPE Loading
graphics/mapper/stable-c/vts/VtsHalGraphicsMapperStableC_TargetTest.cpp +11 −0 Original line number Original line Diff line number Diff line Loading @@ -1557,6 +1557,16 @@ TEST_P(GraphicsMapperStableCTests, GetSmpte2094_40) { } } } } TEST_P(GraphicsMapperStableCTests, GetStride) { auto buffer = allocateGeneric(); ASSERT_TRUE(buffer); auto bufferHandle = buffer->import(); ASSERT_TRUE(bufferHandle); auto value = getStandardMetadata<StandardMetadataType::STRIDE>(*bufferHandle); ASSERT_TRUE(value.has_value()); EXPECT_EQ(buffer->stride(), *value); } TEST_P(GraphicsMapperStableCTests, SupportsRequiredGettersSetters) { TEST_P(GraphicsMapperStableCTests, SupportsRequiredGettersSetters) { auto buffer = allocateGeneric(); auto buffer = allocateGeneric(); ASSERT_TRUE(buffer); ASSERT_TRUE(buffer); Loading Loading @@ -1587,6 +1597,7 @@ TEST_P(GraphicsMapperStableCTests, SupportsRequiredGettersSetters) { StandardMetadataType::BLEND_MODE, StandardMetadataType::BLEND_MODE, StandardMetadataType::SMPTE2086, StandardMetadataType::SMPTE2086, StandardMetadataType::CTA861_3, StandardMetadataType::CTA861_3, StandardMetadataType::STRIDE, }; }; std::vector<StandardMetadataType> requiredSetters = { std::vector<StandardMetadataType> requiredSetters = { Loading