Commit graph

1763 commits

Author SHA1 Message Date
Sebastian Dröge
f54ef6c74e videoaggregator: Don't require any pads to be configured for negotiating source pad caps
This is not actually required (anymore?). Source pad caps can be
negotiated at any time regardless of any configured (or existing) sink
pads and videoaggregator comes up with some fixated caps based on the
downstream caps.

Subclasses can override this behaviour as needed by overriding
update_src_caps().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/793>
2020-09-09 11:35:02 +00:00
Marijn Suijten
0ea3279df1 gst-libs: gl: Fix documentation typo and clarify gl_memory_texsubimage
`gst_gl_memory_read_pixels` reads pixels from `GLMemory` into the
pointer, effectively writing to it. This is opposite from
`gst_gl_memory_texsubimage` which reads texture data from `read_pointer`
into `GLMemory`.

Both cases are clarified by changing `read_pointer` to `write_pointer`,
and explaining what `gst_gl_memory_texsubimage` does in addition to
referring back to `gst_gl_memory_read_pixels`.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/806>
2020-09-09 09:54:48 +00:00
Sebastian Dröge
5bfb438d3b video-anc: Implement transform functions for AFD/Bar metas
If the transformation is just a copy, copy over the metadata. For AFD
also copy over the metadata if the aspect ratio stays the same in
scaling transformations. In all other cases fail the transformation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/791>
2020-09-09 07:48:02 +00:00
Sebastian Dröge
805b1ee9b3 video-converter: Add fast paths from v210 to I420/YV12, Y42B, UYVY and YUY2
These then don't require going through the generic code path via AYUV64
first but can be converted directly.

This speeds up processing of
  videotestsrc ! v210 ! videoconvert ! other_format ! fakesink
by a factor of 1.55 for I420/YV12 and 1.40 for the other destination
formats and reduces memory pressure considerably.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/775>
2020-09-08 21:10:30 +00:00
Sebastian Dröge
91ec4e06d7 video: Rename gst_video_color_transfer_*() to gst_video_transfer_function_*() in new API
The type is called GstVideoTransferFunction so the function names should
match, otherwise gobject-introspection is keeping the functions as
global functions instead of methods on the type.

The same mistake was also made in lots of other APIs over the years, but
here we can at least fix it for 1.18 still.

Thanks to Marijn Suijten for noticing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/807>
2020-09-07 13:04:20 +03:00
Sebastian Dröge
391d09dc24 audio/video: Copy more metas by default in the codec base classes
For audio we copy metas that have no tags at all, or that only have the
"audio" and/or "audio-channels" tag. Audio codecs don't change the
audio aspect of the stream and in almost all cases don't change the
number of channels. They might however change the sample rate (e.g.
Opus). Subclasses that change the number of channels will have to
override ::transform_meta() accordingly.

For video we copy metas that have no tags at all, or that only have the
"video" and/or "video-size" and/or "video-orientation" tag. Video codecs
don't change the "video" aspect of the stream and in almost all cases
don't change the resolution or orientation. Subclasses that rescale or
change the orientation will have to override ::transform_meta()
accordingly.

See https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/576#note_610581

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/801>
2020-08-30 22:12:22 +00:00
Sebastian Dröge
61064257ef videoaggregator: Update for additional info parameter to the "samples-selected" signal
See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/590

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/780>
2020-08-07 09:34:37 +03:00
Mathieu Duponchelle
1de8af6f8b videoaggregator: update to new samples selection API
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/778>
2020-08-05 20:09:52 +02:00
Mathieu Duponchelle
2faeb7d394 videoaggregator: implement samples selection API
Call gst_aggregator_selected_samples() after filling the queues
(but before preparing frames).

Implement GstAggregator.peek_next_sample.

Add an example that demonstrates usage of the new API in combination
with the existing buffer-consumed signal.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/728>
2020-07-31 07:54:56 +00:00
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
Aaron Boxer
c770f0b68e video: allow frame copy destination to have dimensions smaller than source
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/707>
2020-07-14 16:39:05 +00:00
Sebastian Dröge
81e7cd1fca video-converter: Add scaling fast-path for GBRA format
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/684

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/749>
2020-07-10 12:25:56 +00:00
Nicolas Dufresne
dcc7242ba5 videoconverter: Relax frame size checks
Since we are using VideoMeta, the converter (similarly to the video_frame_copy
utility) should have no issue dealing with frames that are slightly larger.
This situation occure as some element will use padded width/height for
allocation, which results in a VideoMeta width/height being larger then the
display width/height found in the negotiated caps.

