diff options
author | Steve Lhomme <robux4@gmail.com> | 2017-04-03 09:29:45 +0200 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2017-04-06 11:26:25 -0300 |
commit | b378f5bd640177801681479ddb9fe80ececd9cf8 (patch) | |
tree | 9ff921d7c9c124e76ab1a0d5305f148316936f22 /libavutil/mastering_display_metadata.h | |
parent | 2a512f86c12d2ed588733c454a12930efbad49f4 (diff) |
lavu: add support for Content Light Level side metadata
As found in HEVC.
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavutil/mastering_display_metadata.h')
-rw-r--r-- | libavutil/mastering_display_metadata.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/libavutil/mastering_display_metadata.h b/libavutil/mastering_display_metadata.h index 936533fec4..847b0b62c6 100644 --- a/libavutil/mastering_display_metadata.h +++ b/libavutil/mastering_display_metadata.h @@ -86,4 +86,43 @@ AVMasteringDisplayMetadata *av_mastering_display_metadata_alloc(void); */ AVMasteringDisplayMetadata *av_mastering_display_metadata_create_side_data(AVFrame *frame); +/** + * Content light level needed by to transmit HDR over HDMI (CTA-861.3). + * + * To be used as payload of a AVFrameSideData or AVPacketSideData with the + * appropriate type. + * + * @note The struct should be allocated with av_content_light_metadata_alloc() + * and its size is not a part of the public ABI. + */ +typedef struct AVContentLightMetadata { + /** + * Max content light level (cd/m^2). + */ + unsigned MaxCLL; + + /** + * Max average light level per frame (cd/m^2). + */ + unsigned MaxFALL; +} AVContentLightMetadata; + +/** + * Allocate an AVContentLightMetadata structure and set its fields to + * default values. The resulting struct can be freed using av_freep(). + * + * @return An AVContentLightMetadata filled with default values or NULL + * on failure. + */ +AVContentLightMetadata *av_content_light_metadata_alloc(size_t *size); + +/** + * Allocate a complete AVContentLightMetadata and add it to the frame. + * + * @param frame The frame which side data is added to. + * + * @return The AVContentLightMetadata structure to be filled by caller. + */ +AVContentLightMetadata *av_content_light_metadata_create_side_data(AVFrame *frame); + #endif /* AVUTIL_MASTERING_DISPLAY_METADATA_H */ |