Commit graph

7966 commits

Author SHA1 Message Date
Alexander Vandenbulcke
ccebcaa586 gl/dispmanx: assign render_rect to window before window_resize
If the `render_rect` for a dispmanx display is set after calling
`window_resize` the resize defaults to the dp_width and dp_height to
determine the location of the render rectangle instead of the correct
dimensions that should be set on the window_egl.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1056>
2021-03-02 09:13:25 +01:00
Kristofer Björkström
11b5ebd058 gstrtspconnection: correct data_size when tunneled mode
gst_rtsp_connection_send_messages_usec in tunneled mode does base64
encode messages. When calculating data_size 1 bytes is added, which
results in ending the base64 with a NULL.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1051>
2021-02-25 12:21:53 +01:00
Robert Rosengren
e99a6f3142 audio: Use GST_BUFFER_PTS instead of deprecated GST_BUFFER_TIMESTAMP
GST_BUFFER_PTS already used in audio code base (e.g. gstaudiodecoder),
so migrate completely from deprecated GST_BUFFER_TIMESTAMP for better
readability, as gstcompat.h defines GST_BUFFER_TIMESTAMP directly to PTS
anyway.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1048>
2021-02-25 02:04:44 +00:00
Sebastian Dröge
f5381ba9f5 audioaggregator: Log if the sample rate of one sinkpad is not accepted
Otherwise this can silently cause not-negotiated errors without any
direct hint about what went wrong.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1049>
2021-02-24 19:53:02 +02:00
Vivia Nikolaidou
1517b7043d video-converter: Don't upsample/downsample/dither invalid lines
This is a fallout from the conversion to support multiple threads.
convert->upsample_p is never NULL now, it's always an allocated array of
n_threads potentially-null pointers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1043>
2021-02-23 03:40:12 +00:00
Vivia Nikolaidou
2527c8f9f8 libs: audio: Handle meta changes in gst_audio_buffer_truncate
Set timestamp and duration to GST_CLOCK_TIME_NONE unless trim==0,
because that function doesn't know the rate and therefore can't
calculate them. Set offset and offset_end to appropriate values. Make it
clear in the documentation that the caller is responsible for setting
the timestamp and duration.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1039>
2021-02-18 11:25:32 +02:00
Alicia Boya García
29aeba639a videodecoder: Fix racy critical when pool negotiation occurs during flush
I found a rather reproducible race in a WebKit LayoutTest when a player
was intantiated and a VP8/9 video was loaded, then torn down after
getting the video dimensions from the caps.

The crash occurs during the handling of the first frame by gstvpxdec.
The following actions happen sequentially leading to a crash.

(MT=Main Thread, ST=Streaming Thread)

MT: Sets pipeline state to NULL, which deactivates vpxdec's srcpad,
    which in turn sets its FLUSHING flag.

ST: gst_vpx_dec_handle_frame() -- which is still running -- calls
    gst_video_decoder_allocate_output_frame(); this in turn calls
    gst_video_decoder_negotiate_unlocked() which fails because the
    srcpad is FLUSHING. As a direct consequence of the negotiation
    failure, a pool is NOT set.

    gst_video_decoder_negotiate_unlocked() still assumes there is a
    pool, crashing in a critical in gst_buffer_pool_acquire_buffer()
    a couple statements later.

This patch fixes the bug by returning != GST_FLOW_OK when the
negotiation fails. If the srcpad is FLUSHING, GST_FLOW_FLUSHING is
returned, otherwise GST_FLOW_ERROR is used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1031>
2021-02-16 16:57:54 +00:00
Jan Alexander Steffens (heftig)
297a5f09b1 libs: audio: Fix gst_audio_buffer_truncate meta handling
In the non-interleaved case, it made `buffer` writable but then changed
the meta of the non-writable buffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1035>
2021-02-15 17:32:04 +01:00
Alejandro González
319da90d4c audioencoder: Fix gst_audio_encoder_get_audio_info return ownership GTK-Doc
GTK-Doc specifies that, by default, the caller owns returned objects, so that the caller should free them when it is done. However, in the case of this function, the returned GstAudioInfo is owned by the decoder, so this default choice is incorrect. This creates double free problems when using GStreamer Rust bindings, because they are generated using the information contained in the docs.