Fixes #790

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/747>
2020-07-09 20:35:05 +00:00
Tim-Philipp Müller
6bb3e01918 meson: add update-orc-dist target
Add target to update backup orc -dist.[ch] files.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/734>
2020-07-04 14:01:56 +01:00
Mathieu Duponchelle
e82eb9d0fa video-color.h: fix comment syntax 2020-07-04 00:39:18 +02:00
Vivia Nikolaidou
ad55d3ce9d video-converter: Make fast path work for equivalent transfer functions
For example, BT709, BT601, and BT2020_10 all have theoretically
different transfer functions, but the same function in practice. In
these cases, we should use the fast path for negotiating. Also,
BT2020_12 is essentially the same as the other three, just with one more
decimal point, so it gives the same result for fewer bits. This is now
also aliased to the former three.

Also make videoconvert do passthrough if the caps have equivalent
transfer functions but are otherwise matching.

As of the previous commit, we write the correct transfer function for
BT601, instead of the (functionally identical but different ISO code)
transfer function for BT709. Files created using GStreamer prior to that
commit write the wrong transfer function for BT601 and are, strictly
speaking, 2:4:5:4 instead. However, this commit takes care of
negotiation, so that conversions from/to the same transfer function are
done using the fast path.

Fixes #783

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/724>
2020-07-03 11:57:49 +03:00
Vivia Nikolaidou
1d0ccf8baa video-color: Add bt601 transfer function
Functionally the same as 709 but technically has a different value, and
external software (e.g. ffmpeg) finds "wrong" values produced by
GStreamer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/724>
2020-07-03 11:57:49 +03:00
Jan Alexander Steffens (heftig)
7570d20871 video-anc: Fix gst_buffer_get_video_(afd|bar)_meta
The macros were not passing the meta GType to gst_buffer_get_meta,
rendering them unusable.

Also, the doc comments were specifying parameters meant for the
add_video_X_meta functions.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/732>
2020-07-01 19:40:28 +00:00
Havard Graff
0826fb95b7 audio: video: Optimize by using cached quark for meta tag
Avoid taking the global quark lock for every single buffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/295>
2020-06-27 09:23:10 +00:00
Seungha Yang
946e00f581 videometa: Fix documentation
Fix gst_video_region_of_interest_meta_add_params to
gst_video_region_of_interest_meta_add_param and add newline to be
more readable.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/722>
2020-06-24 02:02:50 +09:00
Haakon Sporsheim
226a371e3f videodecoder: Add max-errors property
The number of consecutive decode errors that should be tolerated before
returning flow error should be up to the application, not the element.

Hence max-error should be exposed as a property.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/720>
2020-06-23 07:17:00 +00:00
Aaron Boxer
b813c40788 video: allow frame copy where destination dimensions are smaller than source
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/695>
2020-06-15 09:46:17 -04:00
Jan Schmidt
205bb066ed video-converter: Add checks for configuration sanity.
If the cropping or scaling input or output rects put us completely
outside the input/output frame respectively, we can't draw anything
except black safely. Check for those conditions and don't set up a
configuration that attempts to access out of bounds memory outside
the input/output framebuffers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/696>
2020-06-12 06:49:56 +00:00
Jan Schmidt
bf5d51c5da video-converter: Guard against invalid frame input
If the frames passed in to gst_video_converter_frame()
have a different layout than was configured for, the
conversion code might go out of bounds and crash.

