Commit 74d909bc authored by Seungha Yang's avatar Seungha Yang 🐑 Committed by Tim-Philipp Müller

video: Add new APIs for HDR information representation

Introduce HDR signalling methods
* GstVideoMasteringDisplayInfo: Representing display color volume info.
  Defined by SMPTE ST 2086
* GstVideoContentLightLevel: Representing content light level specified in
  CEA-861.3, Appendix A.

Closes gstreamer/gst-plugins-base#400
parent 123c2f8b
......@@ -3047,6 +3047,23 @@ GST_TYPE_VIDEO_MATRIX_MODE
GST_TYPE_VIDEO_PRIMARIES_MODE
GST_TYPE_VIDEO_DITHER_METHOD
#video-hdr.h
<SUBSECTION>
GstVideoMasteringDisplayInfo
GstVideoContentLightLevel
gst_video_mastering_display_info_add_to_caps
gst_video_mastering_display_info_from_caps
gst_video_mastering_display_info_from_string
gst_video_mastering_display_info_init
gst_video_mastering_display_info_is_equal
gst_video_mastering_display_info_is_valid
gst_video_mastering_display_info_to_string
gst_video_content_light_level_add_to_caps
gst_video_content_light_level_from_caps
gst_video_content_light_level_from_string
gst_video_content_light_level_init
gst_video_content_light_level_to_string
#video-multiview.h
<SUBSECTION>
GstVideoMultiviewMode
......
......@@ -5,7 +5,7 @@ include $(top_srcdir)/common/orc.mak
glib_enum_headers = video.h video-format.h video-color.h video-info.h video-dither.h \
colorbalance.h navigation.h video-chroma.h video-tile.h video-converter.h \
video-resampler.h video-frame.h video-scaler.h video-anc.h \
video-overlay-composition.h
video-overlay-composition.h video-hdr.h
glib_enum_define = GST_VIDEO
glib_gen_prefix = gst_video
glib_gen_basename = video
......@@ -32,6 +32,7 @@ libgstvideo_@GST_API_VERSION@_la_SOURCES = \
video-color.c \
video-converter.c \
video-dither.c \
video-hdr.c \
video-info.c \
video-frame.c \
video-scaler.c \
......@@ -72,6 +73,7 @@ libgstvideo_@GST_API_VERSION@include_HEADERS = \
video-color.h \
video-converter.h \
video-dither.h \
video-hdr.h \
video-info.h \
video-frame.h \
video-scaler.h \
......
......@@ -24,6 +24,7 @@ video_sources = [
'video-event.c',
'video-format.c',
'video-frame.c',
'video-hdr.c',
'video-info.c',
'video-multiview.c',
'video-resampler.c',
......@@ -57,6 +58,7 @@ video_headers = [
'video-color.h',
'video-converter.h',
'video-dither.h',
'video-hdr.h',
'video-info.h',
'video-frame.h',
'video-prelude.h',
......
This diff is collapsed.
/* GStreamer
* Copyright (C) <2018-2019> Seungha Yang <seungha.yang@navercorp.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_VIDEO_HDR_H__
#define __GST_VIDEO_HDR_H__
#include <gst/gst.h>
#include <gst/video/video-prelude.h>
G_BEGIN_DECLS
typedef struct _GstVideoMasteringDisplayInfo GstVideoMasteringDisplayInfo;
typedef struct _GstVideoContentLightLevel GstVideoContentLightLevel;
/**
* GstVideoMasteringDisplayInfo:
* @Rx_n: the numerator of nunormalized red x coordinate as defined CIE 1931
* @Rx_d: the denominator of normalized red x coordinate as defined CIE 1931
* @Ry_n: the numerator of normalized red y coordinate as defined CIE 1931
* @Ry_d: the denominator of normalized red y coordinate as defined CIE 1931
* @Gx_n: the numerator of normalized green x coordinate as defined CIE 1931
* @Gx_d: the denominator of normalized green x coordinate as defined CIE 1931
* @Gy_n: the numerator of normalized green y coordinate as defined CIE 1931
* @Gy_d: the denominator of normalized green y coordinate as defined CIE 1931
* @Bx_n: the numerator of normalized blue x coordinate as defined CIE 1931
* @Bx_d: the denominator of normalized blue x coordinate as defined CIE 1931
* @By_n: the numerator of normalized blue y coordinate as defined CIE 1931
* @By_d: the denominator of normalized blue y coordinate as defined CIE 1931
* @Wx_n: the numerator of normalized white x coordinate as defined CIE 1931
* @Wx_d: the denominator of normalized white x coordinate as defined CIE 1931
* @Wy_n: the numerator of normalized white y coordinate as defined CIE 1931
* @Wy_d: the denominator of normalized white y coordinate as defined CIE 1931
* @max_luma_n: the numerator of maximum display luminance in candelas per square meter (cd/m^2 and nit)
* @max_luma_d: the denominator of maximum display luminance in candelas per square meter (cd/m^2 and nit)
* @min_luma_n: the numerator of minimum display luminance in candelas per square meter (cd/m^2 and nit)
* @min_luma_d: the denominator of minimum display luminance in candelas per square meter (cd/m^2 and nit)
*
* Mastering display color volume information defined by SMPTE ST 2086
* (a.k.a static HDR metadata).
* Each array represent fraction value of red, green, blue, white
* and min/max luma (the first element of an array is numerator).
*
* The decimal representation of each red, green, blue and white value should
* be in the range of [0, 1].
*
* Since: 1.18
*/
struct _GstVideoMasteringDisplayInfo
{
guint Rx_n, Rx_d, Ry_n, Ry_d;
guint Gx_n, Gx_d, Gy_n, Gy_d;
guint Bx_n, Bx_d, By_n, By_d;
guint Wx_n, Wx_d, Wy_n, Wy_d;
guint max_luma_n, max_luma_d;
guint min_luma_n, min_luma_d;
/*< private >*/
guint _gst_reserved[GST_PADDING];
};
GST_VIDEO_API
void gst_video_mastering_display_info_init (GstVideoMasteringDisplayInfo * minfo);
GST_VIDEO_API
gboolean gst_video_mastering_display_info_from_string (GstVideoMasteringDisplayInfo * minfo,
const gchar * mastering);
GST_VIDEO_API
gchar * gst_video_mastering_display_info_to_string (const GstVideoMasteringDisplayInfo * minfo);
GST_VIDEO_API
gboolean gst_video_mastering_display_info_is_equal (const GstVideoMasteringDisplayInfo * minfo,
const GstVideoMasteringDisplayInfo * other);
GST_VIDEO_API
gboolean gst_video_mastering_display_info_is_valid (const GstVideoMasteringDisplayInfo * minfo);
GST_VIDEO_API
gboolean gst_video_mastering_display_info_from_caps (GstVideoMasteringDisplayInfo * minfo,
const GstCaps * caps);
GST_VIDEO_API
gboolean gst_video_mastering_display_info_add_to_caps (const GstVideoMasteringDisplayInfo * minfo,
GstCaps * caps);
/**
* GstVideoContentLightMeta:
* @maxCLL_n: the numerator of Maximum Content Light Level (cd/m^2 and nit)
* @maxCLL_d: the denominator of Maximum Content Light Level (cd/m^2 and nit)
* @maxFALL_n: the numerator Maximum Frame-Average Light Level (cd/m^2 and nit)
* @maxFALL_d: the denominator Maximum Frame-Average Light Level (cd/m^2 and nit)
*
* Content light level information specified in CEA-861.3, Appendix A.
*
* Since: 1.18
*/
struct _GstVideoContentLightLevel
{
guint maxCLL_n, maxCLL_d;
guint maxFALL_n, maxFALL_d;
/*< private >*/
guint _gst_reserved[GST_PADDING];
};
GST_VIDEO_API
void gst_video_content_light_level_init (GstVideoContentLightLevel * linfo);
GST_VIDEO_API
gboolean gst_video_content_light_level_from_string (GstVideoContentLightLevel * linfo,
const gchar * level);
GST_VIDEO_API
gchar * gst_video_content_light_level_to_string (const GstVideoContentLightLevel * linfo);
GST_VIDEO_API
gboolean gst_video_content_light_level_from_caps (GstVideoContentLightLevel * linfo,
const GstCaps * caps);
GST_VIDEO_API
gboolean gst_video_content_light_level_add_to_caps (const GstVideoContentLightLevel * linfo,
GstCaps * caps);
G_END_DECLS
#endif /* __GST_VIDEO_HDR_H__ */
......@@ -183,5 +183,6 @@ G_END_DECLS
#include <gst/video/gstvideotimecode.h>
#include <gst/video/gstvideoaffinetransformationmeta.h>
#include <gst/video/video-anc.h>
#include <gst/video/video-hdr.h>
#endif /* __GST_VIDEO_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment