mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 20:05:38 +00:00
video: add 10 bits I420 format
Add 10 bits I420 format definitions Move encoded format as second entry in the array so that it doesn't end up in a weird place when we add formats. See https://bugzilla.gnome.org/show_bug.cgi?id=665034
This commit is contained in:
parent
d7fff5e023
commit
59d8d73aa2
2 changed files with 27 additions and 4 deletions
|
@ -104,6 +104,8 @@ typedef struct
|
|||
|
||||
#define MAKE_YUV_FORMAT(name, desc, fourcc, depth, pstride, plane, offs, sub ) \
|
||||
{ fourcc, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_YUV, depth, pstride, plane, offs, sub } }
|
||||
#define MAKE_YUV_LE_FORMAT(name, desc, fourcc, depth, pstride, plane, offs, sub ) \
|
||||
{ fourcc, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_YUV | GST_VIDEO_FORMAT_FLAG_LE, depth, pstride, plane, offs, sub } }
|
||||
#define MAKE_YUVA_FORMAT(name, desc, fourcc, depth, pstride, plane, offs, sub) \
|
||||
{ fourcc, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_YUV | GST_VIDEO_FORMAT_FLAG_ALPHA, depth, pstride, plane, offs, sub } }
|
||||
|
||||
|
@ -123,6 +125,8 @@ static VideoFormat formats[] = {
|
|||
{0x00000000, {GST_VIDEO_FORMAT_UNKNOWN, "UNKNOWN", "unknown video", 0, DPTH0,
|
||||
PSTR0, PLANE_NA,
|
||||
OFFS0}},
|
||||
{0x00000000, {GST_VIDEO_FORMAT_ENCODED, "ENCODED", "encoded video",
|
||||
GST_VIDEO_FORMAT_FLAG_COMPLEX, DPTH0, PSTR0, PLANE_NA, OFFS0}},
|
||||
MAKE_YUV_FORMAT (I420, "raw video", GST_MAKE_FOURCC ('I', '4', '2', '0'),
|
||||
DPTH888, PSTR111,
|
||||
PLANE012, OFFS0, SUB420),
|
||||
|
@ -239,8 +243,10 @@ static VideoFormat formats[] = {
|
|||
MAKE_YUV_FORMAT (r210, "raw video", GST_MAKE_FOURCC ('r', '2', '1', '0'),
|
||||
DPTH10_10_10,
|
||||
PSTR444, PLANE0, OFFS0, SUB444),
|
||||
{0x00000000, {GST_VIDEO_FORMAT_ENCODED, "ENCODED", "encoded video",
|
||||
GST_VIDEO_FORMAT_FLAG_COMPLEX, DPTH0, PSTR0, PLANE_NA, OFFS0}},
|
||||
MAKE_YUV_FORMAT (I420_10BE, "raw video", 0x00000000, DPTH10_10_10,
|
||||
PSTR222, PLANE012, OFFS0, SUB420),
|
||||
MAKE_YUV_LE_FORMAT (I420_10LE, "raw video", 0x00000000, DPTH10_10_10,
|
||||
PSTR222, PLANE012, OFFS0, SUB420),
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -1434,6 +1440,18 @@ fill_planes (GstVideoInfo * info)
|
|||
info->size = info->offset[2] +
|
||||
info->stride[2] * (GST_ROUND_UP_4 (height) / 4);
|
||||
break;
|
||||
case GST_VIDEO_FORMAT_I420_10LE:
|
||||
case GST_VIDEO_FORMAT_I420_10BE:
|
||||
info->stride[0] = GST_ROUND_UP_4 (width * 2);
|
||||
info->stride[1] = GST_ROUND_UP_4 (width);
|
||||
info->stride[2] = info->stride[1];
|
||||
info->offset[0] = 0;
|
||||
info->offset[1] = info->stride[0] * GST_ROUND_UP_2 (height);
|
||||
info->offset[2] = info->offset[1] +
|
||||
info->stride[1] * (GST_ROUND_UP_2 (height) / 2);
|
||||
info->size = info->offset[2] +
|
||||
info->stride[2] * (GST_ROUND_UP_2 (height) / 2);
|
||||
break;
|
||||
case GST_VIDEO_FORMAT_ENCODED:
|
||||
break;
|
||||
case GST_VIDEO_FORMAT_UNKNOWN:
|
||||
|
|
|
@ -72,11 +72,14 @@ G_BEGIN_DECLS
|
|||
* @GST_VIDEO_FORMAT_ARGB64: rgb with alpha channel first, 16 bits per channel (Since: 0.10.33)
|
||||
* @GST_VIDEO_FORMAT_AYUV64: packed 4:4:4 YUV with alpha channel, 16 bits per channel (A0-Y0-U0-V0 ...) (Since: 0.10.33)
|
||||
* @GST_VIDEO_FORMAT_r210: packed 4:4:4 RGB, 10 bits per channel (Since: 0.10.33)
|
||||
* @GST_VIDEO_FORMAT_I420_10BE: planar 4:2:0 YUV, 10 bits per channel
|
||||
* @GST_VIDEO_FORMAT_I420_10LE: planar 4:2:0 YUV, 10 bits per channel
|
||||
*
|
||||
* Enum value describing the most common video formats.
|
||||
*/
|
||||
typedef enum {
|
||||
GST_VIDEO_FORMAT_UNKNOWN,
|
||||
GST_VIDEO_FORMAT_ENCODED,
|
||||
GST_VIDEO_FORMAT_I420,
|
||||
GST_VIDEO_FORMAT_YV12,
|
||||
GST_VIDEO_FORMAT_YUY2,
|
||||
|
@ -119,7 +122,8 @@ typedef enum {
|
|||
GST_VIDEO_FORMAT_ARGB64,
|
||||
GST_VIDEO_FORMAT_AYUV64,
|
||||
GST_VIDEO_FORMAT_r210,
|
||||
GST_VIDEO_FORMAT_ENCODED
|
||||
GST_VIDEO_FORMAT_I420_10BE,
|
||||
GST_VIDEO_FORMAT_I420_10LE
|
||||
} GstVideoFormat;
|
||||
|
||||
#define GST_VIDEO_MAX_PLANES 4
|
||||
|
@ -692,7 +696,8 @@ gboolean gst_video_frame_copy_plane (GstVideoFrame *dest, const GstVideoFr
|
|||
"BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, " \
|
||||
"YVYU, Y444, v210, v216, NV12, NV21, GRAY8, GRAY16_BE, GRAY16_LE, " \
|
||||
"v308, Y800, Y16, RGB16, BGR16, RGB15, BGR15, UYVP, A420, " \
|
||||
"RGB8_PALETTED, YUV9, YVU9, IYU1, ARGB64, AYUV64, r210 }"
|
||||
"RGB8_PALETTED, YUV9, YVU9, IYU1, ARGB64, AYUV64, r210, I420_10LE," \
|
||||
"I420_10BE }"
|
||||
|
||||
/**
|
||||
* GST_VIDEO_CAPS_MAKE:
|
||||
|
|
Loading…
Reference in a new issue