Do a sanity check on each frame passed in, and in the
absence of a return value in the API, just
refuse the conversion in invalid cases and leave the
destination frame untouched so it's obvious to
users that it was broken.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/696>
2020-06-12 06:49:56 +00:00
Mathieu Duponchelle
a90968997a videooverlay: chevrons don't need to be escaped in code examples
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/700>
2020-06-11 22:19:09 +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
Sebastian Dröge
76364ebfe7 videoencoder: Also don't request a new key-unit if we already got one after the requested running time
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/684>
2020-06-05 10:04:43 +00:00
Sebastian Dröge
19fecabdf7 videoencoder: Don't request another keyunit if another one is pending or we requested one for a future time already
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/684>
2020-06-05 10:04:43 +00:00
Sebastian Dröge
c5b081edc2 videoencoder: Add min-force-key-unit-interval property
This allows configuring the minimum interval between subsequent
force-key-unit requests and prevents a big bitrate increase if a lot of
key-units are requested.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/684>
2020-06-05 10:04:43 +00:00
Sebastian Dröge
6260c4be7e videoencoder: When pushing headers as part of a keyframe mark the first header as keyframe
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/684>
2020-06-05 10:04:43 +00:00
Sebastian Dröge
401d56a6a7 videoencoder: Handle all matching force-keyunit events at once
Previously we only handled one event at a time, which could lead to the
following two suboptimal situations:
- frame 0 at 20ms, frame 1 at 40ms and two force-keyunit events at 10ms
  and 15ms. We would create a new keyframe for both of the frames.
- 100 force-keyunit events with running-time NONE would cause all
  following 100 frames to be made into a keyframe.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/684>
2020-06-05 10:04:43 +00:00
Sebastian Dröge
9b1f1f431a videoencoder: Sort force-keyunit-events by their running time
That way we can more easily work with the whole list without iterating
over all of the elements.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/684>
2020-06-05 10:04:43 +00:00
Stéphane Cerveau
42dcbcd61f video-hdr: fix memset warning
Fix warning on fedora arm64 target

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/685>
2020-06-05 08:13:32 +00:00
Nicolas Dufresne
8e3c4a5d5a video: Fix NV12_64Z32 number of component
This format has 3 components, just like NV12.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/686>
2020-06-04 20:12:59 +00:00
Thibault Saunier
c2610d7f41 doc: Add a minimal GstVideoMultiviewFlagsSet documentation 2020-06-03 22:44:24 -04:00
Sebastian Dröge
fb7ab33e03 videoencoder: Simplify header buffer metadata updating
Instead of doing a shallow copy of the list just to call make_writable()
on each buffer, do that inline in the same loop and modify the list
contents.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/683>
2020-06-03 16:21:41 +03:00
Sebastian Dröge
caaa5ac864 video: Use GQueue instead of plain GList in a few places
Also not optimal but at least simplifies the code a bit and doesn't
require g_list_length() and g_list_append() in a few places.

For 2.0 there are some more candidates to change but unfortunately
they're currently part of the API.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/683>
2020-06-03 16:21:41 +03:00
Sebastian Dröge
4fcc1121e6 video-format: RGB16/15 are not 16 bit per component but only 5.333 and 5
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/682>
2020-06-02 14:38:55 +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
Stéphane Cerveau
c7a956aede video-anc: init type before g_once_init_enter
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/675>
2020-05-27 17:13:35 +02:00
Stéphane Cerveau
be3745cb92 video-hdr: fix typo
fix typo in video_hdr_ascii_string_to_unsigned
method name.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/675>
2020-05-27 16:04:29 +02:00
Sebastian Dröge
637bbac622 videoaggregator: Don't crash when setting pad properties after the aggregator was finalized
The application might still have a strong reference to a pad and change
properties, which should work without crashing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/649>
2020-05-01 10:41:29 +00:00
Sebastian Dröge
380dffb0d0 Add missing colons to Since markers in the docs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/648>
2020-05-01 10:08:40 +03:00
Philippe Normand
ed910e6cb8 navigation: Add since tag for new API
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/647>
2020-04-30 18:00:19 +01:00
Sebastian Dröge
98bb7d0c2e video-anc: Register an init function for Bar meta
The init function is mandatory and we keep around uninitialized memory
otherwise.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/747
2020-04-19 18:29:18 +03:00
Jan Schmidt
5b720702cf video-hdr: Fix a docs typo (x -> y) 2020-04-02 23:30:57 +11:00
Jan Schmidt
8cb14728a7 videodecoder: Handle instant-rate-change event
When receiving an instant-rate-change event, store the updated
seek flags and replace the flags in any input segments with them
to allow for instant switching between trickmodes and not.
2020-04-01 21:01:38 +00:00
Stéphane Cerveau
ac6b805827 videoencoder: subclass 'set_format' should be optional
Aligns documentation with the code to make the subclass
'set_format' call optional.
2020-04-01 17:47:04 +02:00
Seungha Yang
1dee0f05a7 video-hdr: Rework for GstVideoMasteringDisplayInfo and GstVideoContentLightLevel struct
This commit modifies GstVideoMasteringDisplayInfo and GstVideoContentLightLevel
structs so that each value is to be more like hdr_metadata_infoframe struct
of linux drm header and DXGI_HDR_METADATA_HDR10 struct of Windows.
So each value is no more fraction but normalized one as per CTA 861.G spec.
Also the unit of each value will be consistent with H.264, H.265
specifications, hdr_metadata_infoframe struct for linux and
DXGI_HDR_METADATA_HDR10 struct for Windows.
2020-04-01 11:11:15 +00:00
Matthew Waters
476eaf9425 videoaggregator: fix gir warning about invalid doc comment
[38/1301] Generating GstVideo-1.0.gir with a custom command.
../subprojects/gst-plugins-base/gst-libs/gst/video/gstvideoaggregator.c:231: Error: GstVideo: identifier not found on the first line:
   *
    ^
