Commit graph

62 commits

Author SHA1 Message Date
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
Nicolas Dufresne
6b77971097 video: Fix NV12_64Z32 default offset and size
This was a regression introduced by f52fd7a68, where we started using
the stride to encode the dimensions in tiles. This patch simply updates
offset and size calculation as described in the documentation,
part-mediatype-video-raw.txt.
2014-02-18 13:09:21 -05: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
f8d3b9b4fc video: add NV12T support
https://bugzilla.gnome.org/show_bug.cgi?id=707361
2014-01-13 10:45:26 -05:00
Sebastian Dröge
58592a2af3 audio/video-info: Properly initialize the info structures in set_format()
And don't assume in other code that set_format() preserves any fields at
all. These assumptions were already made here for fields that were changed
by set_format().
2013-12-30 10:53:24 +01:00
Sebastian Dröge
65732d9c97 audio/video-info: Initialize the complete struct to 0 in the beginning
Instead of only initializing some parts in some code paths. Also
makes it easier to use the reserved bits of the structs later.

https://bugzilla.gnome.org/show_bug.cgi?id=720810
2013-12-30 10:15:20 +01:00
Edward Hervey
b97c711def audio/video: Initialize all {audio|video}info fields
Fixes "Unitialized Scalar Variable" issues reported by Coverity.

Has the added advantage of detecting whether somebody *does* use those
fields (ending up with a invalid address).

https://bugzilla.gnome.org/show_bug.cgi?id=720810
2013-12-20 14:47:22 +01:00
Sebastian Dröge
8499a0e35a Revert "video: specify/restrict usage of GST_VIDEO_FORMAT_ENCODED"
This reverts commit 5fcdabd907.

Instead of making it impossible to use the ENCODED format we should
just document that it must not be used for capsfeature-less caps.

Also this commit broke API/ABI.
2013-12-17 17:23:19 +01:00
Edward Hervey
5fcdabd907 video: specify/restrict usage of GST_VIDEO_FORMAT_ENCODED
GST_VIDEO_FORMAT_ENCODED was added to support *extracting* video-related
information (like width, height, framerate,...) from caps.

It is __NOT__ intended to be used as a format field on video/x-raw caps.
2013-12-11 16:51:42 +01:00
Wim Taymans
5732ced692 video-info: respect stride alignment
Increase the left padding so that we don't cause stride alignments later when we
apply the padding.

https://bugzilla.gnome.org/show_bug.cgi?id=694299
2013-07-19 10:47:27 +02:00
Wim Taymans
fad4589579 Revert "video: respect stride alignment when calculating planes offsets"
This reverts commit 28e1dadbfa.

Incrementing the offset to make the plane aligned causes the image to be
incompatible with what Xv expects. Rather that forcing a memcpy in the
xvimagesink we would like to do adjust the left padding instead.
2013-07-19 10:43:38 +02:00
Arnaud Vrac
28e1dadbfa video: respect stride alignment when calculating planes offsets
https://bugzilla.gnome.org/show_bug.cgi?id=694299
2013-07-18 16:23:33 +02:00