Commit graph

74 commits

Author SHA1 Message Date
Thibault Saunier
f9de1b9214 docs: Add some missing sections documentation 2019-05-13 10:19:22 -04:00
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
Guillaume Desmottes
e397c4cea1 video-info: explain in logs why colorimetry are rejected
It wasn't clear from the logs why some colorimetry format were rejected.
2019-04-09 13:22:12 +05:30
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
Guillaume Desmottes
10ce73b6eb video-info: check if alternate caps has the feature as well
It's invalid to have a 'interlace-mode=alternate' without the Interlaced caps
feature as well.
Modify gst_video_info_from_caps() to reject such case so we can easily
spot them in bugged elements.
2019-03-25 15:36:57 +01:00
Guillaume Desmottes
6ba860021c video-info: handle 'field-order' in alternate mode
The alternate interlace mode may also use the 'field-order' field in caps.
2019-03-25 15:35:46 +01: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
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
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
Zeeshan Ali
4879983253 video: Add GST_VIDEO_INFO_FIELD_HEIGHT() macro
Add a new macro that gives you the height of a field. It returns the
height of the full frame unless split-field (alternate) interlacing is
in use. Also GST_VIDEO_INFO_COMP_HEIGHT macro now uses this new macro to
get the height for its calculation.

https://bugzilla.gnome.org/show_bug.cgi?id=796106
2018-08-29 12:14:38 -04:00
Zeeshan Ali
0fbe4634a6 video: Add gst_video_info_set_interlaced_format()
Add a helper to set the interlacing mode while creating the GstVideoInfo
in addition to format and resolution. Using this helper will ensure that
size is correctly calculated for split-field interlacing mode.

https://bugzilla.gnome.org/show_bug.cgi?id=796106
2018-08-29 12:14:38 -04:00
Zeeshan Ali
bd9c7b36d8 video: Add GST_VIDEO_INTERLACE_MODE_ALTERNATE
Add a new interlace mode enum to represent buffers containing a single
field of an interlaced video in a buffer. The name is based on the
equivalent video format in the V4L2 API, V4L2_FIELD_ALTERNATE:

https://01.org/linuxgraphics/gfx-docs/drm/media/uapi/v4l/field-order.html

Since caps fields are optional, we also introduce a new caps feature,
"format:Interlaced" that always goes with "alternate" interlace mode to ensure
that caps for this incompatible format are incompatible with other interlaced
and progressive video caps.

https://bugzilla.gnome.org/show_bug.cgi?id=796106
2018-08-29 12:14:38 -04: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
Mark Nauwelaerts
c93eda31d9 video: fix some GIR annotations
Mostly related to out and array parameters
2018-04-23 19:33:19 +02: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
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
Edward Hervey
216ee52090 video-info: Properly initialize/set extra fields
The flags and field order weren't properly initialized in the
gst_video_info_init().

Furthermore in gst_video_info_from_caps() we might set unitiliazed
values previously, this only sets them if valid.
2016-11-28 16:53:10 +01:00
Sebastian Dröge
47fdb15074 video-info: Add unit test for overflow checks
And also prevent overflows caused by allowing uint width/height in
gst_video_info_set_format() but storing them as (signed!) ints.
2016-11-24 15:40:22 +02:00
Sebastian Dröge
3d7a566640 video-info: And change the overflow check to not actually overflow itself 2016-11-24 15:12:40 +02:00
Sebastian Dröge
17cdd369e6 video-info: Sanity check the frame size to prevent overflows
https://bugzilla.gnome.org/show_bug.cgi?id=774588
2016-11-24 15:06:39 +02:00
Scott D Phillips
ff8d49a4c8 Use intermediate guint when handling GstVideoMultiviewFlags
The underlying integer type of the enum GstVideoMultiviewFlags is
implementation defined and may not have the same size as guint.

https://bugzilla.gnome.org/show_bug.cgi?id=774293
2016-11-12 10:51:30 +02:00
Sebastian Dröge
9041db4680 Revert "video-color: Allow converting incomplete colorimetry to a string"
This reverts commit 158eae7e7e.

It already *always* allowed to convert incomplete colorimetry to a
string.
2016-11-01 23:51:47 +02:00
Sebastian Dröge
158eae7e7e video-color: Allow converting incomplete colorimetry to a string
This is only a good idea for non-raw caps.

https://bugzilla.gnome.org/show_bug.cgi?id=771376
2016-11-01 20:40:07 +02:00
Sebastian Dröge
79809633de video-info: Add optional field-order caps field for interlaced-mode=interleaved
Usually this information is static for the whole stream, and various
container formats store this information inside the headers for the
whole stream.