Fix this by correctly specifying that the caller does not own the returned object.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1032>
2021-02-13 21:25:18 +00:00
Alejandro González
2fd2540ea5 audiodecoder: Fix gst_audio_decoder_get_audio_info return ownership GTK-Doc
GTK-Doc specifies that, by default, the caller owns returned objects, so that the caller should free it when it is done. However, in the case of this function, the returned GstAudioInfo is owned by the decoder, so this default choice is incorrect. This creates double free problems when using GStreamer Rust bindings, because they are generated using the information contained in the docs.

Fix this by correctly specifying that the caller does not own the returned object.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1032>
2021-02-13 17:24:37 +00:00
Thibault Saunier
e1a8393ba7 encoding-profile: Plug a leak of factory list
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1002>
2021-02-10 15:56:26 +00:00
Thibault Saunier
a8fca8d040 encodebin: Add APIs to set element properties on encoding profiles
User often want to set encoder properties on encoding profiles,
this introduces a way to easily 'preset' properties when defining the
profile. This uses GstStructure to define those properties the same
way it is done in `splitmux` for example as it makes simple to handle.

This also defines a more complex structure type where we can map a set
of properties to set depending on the muxer/encoder factory that has
been picked by EncodeBin so it is quite flexible.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1002>
2021-02-10 15:56:26 +00:00
Thibault Saunier
a8fdaba2ab encoding-profile: Cleanup profile serialization documentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1002>
2021-02-10 15:56:26 +00:00
Alexander Vandenbulcke
57029ba098 gl/dispmanx: fix deadlock triggered by set_render_rectangle
When the gstglimagesink is started with the option `glimagesink
render-rectangle="<0,0,1920,1080>"`, the pipeline reaches a deadlock.
The reason the deadlock occurs is that the
`gst_gl_window_set_render_rectangle` takes locks on the window, in
addition it calls `window_class->set_render_rectangle(...)` which
executes the `_on_resize` function. Since the `_on_resize` function also
takes locks on the window the deadlock is achieved.

By scheduling the adjustment of the render rectangle through an async
message for `gst_gl_window_dispmanx_set_render_rectangle`, the actual
resize happens in another context and therefore doesn't suffers from the
lock taken in `gst_gl_window_set_render_rectangle`.

This solution follows the same approach as gl/wayland. The problem was
introduced by b887db1. For the full discussion check #849.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1030>
2021-02-10 09:30:27 +01:00
Vivia Nikolaidou
ca4240bd03 videoconvert: Support for alternate-field interlacing
Treat the data just like normal data with half the height. Also treat it
as progressive when converting from/to I420 because it requires
different handling for chroma subsampling.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1027>
2021-02-04 18:22:07 +02:00
Havard Graff
0f866832b1 audio: add GstAudioLevelMeta
Will be used to implement RTP extension https://tools.ietf.org/html/rfc6464

Co-authored-by: Guillaume Desmottes <guillaume.desmottes@collabora.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/706>
2021-02-04 10:25:24 +01:00
Guillaume Desmottes
a48edc8372 rtpbasedepayload: add auto-header-extension property
Same property as the one I just added on rtpbasepayload.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1022>
2021-02-03 11:23:40 +01:00
Guillaume Desmottes
bad4b1711d rtpbasepayload: add auto-header-extension property
Using RTP header extensions is currently not convenient. Users have to
handle signals from the RTP payloader and instantiate the extension
element themselves, making it impossible to use with gst-launch.

