Commit graph

7842 commits

Author SHA1 Message Date
Matthew Waters
1516275413 gl/build: use the brcm GL libraries on the rpi
Upstream RPi has moved to a completely separate GL library names now due
to conflicts.

See https://github.com/RPi-Distro/repo/issues/134

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/898>
2020-10-28 19:18:10 +00:00
Tobias Ronge
e2a1aa44df fdmemory: Allow for change of protection mode
After a memory has been unmapped, protection mode can now be changed
when mapping it again.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/895>
2020-10-28 17:11:05 +00:00
Mathieu Duponchelle
eb216e3865 videoaggregator: document and fix locking in convert pad
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/897>
2020-10-28 15:59:14 +00:00
Xavier Claessens
a28a75652e Meson: Use pkg-config generator 2020-10-23 11:19:11 -04:00
Michael Tretter
c9d15fec7e glslstage: delete shader on finalize of stage
GLSLstage creates the glShader using glCreateShader, but never calls
glDeleteShader if the glShader is not used anymore. This forces the GL
library to keep the compiled shader around, because it might be used in
the future. Therefore, the glShader is leaked whenever a GLSLStage is
destroyed.

Fix the leak by deleting the glShader when finishing the GLSLStage.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/886>
2020-10-21 15:28:09 +02:00
Sebastian Dröge
6af87dee17 audio/videodecoder: Initialize max_errors in instance_init()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/882>
2020-10-20 12:46:07 +03:00
Sebastian Dröge
ed62e78c6e audio/videodecoder: Don't reset max-errors in reset()
Otherwise setting the property on the elements has no effect at all
because it's immediately reset during startup.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/881>
2020-10-20 11:52:07 +03:00
Sebastian Dröge
825eea9545 Add some missing nullable annotations
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/876>
2020-10-17 15:30:02 +00:00
Stéphane Cerveau
967e650937 meson: update glib minimum version to 2.56
In order to support the symbol g_enum_to_string in various
project using GStreamer ( gst-validate etc.), the glib minimum
version should be 2.56.0.

Remove compat code as glib requirement
is now > 2.56

Version used by Ubuntu 18.04 LTS

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/874>
2020-10-15 18:20:37 +02:00
Jan Alexander Steffens (heftig)
23189c60f4 videoaggregator: Limit accepted caps by template caps
This seems like an obvious mistake, since `modified_caps` was created
but not used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/868>
2020-10-13 15:41:38 +02:00
Jan Alexander Steffens (heftig)
77c327f356 videoaggregator: Log the format name instead of index
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/868>
2020-10-13 15:41:37 +02:00
Will Miller
ac72a6adaa gstrtpbuffer: fix header extension length validation
We validate the header extensions length of an RTP buffer by comparing
it against the block size. Since we multiply the length in words by 4 to
get the length in bytes, a suitably large length could cause a wrapround
of the uint16, giving a lower length which erroneously passes the check
and allows the buffer to be mapped.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/864>
2020-10-12 15:01:22 +01:00
Marijn Suijten
57a23786f3 gl: glslstage: Sync new_default_{fragment,vertex} documentation name
Documentation for the parameter and return value don't show up when
this header mismatches the function it tries to describe.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/814>
2020-10-12 07:20:15 +00:00
Mathieu Duponchelle
11f12e49eb rtsptransport: support single port for client_port and server_port
This is explicitly specified as valid in the RFC, where the
syntax for both parameters is:

";" "client_port" "=" port [ "-" port ]
";" "server_port" "=" port [ "-" port ]

This is useful for applications where RTCP is either not necessary
or not possible.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/846>
2020-10-09 23:43:33 +02:00
Guillaume Desmottes
44b1fb03fc video-info: clarify GST_VIDEO_INTERLACE_MODE_ALTERNATE doc
Fields really should alternate in this mode.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/852>
2020-10-09 12:02:14 +02:00
Guillaume Desmottes
a3a2992bc8 videodecoder: fix output state interlace-mode
When user is passing the actual interlace-mode when calling
gst_video_decoder_set_interlaced_output_state() it should not be
overidden by the input interlace-mode.