2020-04-01 20:05:06 +11:00
Mathieu Duponchelle
fb1c284026 gstvideoaggregator: expose max-last-buffer-repeat property on pads
This can be used to have compositor display either the background
or a stream on a lower zorder after a live input stream freezes
for a certain amount of time, for example because of network
issues.
2020-03-31 18:24:45 +02: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
Sebastian Dröge
0e74e190ad video-blend: Add support for blending on top of 16 bit per component formats
With this we can support every currently supported video format for
blending.
2020-03-27 08:55:45 +00:00
Víctor Manuel Jáquez Leal
8211370281 videodecoder: fix documentation
Fix list indentation, othewise it is interpreted as verbatim.
2020-03-21 14:15:51 +01:00
Niels De Graef
cafb2cfc4d navigation: Use G_DEFINE_INTERFACE 2020-03-20 06:20:43 +00:00
Philippe Normand
7240cad9c5 navigation: Mouse scroll events support
This patch introduces a new API to send and parse mouse scroll events. Mouse
event coordinates are sent relative to the display space of the related output
area. This is usually the size in pixels of the window associated with the
element implementing the GstNavigation interface.
2020-03-19 09:59:47 +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
Niels De Graef
ec84cf92f9 *aggregator: Add g_autoptr support for *ConvertPad 2020-03-16 15:47:58 +00:00
Matthew Waters
a777fe2628 videometa: constify tc argument to add_video_time_meta()
We don't modify the argument.
2020-03-16 15:34:02 +11:00
Guillaume Desmottes
a12f161724 video-info: fix typo in doc 2020-02-26 16:15:59 +00:00
Guillaume Desmottes
ea2619aadc video: fix GST_VIDEO_FRAME_IS_BOTTOM_FIELD()
GST_VIDEO_FRAME_FLAG_BOTTOM_FIELD is a subset of
GST_VIDEO_FRAME_FLAG_TOP_FIELD so needs to be checked accordingly.

Fix #726
2020-02-26 16:15:59 +00:00
Guillaume Desmottes
26f386ce8b video: add macros checking for GST_VIDEO_BUFFER_FLAG_TOP/BOTTOM_FIELD flags
The GST_VIDEO_BUFFER_FLAG_TOP_FIELD flag is a superset of
GST_VIDEO_BUFFER_FLAG_BOTTOM_FIELD as they are defined using other
flags. As a result we can't use GST_BUFFER_FLAG_IS_SET() to check for
those flags.
2020-02-26 16:15:59 +00:00
Stéphane Cerveau
19f27f94ee videoencoder: protect the use of num_subframes
change stream lock location to protect the use of
frame->abidata.ABI.num_subframes
2020-02-24 20:37:38 +00:00
Devarsh Thakkar
8df947df5d videoencoder: Release stream lock in finish_subframe before pad_push
Derived from 780d635dadc0723e39a8ba90cfe0903a2de346fd for
https://bugzilla.gnome.org/show_bug.cgi?id=715192
which was for finish_frame.
2020-02-24 20:37:38 +00:00
Mathieu Duponchelle
54cc985810 videoaggregator: handle gap buffers properly
This simply implies not trying to "prepare" those buffers,
as mapping an empty buffer to a video frame does not make
much sense.

This also adds a simple test in compositor that performs
some trivial checking of the handling of gap events, the test
was not failing before, but an error was logged, this is
no longer the case.