Adding a property allowing the payloader to automatically try creating
extensions. This should help simple use cases and testing using
gst-launch.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1022>
2021-02-03 11:19:04 +01:00
Marijn Suijten
9ab400e267 gstaudiostreamalign: Pass self as const pointer in getter functions
It was noticed in [1] that `GstAudioStreamAlign` is a simple boxed type
that is passed as const in the copy function, but not as such in the
getters. These functions turn out to be the only users of `const = true`
overrides in `gstreamer-rs`. Since there is no locking or other advanced
caching/sharing going on (as happens with miniobjects) these functions
can safely take self as const pointer.

[1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/683#note_783129

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1025>
2021-01-29 21:42:47 +01:00
Jakub Adam
11e6f8da92 video-hdr: Add API to check content light level equality
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/969>
2021-01-28 20:55:38 +01:00
Guillaume Desmottes
df9064fdc6 rtpbasedepayload: set attributes on newly requested extensions
Users were supposed to configure the extension themselves but it was
impossible to do so as they didn't have access to the caps.

Fix #864

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1021>
2021-01-27 09:48:49 +01:00
Guillaume Desmottes
912cf46b83 rtpbasepayload: set attributes on newly requested extensions
Users were supposed to configure the extension themselves but it was
impossible to do so as they didn't have access to the caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1021>
2021-01-27 09:48:49 +01:00
Guillaume Desmottes
5acde5568e rtpbasedepayload: fix clear-extensions signal definition
Typo as we were using the wrong enum.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1021>
2021-01-27 09:48:49 +01:00
Guillaume Desmottes
0896ccb436 rtp: fix clear-extensions signal definition
Typo as we were using the wrong enum.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1018>
2021-01-25 14:28:12 +01:00
Guillaume Desmottes
d396190b91 rtphdrext: fix typo in doc
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1018>
2021-01-25 14:28:12 +01:00
Marijn Suijten
abb026ec6a gl,video: Make ptrs to VideoInfo and (GL)AllocationParams immutable
These parameters are incorrectly regarded as mutable in G-IR making them
"incompatible" with languages that are explicit about mutability like
Rust. In order to clean up the code and expected API there, update the
signatures here, right at the source (instead of overriding them in
Gir.toml and hoping for the best).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1005>
2021-01-14 11:53:10 +00:00
Marijn Suijten
fa8b5b9a6d audio/audio-buffer: @buffer in audio_buffer_map is out caller-allocates
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1005>
2021-01-14 11:53:10 +00:00
Marijn Suijten
c70d263e48 video/video-frame: @frame in video_frame_map is out caller-allocates
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1005>
2021-01-14 11:53:10 +00:00
Marijn Suijten
a263919f06 audio,video: Add out caller-allocates to init and from_caps
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1005>
2021-01-14 11:53:10 +00:00
Sebastian Dröge
7e16eed522 videosink: Add new GstVideoSink::set_info() virtual method
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/986>
2021-01-14 11:15:40 +00:00
Sebastian Dröge
198434e71a videosink: Implement more complete BaseSink::get_times() based on the framerate
This will only make use of the framerate if the subclass is chaining up
BaseSink::set_caps(). Otherwise it will have the same behaviour as the
basesink default.

Doing so is useful if video buffers don't contain a duration to
calculate a default duration, and various video sinks already implement
a custom version of this.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/986>
2021-01-14 11:15:40 +00:00
Marijn Suijten
1f06cf60e7 video: Convert info_to_caps to take self as const ptr
This requires a slight modification to the function itself because it
was overwriting a member locally.

However, now this side-effect cannot be observed outside the function
anymore.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1008>
2021-01-14 08:14:36 +00:00
Matthew Waters
b60951a4fa gl: add get_type() implementations for all of our memory types
Otherwise, various bindings can't really know the type of an object as
required.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/999>
2021-01-13 13:40:58 +00:00
Jakub Adam
f5d971a19e rtpbasepayload: fix header extension length calculation
Since ternary operator has the lowest precedence in the expressions at
hand, wordlen would always incorrectly yield 0 or 1.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1009>
2021-01-12 22:26:19 +01:00
Jakub Adam
2d198ff10b video-blend: fix blending 8-bit and 16-bit frames together
Replace hardcoded 255s with the correct max value for the given color
depth. Use 64-bit integer in calculations where overflow may occur.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1000>
2021-01-08 08:04:55 +00:00
Matthew Waters
f573d91237 gl: document some GL caps specifics
Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/854
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/996>
2021-01-05 15:03:54 +00:00
Tim-Philipp Müller
89bd37f24e tagdemux: resize and trim buffer in place to fix interaction with oggdemux
Elements operating in pull mode may optionally pass a buffer to
pull_range that should be filled with the data. The only element
that does that at the moment is oggdemux operating in pull mode.

tagdemux currently creates a sub-buffer whenever a buffer pulled
from upstream (filesrc, usually) needs to be trimmed. This creates
a new buffer, however, so disregards any passed-in buffer from a
downstream oggdemux.

This would cause assertion failures and playback problems for
ogg files that contain ID3 tags at the end.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/994>
2021-01-04 14:21:43 +00:00
Mathieu Duponchelle
06c158957d appsrc: fix signal documentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/992>
2020-12-31 17:01:40 +00:00
Edward Hervey
65b6994df6 videoaggregator: Pop out old buffers on timeout
This situation happens in the situation where an input stream has a framerate
exceeding the timeout latency (Ex: 1fps with a latency of 500ms) and an input
stream greater than output framerate (ex: 60fps in, 30 fps out).

The problem that would happen is that we would timeout, but then buffers from
the fast input stream would only be popped out one by one.... until a buffer
reaches the low-framerate input stream at which point they would quickly be
popped out/used. The resulting output would be "slow ... fast ... slow ... fast"
of that input fast stream.

In order to avoid this situation, whenever we detect a late buffer, check if
there's a next one and re-check with that one.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/990>
2020-12-30 16:03:13 +01:00
Stéphane Cerveau
f76b731cbf hdr: update doc
update GST_VIDEO_HDR10_PLUS_MAX_ROWS_MD_APL and
GST_VIDEO_HDR10_PLUS_MAX_COLS_MD_APL

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/979>
2020-12-15 23:50:12 +01:00
Stéphane Cerveau
9b852181d8 videodecoder: Forward hdr-format info downstream
By default the hdr-format detected by a parser should
be passed to the downstream element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/650>
2020-12-15 16:37:46 +00:00
Stéphane Cerveau
631489de23 video-hdr: add hdr formats
Provide enum and helper method to set the hdr format
name in caps by example.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/650>
2020-12-15 16:37:46 +00:00
Stéphane Cerveau
a1ed7a8f49 video-hdr: introduce HDR10+ parser
Video can now parse a HDR10+ data structure
coming from a SEI message.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/650>
2020-12-15 16:37:46 +00:00
Stéphane Cerveau
7d6f72e956 video-hdr: add HDR10+ structure
Provides structure and GstVideoMeta

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/650>
2020-12-15 16:37:46 +00:00
Fabrice Fontaine
d86cf6314f gst-libs/gst/video/gstvideoaggregator.c: fix build with gcc 4.8
Fix the following build failure with gcc 4.8 which has been added with
d268c193ad:

../gst-libs/gst/video/gstvideoaggregator.c: In function 'gst_video_aggregator_init':
../gst-libs/gst/video/gstvideoaggregator.c:2762:3: error: 'for' loop initial declarations are only allowed in C99 mode
   for (gint i = 0; i < gst_caps_get_size (src_template); i++) {
   ^

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/974>
2020-12-14 16:42:01 +00:00
Seungha Yang
a4ba868225 video: Make use of gst_video_chroma_site_{from,to}_string() API
Replace deprecated gst_video_chroma_{from,to}_string()
to newly added gst_video_chroma_site_{from,to}_string()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/927>
2020-12-08 07:21:28 +00:00
Seungha Yang
410efd196a video-chroma: Add support for any combination of chroma-site flags
We've been allowing only a few known chroma-site values such as
jpeg (not co-sited), mpeg2 (horizontally co-sited) and
dv (co-sited on alternate lines). That's insufficient for
representing all possible chroma-site values. By this commit,
we can represent any combination of chroma-site flags.
But, an exception here is that any combination with
GST_VIDEO_CHROMA_SITE_NONE will be considered as invalid value.

For any combination of chroma-site flags,
gst_video_chroma_to_string() method is deprecated in order to
return newly allocated string via a new gst_video_chroma_site_to_string()
method. And for consistent API naming, gst_video_chroma_from_string()
is also deprecated. Newly written code should use
gst_video_chroma_site_from_string() instead.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/927>
2020-12-08 07:21:28 +00:00
Jakub Adam
6434db5298 rtpbasepayload: pass optional caps fields in a GstStructure
For more flexibility, allow to pass the extra output caps fields as
a GstStructure.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/952>
2020-12-05 08:29:31 +00:00
Ratchanan Srirattanamet
cc8f54468e audiobasesrc: always acquire if not acquired in _setcaps
audiobasesrc's setcaps contains an optimization that makes it not re-
acquire the ringbuffer if the caps have not changed. However, it doesn't
check if it has successfully acquired it or not. It's possible to have
the caps set but not having ringbuffer acquired if the previous attempt
to acquire fails.

This commit replaces the caps existence check with whether the
ringbuffer is acquired or not. There's no need to check for caps
existence because 1.) it's unlikely to be NULL if the ringbuffer is
acquired, and 2.) _setcaps shouldn't be called with a NULL caps.