Needed to fix #825 as we want to keep interlace-mode=interleaved from
parsers and have the OMX decoder producing interlace-mode=alternate.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/852>
2020-10-09 11:04:30 +02:00
Guillaume Desmottes
a19a27a4ca videodecoder: add interlace-mode to debug output when setting output state
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/852>
2020-10-09 11:04:30 +02:00
Jan Alexander Steffens (heftig)
aa89ae8beb audio: video: Fix in/outbuf confusion of transform_meta
There are three instances where in- and outbuf have been swapped. This
didn't affect the correctness of the libs *filter code, but the
videoscale implementation swapped the arguments of meta->transform_func.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/853>
2020-10-08 18:30:39 +02:00
Xavier Claessens
d867cacf86 meson: Add GL summary
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/836>
2020-09-27 16:54:44 +00:00
Marijn Suijten
d0f36c7e13 video: Rename video_color_transfer to video_transfer_function
Rename remaining `gst_video_color_transfer_{encode,decode}` functions on
the `GstVideoTransferFunction` enumeration to
`gst_video_transfer_function_{encode,decode}` permitting
gobject-introspection to turn these into associated functions and place
them under the respective `<enumeration>` block in gir XML files.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/805>
2020-09-12 09:46:44 +03:00
Matthew Waters
b4ea8332f5 videoaggregator: ensure peek_next_sample() uses the correct caps
gst_pad_get_current_caps() may be wrong when there is a renegotiation in
progress for the pad and we have not yet received or selected the buffer
with different caps yet.

Fix by storing the caps through in a similar way to the existing code
for buffer/video-info selection machinery.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/813>
2020-09-11 22:08:30 +10:00
Stian Selnes
eaedb5c2de videodecoder: Bump log level of marking a sync point
Sync points are often important when debugging and deserves DEBUG
level.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/730>
2020-09-10 20:31:10 +02:00
Sebastian Dröge
d26eede464 videodecoder: Add API for subclasses to request a new sync point
This allows subclasses that notice missing reference frames to request a
new sync point to allow seamless decoding again. While doing so the
subclass can also signal whether it wants a) all following input frames
until the sync point to be discarded or b) all output frames until the
sync point to be marked as corrupt.

Sending of force-keyunit events for this can be throttled by the
application via the "min-force-keyunit-interval" property.

This replaces custom behaviour for the same in various decoders, for
example openh264dec.

Based on patches by Haakon Sporsheim <haakon@pexip.com> and
Stian Selnes <stian@pexip.com>.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/730>
2020-09-10 20:31:10 +02:00
Sebastian Dröge
fdf79a786c videodecoder: Add API for subclasses to signal that they need the stream to start with a sync point
If the first frame(s) at the very beginning or after a flush are not a
sync point then the base class would discard them before passing them to
the subclass.

This also fixes the previously broken distance_from_sync handling: it
was never reset at sync points.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/730>
2020-09-10 17:22:14 +00:00
Sebastian Dröge
1afb145dc5 videodecoder: Add "discard-corrupted-frames" property
This can be used by applications to configure decoders so that corrupted
frames are directly discarded instead of being forwarded inside the
pipeline. It is a replacement for the "output-corrupt" property of the
ffmpeg decoders.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/730>
2020-09-10 17:22:14 +00:00
Sebastian Dröge
06bcf95ebf videodecoder: Add API for marking output frames as corrupted
This can be used by subclasses to mark output frames as known to be
corrupted, for example if reference frames were missing. ffmpeg's
decoders can signal this.

In addition this flag is propagated downstream if the input frame had it
set.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/730>
2020-09-10 17:22:14 +00:00
Sebastian Dröge
74889206eb videodecoder: Remove unused reorder_depth variable
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/730>
2020-09-10 17:22:14 +00:00
Mikhail Fludkov
d6a2569136 rtpbasedepayload: Mark GAP events sent because of packet loss as such
This allows downstream to distinguish packet loss from normal GAP events
that are sent simply because of gaps in the timeline.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/731>
2020-09-10 16:33:16 +00:00
Nirbheek Chauhan
e77bea4968 meson: Actually build gstgl without implicit include dirs
Fixes a typo from https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/800

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/810>
2020-09-10 19:58:32 +05:30
Haihao Xiang
9ccc3dbd6f gl: add support for GBR and GBRA
example pipeline:
gst-launch-1.0 videotestsrc ! video/x-raw,format=GBR ! glimagesink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/789>
2020-09-09 12:04:52 +00:00
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
1208d4e635 audioaggregator: Reset offset if the output rate is renegotiated
On next aggregation the new offset will be calculated based on the
segment position.

