Commit graph

76 commits

Author SHA1 Message Date
Nicolas Dufresne 98b44fdb46 video: Add support for linear 32x32 NV12 tiles
This adds linear 32x32 NV12 based tiles. This format is notably used by
Allwinner VCU and exposed in V4L2 as being "SUNXI Tiled" format. In this
patch we generalize the plane info calculation so we can share this part
with the 4L4 variant.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/754>
2020-07-14 21:43:56 -04:00
Nicolas Dufresne 7d1028424c video: Add NV12_4L4 tile format
This format is produced by Verisillicon VC8000D VPU decoder, it is a simple 4x4
tiling layout in a linear way.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/753>
2020-07-14 17:33:31 +00:00
Guillaume Desmottes 62254f93a3 video: sort formats by quality
Will ensure that we pick the "best" format when negotiating caps.

Fix #649

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/689>
2020-06-09 08:09:58 +00:00
Guillaume Desmottes 84e0689d58 video: add gst_video_make_raw_caps()
More binding friendly version of GST_VIDEO_CAPS_MAKE().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/676>
2020-06-02 11:57:42 +00:00
Guillaume Desmottes f42e67c639 video-format: add gst_video_formats_raw()
The existing GST_VIDEO_FORMATS_ALL macro is not binding friendly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/676>
2020-06-02 11:57:42 +00:00
Haihao Xiang 7816cbf9a4 video: add support for Y412 format
Y412 is a packed 12 bits 4:4:4:4 format in the order U, Y, V, A, 2 bytes
per component with the color value stored in the 12 most significant
bits

Refer to https://github.com/torvalds/linux/blob/master/include/uapi/drm/drm_fourcc.h#L182
for the LE variant
2020-03-27 13:19:34 +00:00
Haihao Xiang ea063721d2 video: add support for Y212 format
Y212 is a packed 12 bits 4:2:2 format in the order Y, U, Y, V, 2 bytes
per component with the color value stored in the 12 most significant
bits

Refer to https://github.com/torvalds/linux/blob/master/include/uapi/drm/drm_fourcc.h#L174
for the LE variant
2020-03-27 13:19:34 +00:00
Haihao Xiang e4e3fc5666 video: add support for P012 format
P012 is a semi-planar 4:2:0 format, 2bytes per component with the value
stored in the 12 most significant bits
2020-03-16 21:01:27 +00:00
Ryan Huang c7a9a966b0 Fix link to raw video format design document 2020-01-02 23:37:21 +00:00
Thibault Saunier 909baa2360 Pass the code through codespell 2019-08-30 13:05:36 +00:00
Seungha Yang c28721d89f video: Add P016 LE/BE formats
Add semi-planar 4:2:0 16 bits format.
2019-08-07 21:54:07 +00:00
Seungha Yang 90cf991337 video: Add Y444_16LE and Y444_16BE formats
Add 16 bits planar 4:4:4 YUV formats.
2019-08-07 12:10:47 +00:00
Guillaume Desmottes 509d4c31f0 video-format: add gst_video_format_info_component()
New API to find out which components are packed in a given plane.
Will prevent us from assuming a 1-1 mapping between planes and
components.
2019-07-19 15:47:02 +05:30
Seungha Yang f4b054d349 video: Add RGB10A2_LE pixel format
Packed 10 bits per each R, G and B channel with MSB 2bits alpha channel.
This format is mapped to Windows' DXGI_FORMAT_R10G10B10A2_UNORM format which is
required for 10bits HDR rendering.

Note that this RGB10A2_LE format is R - B channel swapped version of BGR10A2_LE
2019-05-05 08:12:29 +00:00
Sebastian Dröge 03a85de734 libs: Fix various Since markers 2019-04-23 12:28:26 +00:00
Haihao Xiang 3b6415b421 video: add BGR10A2_LE pixel format
This pixel format is a packed 4:4:4 RGB with alpha channel (B-G-R-A),
R/G/B channel has 10 bits and alpha channel is the MSB 2 bits.
2019-04-04 01:59:18 +00:00
Haihao Xiang 90f8cca04e video: add VUYA pixel format
AYUV in gstreamer was defined in A-Y-U-V order in memory[1], however
Microsoft defined another AYUV format in V-U-Y-A order in memory[2]. Add
VUYA format for the latter in order to distinguish the two formats