Having it inside the caps for these cases simplifies code and makes it
possible to express these requirements more explicitly with the caps.

https://bugzilla.gnome.org/show_bug.cgi?id=771376
2016-11-01 20:40:07 +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
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
Wim Taymans
773e2476e6 video-info: enfore RGB matrix for RGB formats
In gst_video_info_to_caps(), make sure we end up with an RGB matrix for
RGB formats and warn when the GstVideoInfo colorimetry is wrong.
In gst_video_info_from_caps(), fix the GstVideoInfo with an RGB matrix
for RGB formats and warn about inconsistent caps.

See https://bugzilla.gnome.org/show_bug.cgi?id=759624
2016-01-20 10:19:34 +01:00
Wim Taymans
14083178b8 video: improve logging
Add logging categories for most video objects.
Remove some useless debug lines in video-info and videotestsrc.
Add a performance debug line in the video scaler.
2015-07-15 12:47:42 +02:00
Marcin Kolny
95fa0c58a2 video-info: implement GstVideoInfo as boxed type
GstVideoInfo usually is created on the stack, but boxed type can be useful
for bindings.

https://bugzilla.gnome.org/show_bug.cgi?id=752011
2015-07-06 12:52:51 +03:00
Jan Schmidt
7c1da700c4 video: Add multiview/stereo support
Add flags and enums to support multiview signalling in
GstVideoInfo and GstVideoFrame, and the caps serialisation and
deserialisation.

videoencoder: Copy multiview settings from reference input state

Add gst_video_multiview_* support API and GstVideoMultiviewMeta meta

https://bugzilla.gnome.org/show_bug.cgi?id=611157
2015-06-11 12:05:00 +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
Jan Schmidt
62bdb117ac video: check colorimetry and chroma_site equality in gst_video_info_is_equal()
Add VideoInfo accessors for colorimetry and chroma_site and use them
when checking the equality of two GstVideoInfo
2015-05-04 13:16:27 +10:00
Wim Taymans
b3db5883e1 video-info: expose InterlaceMode conversion to/from string
Expose the methods used to convert a GstVideoInterlaceMode to and
from a string.
2015-04-28 12:01:02 +02:00
Sebastian Dröge
06fd6f2f63 video: Add support for 10 bit planar AYUV formats 2015-03-10 10:31:28 +01:00
Wim Taymans
62ff9b8bca video-info: validate parsed colorimetry
Validate the parsed colorimetry and reset to defaults when we get RGB
with a matrix or YUV without a matrix.
2015-03-09 16:28:02 +01:00
Wim Taymans
cf572ae2cb video-info: use default colorimetry on error
When we fail to parse the colorimetry property, fall back to the default
colorimetry for the format and dimension instead of leaving things
undefined.
2015-03-09 16:02:17 +01:00
Sebastian Dröge
7a35321710 video: Add support for BT2020 colorspace (UHD) 2015-01-08 10:45:46 +01:00
Wim Taymans
f6683b8f14 video-info: add a note about subsampled formats
Add a note about gst_video_info_set_format() and interlaced formats.
2014-11-19 12:55:03 +01:00
Wim Taymans
24989b53fc video-info: handle interlaced size correctly
Refactor GstVideoInfo init, make function to set default colorimetry.
Call fill_planes after we configure the GstVideoInfo with parameters
from the caps.
The size of the chroma planes for interlaced vertically subsampled
formats needs to be rounded up to 2, we have 2 fields with each
the same anount of chroma lines.
2014-11-19 12:55:03 +01:00
Wim Taymans
943e1319a2 video-color: fix default 601 primaries 2014-11-19 12:55:02 +01:00
Wim Taymans
c98bc6fdc6 video-color: make sRGB colorimetry the default for RGB 2014-11-19 12:55:02 +01:00
Wim Taymans
780df29cb1 video-info: use h-cosited chroma for HD video by default 2014-11-06 18:19:44 +01:00
Thiago Santos
fb3a9d1bc5 video: avoid overflows when doing int operations for size
size is a gsize, so cast the operands to it to avoid overflows
and setting wrong value to the video size.

Includes tests.

https://bugzilla.gnome.org/show_bug.cgi?id=731195
2014-06-09 23:38:39 -03:00
Nicolas Dufresne
e0cfd6e26b video-info: Also check the stride and offset are equal
gst_video_info_is_equal() was not checking if stride and offset
had changed.

https://bugzilla.gnome.org/show_bug.cgi?id=729896
2014-05-12 18:22:32 -04:00