Without this a rate change would cause a jump forwards or backwards in
the output timeline.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/794>
2020-09-09 09:09:17 +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
d2a0b38717 appsrc: Wake up the create() function on caps changes
This allows the new caps to be sent downstream as soon as possible
instead of having to wait for the next buffer/buffer list.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/798>
2020-09-09 06:45:49 +00:00
Mathieu Duponchelle
7563a68ec8 rtpbasepayload: do not forget delayed segment when forwarding gaps
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/797>
2020-09-08 23:01:46 +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
Matthew Waters
1cc18ec186 gl/build: build with implicit_include_directories : false
Fixes case-insensitive file systems confusing gst-libs/gst/gl/egl/egl.h
with EGL/egl.h when the source directory gst-libs/gst/gl is automatically
added to the compiler's search path.

Due to https://github.com/mesonbuild/meson/issues/7582 we also need to
perform manual enumtype generation.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/814
2020-08-27 00:08:08 +00:00
Marcin Kolny
d74b9f56fc encoding-profile: minor fix in documentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/212>
2020-08-25 07:29:33 +00:00
Mathieu Duponchelle
1ce61b1b08 tags: update to latest iso-code and support more languages
Some languages have an ISO 639-2 representation but no 639-1
representation, for example where "eng" has a two-letter
equivalent in "en", "enm" doesn't have one.

Discarding those languages from our static table caused functions
such as gst_tag_get_language_code_iso_639_2T() or
gst_tag_get_language_code_iso_639_2B() to return NULL for
valid language codes such as "enm", potentially causing users
of these API such as mpegtsmux to discard language code tags
as invalid.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/785>
2020-08-12 17:59:58 +00:00
Nicolas Dufresne
6500a76bfb pbutils: Add latest H.264 level values
The spec now list 6, 6.1 and 6.2.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/786>
2020-08-11 17:15:50 -04:00
Jan Schmidt
b18fd0f239 appsrc: Post a bus error if a segment can't be applied
When applying segments from the input samples, post a bus
error and fail loudly if the segment fails to configure, instead of
just posting debug output.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/783>
2020-08-11 07:35:56 +00:00
Matthew Waters
42b3025bdc build/gl: add top-level include files for sub-libraries
Makes gir happy

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/809
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/784>
2020-08-11 07:11:30 +00:00
Sebastian Dröge
6b14080941 audioaggregator: Add support for new sample selection API
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/805

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/780>
2020-08-07 19:23:50 +03: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
Guillaume Desmottes
dd5f7f1bf9 gl: move each gl platform specific API to its own gir
With contributions from:
Thibault Saunier <tsaunier@igalia.com>
Matthew Waters <matthew@centricular.com>

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/651

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/661>
2020-08-06 04:09:09 +00:00
Guillaume Desmottes
9339f0198c gl: egl: add missing gir annotations
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/661>
2020-08-06 04:09:09 +00: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
Thibault Saunier
718122a9bf encoding: Support more topologies in profile_from_discoverer()
Previous implementation was only working when the stream was inside a
container, this refactoring allows using virtually any stream as input.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/766>
2020-07-31 00:15:58 +00:00
Seungha Yang
c2b9be5c94 glwindow/winrt: Increase timeout value to 15 seconds
5 seconds might not be enough value for timeout in case an application
is running on a device with very limited computing power.
Note that ANGLE uses 10 seconds timeout value. So even if a timeout
happens here, it's also ANGLE's timeout condition as well
(meaning that bad things will happen either way)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/769>
2020-07-30 21:05:54 +09:00
Sebastian Dröge
f5a02639e1 audioaggregator: Only check downstream caps when handling CAPS events if we didn't negotiate with downstream yet
If we already negotiated with downstream there is not point in checking
if the caps are supported. We already know that this is the case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/768>
2020-07-28 10:59:25 +03:00
Sebastian Dröge
607dc1d135 audioaggregator: Check all downstream allowed caps structures if they support the upstream rate
Otherwise it might happen that downstream prefers a different rate (i.e.
puts it into the first structure) and also supports other rates, but
audioaggregator would then fail negotiation.