[1] https://gstreamer.freedesktop.org/documentation/design/mediatype-video-raw.html#formats
[2] https://docs.microsoft.com/en-us/windows/desktop/medfound/recommended-8-bit-yuv-formats-for-video-rendering#ayuv)
2019-03-21 23:05:09 +00:00
Tim-Philipp Müller 37b56c9735 video-format: minor docs improvement 2019-01-16 00:28:16 +00:00
Tim-Philipp Müller 5dc33afbcc video: link to design docs in GstVideoFormat docs
Which is where the memory layout of the various pixel formats
is explained in detail.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/538
2019-01-11 11:24:50 +00:00
Wangfei 0ac7d1187b video: add Y410 pixel format.
This pixel format is packed format with 4:4:4 sample. And 10
available bits of Y/U/V and 2 available bits of alpha stored
in 4 Bytes.

Format defined in:
https://docs.microsoft.com/en-us/windows/desktop/medfound/10-bit-and-16-bit-yuv-video-formats
2018-12-01 21:05:36 -05:00
Philippe Normand 94e3a1af2a video-format: Move Y210 format declaration to avoid ABI break
The Y210 format was added in the middle of the formats enum and list,
introducing an ABI break.

This issue was detected thanks to the gstreamer-rs test harness.
2018-11-15 11:28:11 +02:00
Wangfei cc0bcd5856 video: add Y210 pixel format.
This pixel format is packed format with 4:2:2 sample and 10
available bits of each channel.

https://bugzilla.gnome.org/show_bug.cgi?id=797267
2018-10-31 15:01:34 +00:00
ayaka 388b48511e video: Add NV12_10LE40 pixel format
This pixel format is a fully packed variant of NV12_10LE32,
a luma pixel would take 10bits in memory, without any
filled bits between pixels in a stride. The color range
follows the BT.2020 standard.

In order to get a better performance in hardware memory
operation, it may expend the stride, append zero data at the
end of echo lines.

Pack function by Nicolas Dufresne.

https://bugzilla.gnome.org/show_bug.cgi?id=795462

Signed-off-by: Nicolas Dufresne <nicolas@ndufresne.ca>
Signed-off-by: ayaka <ayaka@soulik.info>
2018-05-19 13:09:08 -04:00
Nicolas Dufresne 9a3ee4838f Revert "video: Add NV12_10LE40 pixel format"
This reverts commit 35d0783fca.
2018-04-24 17:05:17 -04:00
ayaka 35d0783fca video: Add NV12_10LE40 pixel format
This pixel format is a fully packed variant of NV12, a luma
pixel would take 10bits in memory, without any filled bits
between pixels in a stride. The color range follows
the BT.2020 standard.

In order to get a performance in hardware memory
operation, it may expend the stride, append zero data at the
end of echo lines.

Signed-off-by: ayaka <ayaka@soulik.info>

https://bugzilla.gnome.org/show_bug.cgi?id=795462
2018-04-24 16:51:27 -04:00
Tim-Philipp Müller ae429de8f6 video: GST_EXPORT -> GST_VIDEO_API
We need different export decorators for the different libs.
For now no actual change though, just rename before the release,
and add prelude headers to define the new decorator to GST_EXPORT.
2018-03-13 12:16:42 +00:00
Tim-Philipp Müller 886326bfa0 docs: video: fix typo and add since marker 2018-03-11 22:57:02 +00:00
Nicolas Dufresne f0cbe02541 doc: Fix Since 1.X marker on new video formats 2018-02-14 14:10:22 -05:00
Nicolas Dufresne c256e96047 video: Add NV16_10LE32 support
This adds a 10 bit variant for NV16 packed into 32 bits little endian
words. The MSB 2 bits are padding. This format is used on Xilinx SoC and
identified with the FOURCC XV20.

https://bugzilla.gnome.org/show_bug.cgi?id=789876
2018-01-29 16:01:34 +00:00
Nicolas Dufresne f7a27d7403 video: Add GRAY10_LE32 support
This add a 10bit variant of gray scale packed into 32bits little endian
words. The MSB 2 bits are padding and should be ignored. This format is
used on Xilinx SoC and is identified with the FOURCC XV10.

https://bugzilla.gnome.org/show_bug.cgi?id=789876
2018-01-29 16:01:34 +00:00
Nicolas Dufresne 2b9725d0df video: Add NV12_10LE32 support
This adds a 10bit variant for NV12 which packs 3 10bit components
into little endian 32bit words. The MSB 2 bits are padding and should be
ignored. This format is used on Xilinx SoC and is identified with there
with the FOURCC XV15

https://bugzilla.gnome.org/show_bug.cgi?id=789876
2018-01-29 16:01:34 +00:00
Tim-Philipp Müller 820c34740f video: mark symbols explicitly for export with GST_EXPORT 2017-05-16 15:23:12 +01:00
Sebastian Dröge eda8bd4de1 video-format: Order all formats in GST_VIDEO_FORMATS_ALL like in the enum
And remove duplicated entries.
2017-03-17 13:28:02 +02:00
Sebastian Dröge 95ddfdee4e video-format: Add Since markers to all new formats from 1.2
https://bugzilla.gnome.org/show_bug.cgi?id=780100
2017-03-16 17:38:02 +02:00
Sebastian Dröge 77f802f8e6 video: Add I420/I422/Y444_12LE/BE and GBRA video formats
https://bugzilla.gnome.org/show_bug.cgi?id=780100
2017-03-16 17:32:27 +02:00
Emeric Grange 2fcab9e7ef video: Add GBRA_10LE/BE, GBR_12LE/BE, GBRA_12LE/BE pixel formats
With additional bugfixes from Sebastian Dröge <sebastian@centricular.com>

https://bugzilla.gnome.org/show_bug.cgi?id=780100
2017-03-16 16:44:12 +02:00
Nicolas Dufresne 7a40442ad5 video: Add VYUY pixel format
This format is sometimes the output of JPEG decoders. It is the same as
YUY2 and UYVY but with a different component order.

https://bugzilla.gnome.org/show_bug.cgi?id=767450
2016-11-01 19:55:20 +02:00
Joan Pau Beltran abb88801e7 video: add IYU2 format
This existed in 0.10 and is needed by dc1394src.

IYU2 format is a YUV fully-sampled packed format similar to v308
but with different component order (U-Y-V instead of Y-U-V).

http://www.fourcc.org/yuv.php#IYU2

https://bugzilla.gnome.org/show_bug.cgi?id=763026#c5
2016-06-01 12:07:05 +01:00
Nicolas Dufresne a7809ecc8f video-format: Fix macro documentation
The parameter type was wrongly documenting that a GstVideoInfo structure
pointer was needed, while it needs a GstVideoFormatInfo structure
pointer.

https://bugzilla.gnome.org/show_bug.cgi?id=764414
2016-03-31 13:32:32 -04:00
Scott D Phillips 079ceb894c video: add P010 format support
P010 is a YUV420 format with an interleaved U-V plane and 2-bytes per
component with the the color value stored in the 10 most significant
bits.

https://bugzilla.gnome.org/show_bug.cgi?id=761607
---
Changes since v2:
- Set bits=16 in DPTH10_10_10_HI
Changes since v1:
- Fixed x-offset calculation in uv.
- Added 6-bit shifts to FormatInfo.
2016-03-29 11:16:42 +03:00
Aurélien Zanelli 43db5e5ebd video-format: fix GstVideoFormatInfo documentation warnings
Add missing ':' to tile_ws and tile_hs fields documentation to avoid
bad render of these two fields, mark reserved bytes as private to hide
field and avoid gtkdoc warning and add parameters description to
documented macro to avoid gtkdoc warnings.

https://bugzilla.gnome.org/show_bug.cgi?id=761132
2016-01-26 14:48:19 -05:00
Tim-Philipp Müller 86a1092e59 video: improve GstVideoFormatUnpack docs
https://bugzilla.gnome.org/show_bug.cgi?id=754650
2015-09-07 00:19:09 +01:00
Jan Schmidt 4882cb9f37 video-format: Fix minor docs typo 2015-05-30 01:11:47 +10:00
Aurélien Zanelli c52adc8fcc video: add NV61 format support
https://bugzilla.gnome.org/show_bug.cgi?id=746466
2015-05-04 20:37:59 +01:00
Sebastian Dröge 06fd6f2f63 video: Add support for 10 bit planar AYUV formats 2015-03-10 10:31:28 +01:00
Wim Taymans 57b9ea8f54 video-format: update some docs and add a FIXME(2.0) 2014-11-06 10:45:13 +01:00
Nicolas Dufresne f52fd7a68b video: Don't use extra plane and componenent for tile format
Instead of using extra plane, we encode the number of tiles in x and y in the stride of
each planes (i.e. y_tiles << 16 | x_tiles) and introduce tile_mode, tile_width and
tile_height into GstVideoFormatInfo structure.

https://bugzilla.gnome.org/show_bug.cgi?id=707361
2014-01-13 10:47:03 -05:00
Wim Taymans d899e6df5a video: rename NV12T -> NV12_64Z32
Is a bit more descriptive and allows us to add more tiled types
later.

https://bugzilla.gnome.org/show_bug.cgi?id=707361
2014-01-13 10:46:52 -05:00
Wim Taymans 61cbdf379b format: improve docs
https://bugzilla.gnome.org/show_bug.cgi?id=707361
2014-01-13 10:46:31 -05:00
Wim Taymans 980811c120 video-frame: fix copy of tiled formats
Add code to copy tiled planes.

https://bugzilla.gnome.org/show_bug.cgi?id=707361
2014-01-13 10:45:50 -05:00