Merge branch 'upstream/1.16' into tizen_gst_1.16.2
[platform/upstream/gst-plugins-base.git] / gst-libs / gst / video / video-format.h
index c9c3bbb..b35b99b 100644 (file)
@@ -48,8 +48,8 @@ G_BEGIN_DECLS
  * @GST_VIDEO_FORMAT_BGRA: reverse rgb with alpha channel last
  * @GST_VIDEO_FORMAT_ARGB: rgb with alpha channel first
  * @GST_VIDEO_FORMAT_ABGR: reverse rgb with alpha channel first
- * @GST_VIDEO_FORMAT_RGB: rgb
- * @GST_VIDEO_FORMAT_BGR: reverse rgb
+ * @GST_VIDEO_FORMAT_RGB: RGB packed into 24 bits without padding (`R-G-B-R-G-B`)
+ * @GST_VIDEO_FORMAT_BGR: reverse RGB packed into 24 bits without padding (`B-G-R-B-G-R`)
  * @GST_VIDEO_FORMAT_Y41B: planar 4:1:1 YUV
  * @GST_VIDEO_FORMAT_Y42B: planar 4:2:2 YUV
  * @GST_VIDEO_FORMAT_YVYU: packed 4:2:2 YUV (Y0-V0-Y1-U0 Y2-V2-Y3-U2 Y4 ...)
@@ -58,11 +58,13 @@ G_BEGIN_DECLS
  * @GST_VIDEO_FORMAT_v216: packed 4:2:2 16-bit YUV, Y0-U0-Y1-V1 order
  * @GST_VIDEO_FORMAT_NV12: planar 4:2:0 YUV with interleaved UV plane
  * @GST_VIDEO_FORMAT_NV21: planar 4:2:0 YUV with interleaved VU plane
+ * @GST_VIDEO_FORMAT_NV12_10LE32: 10-bit variant of @GST_VIDEO_FORMAT_NV12, packed into 32bit words (MSB 2 bits padding) (Since: 1.14)
  * @GST_VIDEO_FORMAT_GRAY8: 8-bit grayscale
+ * @GST_VIDEO_FORMAT_GRAY10_LE32: 10-bit grayscale, packed into 32bit words (2 bits padding) (Since: 1.14)
  * @GST_VIDEO_FORMAT_GRAY16_BE: 16-bit grayscale, most significant byte first
  * @GST_VIDEO_FORMAT_GRAY16_LE: 16-bit grayscale, least significant byte first
  * @GST_VIDEO_FORMAT_v308: packed 4:4:4 YUV (Y-U-V ...)
- * @GST_VIDEO_FORMAT_IYU2: packed 4:4:4 YUV (U-Y-V ...) (Since 1.10)
+ * @GST_VIDEO_FORMAT_IYU2: packed 4:4:4 YUV (U-Y-V ...) (Since: 1.10)
  * @GST_VIDEO_FORMAT_RGB16: rgb 5-6-5 bits per component
  * @GST_VIDEO_FORMAT_BGR16: reverse rgb 5-6-5 bits per component
  * @GST_VIDEO_FORMAT_RGB15: rgb 5-5-5 bits per component
@@ -86,6 +88,7 @@ G_BEGIN_DECLS
  * @GST_VIDEO_FORMAT_GBR_10BE: planar 4:4:4 RGB, 10 bits per channel (Since: 1.2)
  * @GST_VIDEO_FORMAT_GBR_10LE: planar 4:4:4 RGB, 10 bits per channel (Since: 1.2)
  * @GST_VIDEO_FORMAT_NV16: planar 4:2:2 YUV with interleaved UV plane (Since: 1.2)
+ * @GST_VIDEO_FORMAT_NV16_10LE32: 10-bit variant of @GST_VIDEO_FORMAT_NV16, packed into 32bit words (MSB 2 bits padding) (Since: 1.14)
  * @GST_VIDEO_FORMAT_NV24: planar 4:4:4 YUV with interleaved UV plane (Since: 1.2)
  * @GST_VIDEO_FORMAT_NV12_64Z32: NV12 with 64x32 tiling in zigzag pattern (Since: 1.4)
  * @GST_VIDEO_FORMAT_A420_10BE: planar 4:4:2:0 YUV, 10 bits per channel (Since: 1.6)