This should also let the element retry on acquiring ringbuffer after an
error by re-setting the element's state to READY and back to PLAYING.
Whether this behavior is correct is up for debate.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/512>
2020-12-04 13:57:58 +00:00
He Junyan
1146a7e3a0 glbasefilter: Need to check the display before lock it.
In find_gl_context_unlocked(), the display of filter may be NULL
and can cause crash if we directly access and lock it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/922>
2020-12-04 00:23:38 +08:00
He Junyan
089a1f56b0 glbasefilter: Delete the un-paired unlock in change_state().
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/922>
2020-12-04 00:13:59 +08:00
Arun Raghavan
27ce682940 audioencoder: Fix incorrect GST_LOG_OBJECT usage
GstBuffer is not a GstObject, so this causes a warning to be emitted.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/956>
2020-12-03 12:46:33 +00:00
Matthew Waters
7a53fbad68 rtp/basepayload: implement support for rtp header extensions
New signals are added for managing the internal list of rtp header
extension implementations read by a specific depayloader instance.

If the 'extmap-$NUM' field is present in the src caps, then an
extension implementation will be requested but is not required to be able
to negotiate correctly.  An extension will be requested using the
'request-extension' signal if none could be found internally.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/748>
2020-12-03 10:19:32 +00:00
Matthew Waters
092ea647bb rtp/basedepayload: implement support for rtp header extensions
New signals are added for managing the internal list of rtp header
extension implementations read by a specific depayloader instance.