Fixes #717
2020-01-30 19:02:44 +01:00
Sebastian Dröge
72cb0c0641 videoaggregator: Don't configure NULL chroma-site/colorimetry
If there's no known value in the best caps then the functions to convert
them to strings will return NULL. Having the fields not in the caps is
not a problem, having them with a NULL value however will cause
negotiation failures.
2020-01-28 22:07:44 +02:00
Ryan Huang
c7a9a966b0 Fix link to raw video format design document 2020-01-02 23:37:21 +00:00
Mathieu Duponchelle
64d2e6b70d gstvideoaggregator: always update converter when needed
In prepare_frame, it is not enough for the target info
(conversion_info) to not have changed to decide not to update
the converter, as the vpad info may have changed as well.

Fixes #714
2019-12-27 11:57:22 +00:00
Stéphane Cerveau
6cfdeb7423 videoencoder: send new headers in finish_frame
If headers have been set by subclass, this headers should be sent
for a first time or on demand with a key-unit
2019-12-21 02:59:14 +00:00
Stéphane Cerveau
7013a58874 videoencoder: Use video marker flag to signal end of frame
This marker is optional, its name refer to RTP marker bit. This mark can
be use to reduce latency in various use cases. With the split between
finish_frame() and finish_subframe() we will now be able to identitfy
the last subframe with no latency.

In order to detail the use of GST_BUFFER_FLAG_MARKER in a video
use case, the flag GST_VIDEO_BUFFER_FLAG_MARKER has been introduced
with a proper documentation clarifying marker's role.
2019-12-21 02:59:14 +00:00
Guillaume Desmottes
3e32896912 videoencoder: add API to push subframes
Introduce a new API so encoders can split the encoding in subframes.
This can be useful to reduce the overall latency as we no longer need to
wait for the full frame to be encoded to start decoding or sending it.
2019-12-21 02:59:14 +00:00
Guillaume Desmottes
789803fd6d videoencoder: factor out logic from gst_video_encoder_finish_frame()
No semantic change, I'm going to reuse all those functions in a new
finish_slice() methods.
2019-12-21 02:59:14 +00:00
Olivier Crête
6b283d9e78 Revert "videoencoder: factor out logic from gst_video_encoder_finish_frame()"
This reverts commit b1ec312b8e.
2019-12-19 17:52:12 -05:00
Stéphane Cerveau
b1ec312b8e videoencoder: factor out logic from gst_video_encoder_finish_frame()
No semantic change, I'm going to reuse all those functions in a new
finish_slice() methods.
2019-12-19 21:59:10 +00:00
Mart Raudsepp
65f2bb8fa2 videoaggregator: don't let a repeat-after-eos pad prevent EOS
.. if there are pads present that are not repeating after EOS.

Fixes #664
2019-11-27 22:21:14 +02:00
Edward Hervey
df35256dad video-converter: Fix RGB-XYZ-RGB conversion
The matrices were in the wrong order.
Instead of the conversion matrix being
  _ XYZ_TO_RGB_output * RGB_TO_XYZ_input * input_RGB
It was
  _ RGB_TO_XYZ_input * XYZ_TO_RGB_output * input_RGB
2019-11-21 13:46:38 +00:00
Guillaume Desmottes
8a3d901d8f video-info: improve GST_CAPS_FEATURE_FORMAT_INTERLACED documentation
Copied the description from gst-doc written by Tim.

Fix #606
2019-11-15 04:19:20 +00:00
Guillaume Desmottes
e5c9a921ad videometa: document how the meta can be used to negotiate buffers layout
I'm going to use this new API in gst-omx so an encoder can request
v4l2src to produce buffers matching the encoder stride and slice heights
preventing copies of incoming buffers.
2019-11-04 12:59:31 +00:00
Sebastian Dröge
166f979761 video-scaler: Ensure we're always using the correct lines for scaling in gst_video_scaler_2d()
Especially for interlaced input make sure to
  a) never mix both fields
  b) never read lines after the end of the input frame
  c) allocate enough space in the temporary lines to not write outside
     the allocated memory area