@@ -110,9 +113,16 @@ G_BEGIN_DECLS
  * @GST_VIDEO_FORMAT_I422_12LE: planar 4:2:2 YUV, 12 bits per channel (Since: 1.12)
  * @GST_VIDEO_FORMAT_Y444_12BE: planar 4:4:4 YUV, 12 bits per channel (Since: 1.12)
  * @GST_VIDEO_FORMAT_Y444_12LE: planar 4:4:4 YUV, 12 bits per channel (Since: 1.12)
- * @GST_VIDEO_FORMAT_INVZ: 16-bit depth data with distance values at each pixel (Since: 1.16)
+ * @GST_VIDEO_FORMAT_NV12_10LE40: Fully packed variant of NV12_10LE32 (Since: 1.16)
+ * @GST_VIDEO_FORMAT_Y210: packed 4:2:2 YUV, 10 bits per channel (Since: 1.16)
+ * @GST_VIDEO_FORMAT_Y410: packed 4:4:4 YUV, 10 bits per channel(A-V-Y-U...) (Since: 1.16)
+ * @GST_VIDEO_FORMAT_VUYA: packed 4:4:4 YUV with alpha channel (V0-U0-Y0-A0...) (Since: 1.16)
+ * @GST_VIDEO_FORMAT_BGR10A2_LE: packed 4:4:4 RGB with alpha channel(B-G-R-A), 10 bits for R/G/B channel and MSB 2 bits for alpha channel (Since: 1.16)
  *
  * Enum value describing the most common video formats.
