[vlc-devel] [PATCH 3/6] libvlc: add structures to describe the display configuration
Steve Lhomme
robux4 at ycbcr.xyz
Fri Jan 25 16:47:02 CET 2019
---
include/vlc/libvlc_media_player.h | 58 +++++++++++++++++++++++++++++++
1 file changed, 58 insertions(+)
diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h
index e75d7a3534..b7278c0360 100644
--- a/include/vlc/libvlc_media_player.h
+++ b/include/vlc/libvlc_media_player.h
@@ -513,6 +513,64 @@ typedef bool (*libvlc_video_makeCurrent_cb)(void* opaque, bool enter);
*/
typedef void* (*libvlc_video_getProcAddress_cb)(void* opaque, const char* fct_name);
+/** Pixel format of the rendering surface, see @a libvlc_video_set_surface_callbacks() */
+typedef enum {
+ libvlc_video_surface_chroma_rgba8, /**< RGBA with 8 bits per channel */
+ libvlc_video_surface_chroma_rgb8, /**< RGB with 8 bits per channel */
+ libvlc_video_surface_chroma_bgra8, /**< BGRA with 8 bits per channel */
+ libvlc_video_surface_chroma_rgb10a2, /**< RGB with 10 bits per channel and alpha on 2 bits */
+ libvlc_video_surface_chroma_rgba16, /**< RGBA with 16 bits per channel */
+ libvlc_video_surface_chroma_i420, /**< 4:2:0 Y,U,V with 8 bits per channel */
+ libvlc_video_surface_chroma_nv12, /**< 4:2:0 Y and packed UV with 8 bits per channel */
+ libvlc_video_surface_chroma_p010, /**< 4:2:0 Y and packed UV with 10 bits per channel */
+} libvlc_video_surface_pixel_format_t;
+
+/** Transfer function of the rendering surface, see @a libvlc_video_set_surface_callbacks() */
+typedef enum {
+ libvlc_video_transfer_srgb, /**< sRGB (gamma 2.2) */
+ libvlc_video_transfer_bt709, /**< ITU-R BT.709 */
+ libvlc_video_transfer_linear, /**< Linear transfer function */
+ libvlc_video_transfer_pq, /**< ITU-R BT.2100 Perceptual Quantization */
+ libvlc_video_transfer_hlg, /**< ARIB STD-B67 (HLG) */
+} libvlc_video_surface_transfer_t;
+
+/** Color Space of the rendering surface, see @a libvlc_video_set_surface_callbacks() */
+typedef enum {
+ libvlc_video_colorspace_bt709, /**< ITU-R BT.709 */
+ libvlc_video_colorspace_bt601, /**< ITU-R BT.601 */
+ libvlc_video_colorspace_bt2020, /**< ITU-R BT.2020 */
+} libvlc_video_surface_colorspace_t;
+
+/** Color Primaires of the rendering surface, see @a libvlc_video_set_surface_callbacks() */
+typedef enum {
+ libvlc_video_primary_bt709, /**< ITU-R BT.709 color primaries */
+ libvlc_video_primary_bt601, /**< ITU-R BT.601 color primaries */
+ libvlc_video_primary_bt2020, /**< ITU-R BT.2020 color primaries */
+ libvlc_video_primary_p3, /**< DCI-P3 D65 color primaries */
+} libvlc_video_surface_primaries_t;
+
+/**
+ * Display/Rendering parameters of the surface rendering.
+ *
+ * The \ref width & \ref height are used to render the subpictures (subtitles) in
+ * the most optimal way. It may be bigger than the original video to being played.
+ * It will affect the \ref libvlc_video_update_output_cb calls.
+ *
+ * The \ref chroma is used to do the proper color conversions so that the
+ * rendering is as accurate as possible based on the source being played.
+ *
+ * \see libvlc_video_set_surface_callbacks()
+ */
+typedef struct libvlc_video_surface_cfg_t {
+ unsigned width; /**< width of the area when the surface is rendered */
+ unsigned height; /**< height of the area when the surface is rendered */
+ libvlc_video_surface_pixel_format_t chroma; /**< pixel format used for the rendering */
+ libvlc_video_surface_transfer_t transfer;
+ libvlc_video_surface_colorspace_t colorspace;
+ libvlc_video_surface_primaries_t primaries;
+ bool limited_range; /**< full range (0-255) or studio/limited range (16-235) */
+} libvlc_video_surface_cfg_t;
+
/**
* Enumeration of the Video engine to be used on output.
* can be passed to @a libvlc_video_set_surface_callbacks
--
2.17.1
More information about the vlc-devel
mailing list