Also this now correctly handles downstream returning a range of
supported rates.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/795

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/768>
2020-07-27 18:49:48 +03:00
Thibault Saunier
1cead20777 encodebin: Fix and refactor smart encoding
It was not working properly and the implementation of the smartencoder
element was weird. This introduce a number of changes (which are all
in one single commit because they basically all work together and lead
to basically reimplementing the element):

* Make smartencoder a bin so that the reencoding chain of elements are
  inside of it instead of not having any parent. Those elements were not
  be visible when dumping the pipeline which was very confusing.
* Make encodebin create the right encoder with a capsfilter (and parser)
  to properly enforce the format specified by the user, and so that the
  encoder properties specified in the encoding profile are respected.
* Use `decodebin` to do the decoding instead of selecting a decoder
  ourself and not plug any parser etc...
* Ensure that negotiated format in the sinkpad of smart encoder is fixed
  through time when the user requested a non dynamic output
* Add a parser at the beginning of the smart encoder
* Handle errors when reencoding

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/751>
2020-07-22 16:01:25 +00:00
Matthew Waters
a1e9f4e37b rtpbasepayload: place twcc-ext-id behind environment variable
Adding properties for each and every rtp header extension is not
scalable and a new interface will be implemented for the general case
(https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/777).

Set the environment variable "GST_RTP_ENABLE_EXPERIMENTAL_TWCC_PROPERTY"
to any value to reenable the short-lived twcc-ext-id property.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/761

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/756>
2020-07-21 11:57:55 +00:00
Matthew Waters
e762f1b376 Revert "gstgldisplay: Add public foreign_display property"
This introduced a possible regression where the EGL display connection
could be leaked when a foreign native display (x11, wayland, etc) could
create a non-foreign EGL display that would never be destroyed.

The underlying problem needed to be solved in a different way.  See
https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/640
for more details.