If the 'extmap-$NUM' field is present in the sink caps, then an
extension implementation will be requested but is not requited to be
able to negotiate correctly.  An extension will be requested using the
'request-extension' signal if none could be found internally.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/748>
2020-12-03 10:19:32 +00:00
Matthew Waters
427c3f4442 rtp: add base object for reading/writing rtp header extensions (RFC5285)
Facilitates the creation of rtp header extension implementations that
can be reused across applications.

Implementations are registered into the GStreamer registry as elements
(idea from GstRTSPExtension) and can be retrieved by URI or filtered
manually.  RTP header extensions must have the classification
"Network/Extension/RTPHeader" to be considered as a RTP Header
extension.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/777
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/748>
2020-12-03 10:19:32 +00:00
Mart Raudsepp
526cb2baa8 gl/eagl: Fix automatic resize behaviour
https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/681
added a layoutSubViews, which never gets called, because it should have been
called layoutSubviews (non-capital "v"). However after fixing that, it still
doesn't work correctly, because window_width/height values are immediately
updated and then draw_cb will never trigger the resize path, because the
values are already up to date.
Update the values inside the resize path again instead, so the check for
entering the resize path is logically always correct.
This makes the layoutSubviews unnecessary, as it only updated the internal
size values prematurely, so it is deleted instead of method naming fixed.