This fixes various memory corruptions and rescaling artefacts.
2019-11-03 10:46:43 +01:00
Nicolas Dufresne
1174e37b80 videodecoder: Add a property to disable dropping on QoS 2019-11-02 14:36:01 +00:00
Nicolas Dufresne
1570314609 videodecoder: Post QoS when we drop because of QoS
At the moment, we only posted QoS messages when frame_drop() was
called, but not in finish_frame() when QoS triggered a late push.
This should fix applications that tries to account the dropped
frames. We also emit a warning on drops so it's more clear what is
happening.
2019-11-02 14:36:01 +00:00
Guillaume Desmottes
75680e5d34 videometa: add alignment field
By adding this field, buffer producers can now explicitly set the exact
geometry of planes, allowing users to easily know the padded size and
height of each plane.

GstVideoMeta is always heap allocated by GStreamer itself so we can
safely extend it.
2019-11-02 13:05:43 +01:00
Guillaume Desmottes
36ce08826e video-info: add gst_video_info_align_full()
When using gst_video_info_align() user had no easy way to retrieve the
padded size and height of each plane.
This can easily be implemented in fill_planes() as it's already called
in align() with the padded height.

Ideally we'd add a plane_size field to GstVideoInfo but the remaining
padding is too small so that would be an ABI break.

Fix #618
2019-11-02 13:05:43 +01:00
Guillaume Desmottes
73a628923e video-info: fix GST_VIDEO_INFO_FIELD_HEIGHT() with frame odd height
We want to round up when halfing height.

I do have a test for this but it relies on my new video-align tests so
it's part of the next commit. Recording the fix separately if we want to
backport this fix to the stable branch.
2019-11-02 13:05:43 +01:00
Sebastian Dröge
2bc1b38825 video-converter: Use G_N_ELEMENTS instead of writing it out manually 2019-10-22 09:50:27 +03:00
Sebastian Dröge
bcc1d666ec video-converter: Scaling-only fast-paths for planar formats are keeping interlacing
So we can also use them for interlaced content and speed up scaling a
bit.
2019-10-22 09:50:27 +03:00
Sebastian Dröge
c9f132986c video-scaler: Correctly handle interlaced vertical scalers in gst_video_scaler_2d()
We need to provide twice as many lines as usual to the scaling function
as every second lines would be skipped.

Without this we read from random memory and produce colorful output and
crashes.
2019-10-22 09:50:27 +03:00
Sebastian Dröge
255beae3ec video-converter: Don't use fast-path halfing/doubling rescalers for interlaced planar formats
They will mix lines from the top and bottom field and by that
effectively deinterlace the video, badly.
2019-10-22 09:49:43 +03:00
Sebastian Dröge
565b797f57 video-converter: Use interlaced scalers for vertical scaling if needed
Without this, scaling e.g. interlaced UYVY causes corrupted output with
lines as follows: f1 f1 f2 f2, i.e. two lines of each field and only
then the other field.
2019-10-22 09:49:18 +03:00
Tim-Philipp Müller
289d8e53e2 Remove autotools build system 2019-10-13 14:15:43 +01:00
Haihao Xiang
606ab04cd6 video-format: correct the pixel stride for Y410
The stride for Y410 is 4 bytes, not 0 byte
2019-09-30 14:26:14 +00:00
Thibault Saunier
909baa2360 Pass the code through codespell 2019-08-30 13:05:36 +00:00
Mathieu Duponchelle
4ccc7a51d1 {audio,video}aggregator: define autoptr cleanup functions 2019-08-28 14:52:22 +00:00
Seungha Yang
0bfb862329 video-hdr: Update documentation
* Fix typo
s/nunormalized/normalized/g

* Update GstVideoMasteringDisplayInfo description
Each values are not array.

* Add missing newline between arguments description and
detailed comment.
2019-08-20 21:16:24 +09:00
Sebastian Dröge
8478aa7aed video-frame: Take TFF flag from the video info if it was set in there
The caps and thus the video info have preference. If the field order is
set in there then it applies to all frames.

This works around issues where the tff field order is only set in the
caps but not additionally in the buffer flags.
2019-08-16 09:00:28 +00:00
Seungha Yang
8936886192 video-hdr: Fix document typo
Fix missing document update. GstVideoContentLightMeta was changed to
GstVideoContentLightLevel during code review.
2019-08-12 22:47:33 +09:00
Tim-Philipp Müller
81dd81b739 video-color: keep UNKNOWN colorimetry define automatically up-to-date
Follow-up to !310 and helps with backport commits like !360
2019-08-11 14:16:51 +01:00