This reverts commit 2e686b0dad.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/758>
2020-07-20 05:59:14 +00:00
Silvio Lazzeretti
aa4bea913b audioutilsprivate: restore thread priority before ending
The priority of the thread that executes audioringbuffer_thread_func
is incremented on Windows by the usage of the AvSetMmThreadCharacteristics
API. This change has to be restored, as described on the documentation
of the API (https://docs.microsoft.com/en-us/windows/win32/api/avrt/nf-avrt-avsetmmthreadcharacteristicsw#remarks),
with a call to the AvRevertMmThreadCharacteristics. If this is not done,
a handle will be leaked.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/760>
2020-07-18 13:00:00 +02:00
Seungha Yang
f0a9907097 audioutilsprivate: Don't try to load avrt for UWP application
All APIs in avrt.h are desktop only.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/763>
2020-07-17 18:55:31 +09:00
Matthew Waters
26a88fdb7a build/gl: remove unused cocoa/win32 header variables
We don't install any cocoa/win32 specific headers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/759>
2020-07-16 08:12:53 +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
Santiago Carot-Nemesio
93cb325fa1 rtcpbuffer: Notify error in case packet can not be added to an RTCP compound packet
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/476>
2020-07-10 14:16:10 +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
Seungha Yang
579db691ed glwindow/winrt: Add warning message if window is being closed from a UI thread
All UI elements will follow Single-Threaded Apartments (STA) model.
As a result, we should access them from dedicated UI thread.
Due to the nature of the threading model, ANGLE will wait the UI
thread while closing internal window/swapchain objects.

A problem here is that when destroying GstGLWindow from the UI thread,
it will wait GstGLContext's internal thread. Meanwhile, the GstGLContext's
internal thread will be blocked because ANGLE wants to access the UI thread.
That will cause a deadlock or exceptions.

In short, application should not try to call
gst_element_set_state(pipeline, GST_STATE_NULL) from a UI thread.
That's a limitation of current implementation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/745>
2020-07-10 11:46:56 +00:00
Seungha Yang
bdf73569f8 glwindow/winrt: Add window resize event handler
GstGLWindow implmentaion should be able to report native window size
and also it need to handle resize event for glimagesink.

Note that GstD3D11Window implementation was referenced for this change.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/745>
2020-07-10 11:46:56 +00:00
Seungha Yang
ab89746f55 glwindow/winrt: Move to c++
For native window size query, c++ API is much convenient than c API

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/745>
2020-07-10 11:46:56 +00:00
Seungha Yang
061e195e01 appsrc: Fix annotations
Don't put double ':' there

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/663>
2020-07-10 07:52:53 +00:00
Seungha Yang
64e768e836 appsrc: Add support for custom GstSegment
Add property "handle-segment-change" for user to allow pushing
custom segment event. For now, this property can work only for
time format GstSegment.
This property can be useful in case application controls timeline
of stream such as there is timestamp discontinuity but playback is
expected to be continuous. Multi-period scenario of MPEG-DASH is an
example of this use case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/663>
2020-07-10 07:52:53 +00:00
Thibault Saunier
9412e61150 pbutils: Do not restrict number of similar profiles in a container
We have the notion of presence, and when the user want to be in control
it is totally legitimate for him to have several occurrences of a
similar profile

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/746>
2020-07-09 21:59:54 +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
Sebastian Dröge
f94c7ae3c9 audioaggregator: Fix negotiation with downstream if there is no peer yet
get_allowed_caps() will return NULL, which is not a problem in itself.
Just take the template caps for negotiation in that case instead of
erroring out.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/744>
2020-07-09 16:48:02 +00:00
Seungha Yang
55f10f31d4 glwindow/win32: Fix possible deadlock around key/mouse event handling
Calling gst_gl_window_send_{key,mouse}_event() from GstGLContext
thread might cause a deadlock. Instead, use the dedicated event handling
thread in GstGLDisplay.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/721>
2020-07-08 13:41:07 +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
Havard Graff
5464d420f9 rtpbasedepayload: improve logging around negative gaps
When warning, it is important that the log will contain information to
help debug the problem. Sequence-numbers are crucial here.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/725>
2020-06-26 17:16:33 +00:00
Ayush Mittal
8aa29ada7f Added the path property in encoding-target
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/714>
2020-06-26 19:57:06 +05:30
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
Sebastian Dröge
63933da9e8 audiodecoder: 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
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
Seungha Yang
220f2dd3c7 glwindow/win32: Chain up mouse event to parent window
Fix a regression of the commit 940c9998e5

Unlike key event, mouse event will not be chained up to parent window
by DefWindowProc

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/718>
2020-06-22 18:34:49 +00:00
Sebastian Dröge
f2af205a78 Fix up and add various "Since" markers and other related docs fixes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/713>
2020-06-19 12:17:55 +03:00
Guillaume Desmottes
870d630481 sdp: fix gst_sdp_message_new_from_text() doc
Arguments were in the wrong order in the doc.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/711>
2020-06-18 11:42:10 +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
David Bender
b4bdb75a80 gstglwindow_x11: fix resize
This patch was taken from #629#note_178766, the comment made
at the time was:

The root issue is a mismatch between the initialization of render_rect
in GstGLWindowX11Private and what's expected in the draw_cb function.
Because render_rect is not explicitly initialized to a width and height
of -1 (unlike gstglwindow_wayland_egl.c which does initialize to -1),
the less-than check for explicitly-set render_rect at gstglwindow_x11.c:453-454
always fails, even when the parent_win has been set and the render rectangle
has never been set.

Maybe this came from copying the similar check in the wayland code? Regardless,
I think the correct inequality should be '<= 0' (on both lines).

Alternatively initialization could be changed, but other sinks, e.g.
xvimagesink don't appear to use -1 to mean "unset" render_rect this way.

The issue can be reproduced by running the example in
tests/examples/gl/qt/videooverlay/ on X11, and resizing the output
window

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/701>
2020-06-12 01:36:22 +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
008d72d5da audio: add missing space in GST_AUDIO_FORMATS_ALL
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/694>
2020-06-10 10:43:42 +02: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
e2f6b85fd9 audio: 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