These changes were originally done to avoid accessing UIKit objects on the
main thread, but no additional accesses are added here, only internal
private variable assignments under the same draw_lock, so there should be
no threading issues reintroduced.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/945>
2020-12-03 08:18:29 +00:00
Mart Raudsepp
8ffea3afb5 gl/eagl: Fix resize condition check in draw_cb to not get called unnecessarily
A CGSize contains CGFloat values (a typedef to double or float), which means
that the values aren't equal, despite it being equal after they are cast to
int by assigning them to window_height/width private members. This leads to
excessive gst_gl_window_resize calls on each frame, at least if the CGFloat
value has a .5 decimal value, e.g. 103.5.
Fix it by storing them as CGFloat instead of gint.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/945>
2020-12-03 08:18:29 +00:00
Matthew Waters
d4ff62700d video/converter: increase the number of cache lines for resampling
The exising hardcoded max default does not account for the possible
-1 offset when retrieving lines for resampling.  As a result, when
another chain has the same number of cache lines (4), the resample
operation would be attempting to generate 5 lines with a cache size
of 4 and would overwrite the first cache line.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/938>
2020-12-03 06:39:09 +00:00
Guillaume Desmottes
3ab2023ed8 videometa: gir annotate the size of plane array in new API
Fix #838

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/949>
2020-12-01 09:50:27 +01:00
Thibault Saunier
dc4c976727 pbutils: Add support for muxing sinks usage in encoding profiles 2020-11-30 15:44:53 -03:00
Seungha Yang
a62af4ff27 glcontext: wgl: Implement check_feature vfunc
There are several WGL specific extenstions such as WGL_NV_DX_interop.
Currently we have no WGL specific extension support and
this commit is also only for debugging purpose.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/947>
2020-11-28 08:00:11 +00:00
Sanchayan Maity
5aa836848e audiodecoder: Move max_errors out of GstAudioDecoderContext
Currently max-errors gets set during init to default or via property.
However, if a decoder element calls gst_audio_decoder_reset with 'full'
argument set to TRUE, it would result in all the fields of context being
zeroed with memset. This effectively results in max-errors getting a
value of 0 overriding the default or user requested value set during
init.

This would result in calls to GST_AUDIO_DECODER_ERROR which track error
counts and allow max-errors, to be ineffective.

To fix this move max-errors out of GstAudioDecoderContext, as changes to
context should not affect this. The error_count is anyways also in
GstAudioDecoderPrivate and not in context.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/946>
2020-11-27 14:49:10 +05:30
Marijn Suijten
7565a0b997 video: Provide "deprecated in" version for gst_video_color_transfer fns
As requested in [1].

[1]: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/940#note_706437

Fixes: d0f36c7e1 ("video: Rename video_color_transfer to video_transfer_function")
2020-11-25 20:19:39 +01:00
Marijn Suijten
3ec795f613 audio: Move fill_silence into audio_format_info
With the function named gst_audio_format_fill_silence it would get
associated to the GstAudioFormat type in .gir which is incorrect and
confusing. See [1] for the discussion sparking this change.

https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/630#note_694795

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/940>
2020-11-25 19:18:25 +01:00
Mathieu Duponchelle
c50f4477ec video-converter: switch to using a task pool ..
.. and make use of that API in videoaggregator.

When setting certain properties, such as cropping or the scaled
size of pads, a new converter is created by videoaggregator.

Before that patch, this implied spawning new threads, potentially
at each aggregate cycle when interpolating pad properties. This
is obviously wasteful, and re-using a task pool removes that
overhead.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/896>
2020-11-12 17:38:34 +00:00
David Keijser
f3dc83d285 Fix segfault when using invalid encoding profile
Trying to use gst_encoding_profile_get_file_extension on a
GstEncodingProfile with a cap containing a typo would result in strcmp
being called with NULL. Instead use g_strcmp0 that handles this case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/929>
2020-11-10 23:26:39 +01:00
Jan Alexander Steffens (heftig)
b3fe2d3623 videoaggregator: Fix locking around vagg->info
Take `GST_OBJECT_LOCK` when writing `vagg->info`, so that reading in
subclasses is protected against races, as documented in the struct.

    /*< public >*/
    /* read-only, with OBJECT_LOCK */
    GstVideoInfo                  info;

`gst_video_aggregator_default_negotiated_src_caps` should take the
`GST_VIDEO_AGGREGATOR_LOCK` to avoid racing with
`gst_video_aggregator_reset` called by
`gst_video_aggregator_release_pad` of the last sinkpad. Otherwise it can
happen that `latency = gst_util_uint64_scale (...` gets called with a
zero framerate.

There doesn't seem to be any reason not to use the local `info` instead
of `vagg->info`, so do that.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/915>
2020-11-09 16:04:06 +00:00
Guillaume Desmottes
b005d472f7 video: fix doc warning
@mode has been renamed to
gst_video_decoder_set_interlaced_output_state() but not in the header
file, raising a doc warning.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/894>
2020-11-09 11:55:57 +00:00
Jan Schmidt
cb9799e942 video-converter: Skip input lines where possible.
There is a case where there are no lines in the temp cache, and
it's possible to skip straight to the request line and not generate
intermediate ones. This is really only beneficial when doing
nearest-neighbour downscaling, as other methods generally require
all input lines sequentially to generate the output. In that case,
this change has no effect and all lines are generated and cached
as before.

As a side effect however, this fixes corruption when downscaling
using nearest-neighbour, as interactions with the pass_alloc flag
and reuse of temporary lines causes the unecessarily-generated
cache lines to overwrite the final output.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/919>
2020-11-05 07:14:20 +00:00
Sebastian Dröge
576f950e18 gl: Fix prototype of glGetSynciv()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/914>
2020-11-03 16:40:38 +02:00
Thibault Saunier
d268c193ad videoaggregator: Guarantee that the output format is supported
In the case `videoaggregator` is set as allowing format conversions,
and as we convert only on the sinkpads, we should ensure that the
chosen format is usable by the subclass. This in turns implies
that the format is usable on the srcpad.

When doing conversion *any* format can be used on the sinkpads, and this
is the only way that we can avoid race conditions during renegotiations
so we can not change that fact, we just need to ensure that the chosen
intermediary format is usable, which was not actually ensured before
that patch.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/909>
2020-11-03 00:10:31 +00:00
Seungha Yang
660b5e4a98 videodecoder: Don't assume GstVideoChromaSite and GstVideoColorimetry
Even if given GstVideoChromaSite and/or GstVideoColorimetry has unknown
value(s), assumption for an unknown value should be done by subclass or
downstream element, not a role of video decoder. And subclass might
want to output unknown value as is.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/910>
2020-11-02 14:11:52 +00:00
Seungha Yang
37255eb7dc videodecoder: Remove trailing whitespace
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/910>
2020-11-02 14:11:52 +00:00
Thibault Saunier
69b5cb8a10 video-aggregator: Fix renegotiation when using convert pads
Since 23189c60f4 we started using the
useless result of `modified_caps` which, was never used since it was
introduced 7 years ago (in videomixer2). The intersection is useless and
we should just avoid doing it at all (which was always the case before)
as it can end up failing renegotiation for bad reasons.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/905>
2020-10-29 23:40:21 +00:00
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