Add plumbing for HDR metadata
Allow a ANativeWindow client to send HDR metadata to SurfaceFlinger.
The metadata can be queried with
BufferLayerConsumer::getCurrentHdrMetadata.
Written by Courtney. Updated by olv@.
Bug: 63710530
Test: builds
Change-Id: I23192d4750950664b57863a533bffd72397255b4
diff --git a/services/surfaceflinger/BufferLayerConsumer.h b/services/surfaceflinger/BufferLayerConsumer.h
index 9b18608..51c2b41 100644
--- a/services/surfaceflinger/BufferLayerConsumer.h
+++ b/services/surfaceflinger/BufferLayerConsumer.h
@@ -21,6 +21,7 @@
#include <gui/BufferQueueDefs.h>
#include <gui/ConsumerBase.h>
+#include <gui/HdrMetadata.h>
#include <ui/FenceTime.h>
#include <ui/GraphicBuffer.h>
@@ -121,6 +122,10 @@
// set by the most recent call to updateTexImage.
android_dataspace getCurrentDataSpace();
+ // getCurrentHdrMetadata retrieves the HDR metadata associated with the
+ // texture image set by the most recent call to updateTexImage.
+ const HdrMetadata& getCurrentHdrMetadata() const;
+
// getFrameNumber retrieves the frame number associated with the texture
// image set by the most recent call to updateTexImage.
//
@@ -316,6 +321,10 @@
// gets set each time updateTexImage is called.
android_dataspace mCurrentDataSpace;
+ // mCurrentHdrMetadata is the HDR metadata for the current texture. It
+ // gets set each time updateTexImage is called.
+ HdrMetadata mCurrentHdrMetadata;
+
// mCurrentFrameNumber is the frame counter for the current texture.
// It gets set each time updateTexImage is called.
uint64_t mCurrentFrameNumber;