+ *
+ * See the [GStreamer raw video format design document](https://gstreamer.freedesktop.org/documentation/design/mediatype-video-raw.html#formats)
+ * for details about the layout and packing of these formats in memory.
  */
 typedef enum {
   GST_VIDEO_FORMAT_UNKNOWN,
@@ -199,9 +209,17 @@ typedef enum {
   GST_VIDEO_FORMAT_I422_12LE,
   GST_VIDEO_FORMAT_Y444_12BE,
   GST_VIDEO_FORMAT_Y444_12LE,
+  GST_VIDEO_FORMAT_GRAY10_LE32,
+  GST_VIDEO_FORMAT_NV12_10LE32,
+  GST_VIDEO_FORMAT_NV16_10LE32,
+  GST_VIDEO_FORMAT_NV12_10LE40,
+  GST_VIDEO_FORMAT_Y210,
+  GST_VIDEO_FORMAT_Y410,
+  GST_VIDEO_FORMAT_VUYA,
+  GST_VIDEO_FORMAT_BGR10A2_LE,
   GST_VIDEO_FORMAT_INVZ,
   GST_VIDEO_FORMAT_STV0, /* TIZEN_PROFILE_TV */
-  GST_VIDEO_FORMAT_STV1, /* TIZEN_PROFILE_TV */  
+  GST_VIDEO_FORMAT_STV1, /* TIZEN_PROFILE_TV */
 } GstVideoFormat;
 
 #define GST_VIDEO_MAX_PLANES 4
@@ -274,7 +292,7 @@ typedef enum
  *   in the least significant bits of the destination.
  * @GST_VIDEO_PACK_FLAG_INTERLACED: The source is interlaced. The unpacked
  *   format will be interlaced as well with each line containing
- *   information from alternating fields. (Since 1.2)
+ *   information from alternating fields. (Since: 1.2)
  *
  * The different flags that can be used when packing and unpacking.
  */
@@ -508,19 +526,29 @@ struct _GstVideoFormatInfo {
 #define GST_VIDEO_FORMAT_INFO_TILE_HS(info) ((info)->tile_hs)
 
 /* format properties */
+
+GST_VIDEO_API
 GstVideoFormat gst_video_format_from_masks           (gint depth, gint bpp, gint endianness,
                                                       guint red_mask, guint green_mask,
                                                       guint blue_mask, guint alpha_mask) G_GNUC_CONST;
 
+GST_VIDEO_API
 GstVideoFormat gst_video_format_from_fourcc          (guint32 fourcc) G_GNUC_CONST;
+
+GST_VIDEO_API
 GstVideoFormat gst_video_format_from_string          (const gchar *format) G_GNUC_CONST;
 
+GST_VIDEO_API
 guint32        gst_video_format_to_fourcc            (GstVideoFormat format) G_GNUC_CONST;
+
+GST_VIDEO_API
 const gchar *  gst_video_format_to_string            (GstVideoFormat format) G_GNUC_CONST;
 
+GST_VIDEO_API
 const GstVideoFormatInfo *
                gst_video_format_get_info             (GstVideoFormat format) G_GNUC_CONST;
 
+GST_VIDEO_API
 gconstpointer  gst_video_format_get_palette          (GstVideoFormat format, gsize *size);
 
 #define GST_VIDEO_SIZE_RANGE "(int) [ 1, max ]"
@@ -534,16 +562,16 @@ gconstpointer  gst_video_format_get_palette          (GstVideoFormat format, gsi
 # define GST_VIDEO_OE(s) G_STRINGIFY(s)"_LE"
 #endif
 
-#define GST_VIDEO_FORMATS_ALL "{ I420, S420, YV12, YUY2, UYVY, AYUV, RGBx, "  \
-  "BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, YVYU, " \
-  "Y444, v210, v216, NV12, SN12, ST12, NV21, GRAY8, GRAY16_BE, GRAY16_LE, v308, RGB16, " \
-  "BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, IYU1, ARGB64, " \
-  "AYUV64, r210, I420_10BE, I420_10LE, I422_10BE, I422_10LE, Y444_10BE, " \
-  "Y444_10LE, GBR, GBR_10BE, GBR_10LE, NV16, NV24, NV12_64Z32, A420_10BE, " \
-  "A420_10LE, A422_10BE, A422_10LE, A444_10BE, A444_10LE, NV61, P010_10BE, " \
-  "P010_10LE, IYU2, VYUY, GBRA, GBRA_10BE, GBRA_10LE, GBR_12BE, GBR_12LE, " \
-  "GBRA_12BE, GBRA_12LE, I420_12BE, I420_12LE, I422_12BE, I422_12LE, " \
-  "Y444_12BE, Y444_12LE, INVZ }"
+#define GST_VIDEO_FORMATS_ALL "{ I420, S420, YV12, YUY2, UYVY, ITLV, AYUV, " \
+  "RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, SR32, ARGB, ABGR, RGB, BGR, Y41B, " \
+  "Y42B, YVYU, Y444, v210, v216, NV12, SN12, ST12, NV21, SN21, GRAY8, GRAY16_BE, " \
+  "GRAY16_LE, v308, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, " \
+  "IYU1, ARGB64, AYUV64, r210, I420_10BE, I420_10LE, I422_10BE, I422_10LE, Y444_10BE, " \
+  "Y444_10LE, GBR, GBR_10BE, GBR_10LE, NV16, NV24, NV12_64Z32, A420_10BE, A420_10LE, " \
+  "A422_10BE, A422_10LE, A444_10BE, A444_10LE, NV61, P010_10BE, P010_10LE, IYU2, " \
+  "VYUY, GBRA, GBRA_10BE, GBRA_10LE, GBR_12BE, GBR_12LE, GBRA_12BE, GBRA_12LE, " \
+  "I420_12BE, I420_12LE, I422_12BE, I422_12LE, Y444_12BE, Y444_12LE, GRAY10_LE32, " \
+  "NV12_10LE32, NV16_10LE32, NV12_10LE40, Y210, Y410, VUYA, BGR10A2_LE, INVZ, STV0, STV1 }"
 
 /**
  * GST_VIDEO_CAPS_MAKE: