Commit graph

330 commits

Author SHA1 Message Date
Ignacio Casal Quinteiro 2aa34164f6 sdp: use g_strdup instead of strdup
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3475>
2022-11-28 09:36:18 +00:00
Tim-Philipp Müller dec3aa55e9 audioconvert, audioresample, audiofilter: fix divide by 0 for input buffer without caps
gst-launch-1.0 audiotestsrc ! udpsink host=127.0.0.1
gst-launch-1.0 udpsrc ! audioconvert ! autoaudiosink

would crash with a floating point exception when clipping the input
buffer owing to a division by zero because no caps event was received.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3469>
2022-11-26 08:47:49 +00:00
Matt Crane b11169bd32 rtpbasedepayload: Drop redundant reference timestamp buffer meta in RTP depayloaders
Currently, when rtspsrc property add-reference-timestamp-metadata=true,
a downstream rtph264depay element will attach multiple copies of the
same GstReferenceTimestampMeta to the depayloaded media buffers. This
can have signficant performance impacts further downstream in a pipeline
like the following:

    rtspsrc add-reference-timestamp-metadata=true ! rtph264depay ! h264parse ! ... ! rtph264pay ! ...

For example, if there are 10 packet buffers for a frame of RTP H.264
video, each of those packet buffers will contain the same reference
timestamp meta. The rtph264depay element will then attach all 10
metadata to the depayloaded frame. And then later when we payload the
frame buffer again for proxying, we now have 10 more buffers each with
10 instance of the same metadata. Allocating/deallocating 100+ instances
of metadata @ 30fps for multiple streams has a pretty large performance
impact.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1578

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3431>
2022-11-19 07:57:44 +00:00
Nicolas Dufresne e60a94c27d video-frame: Avoid using tile width
The tile width in pixel is not always available. Notably for
8L128 10bit format, the tile is 8x128 bytes, and the pixel
format is fully packed. That means that the tile contains at
least 6 pixels per line, but it also hold some bits of the
pixel from the same line on the previous or next tile.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3424>
2022-11-18 22:59:29 +00:00
Nicolas Dufresne 5980fb76e7 video: Add arbitrary tile dimensions support
In current tile representation, only tiles with power of two
width and height in bytes are supported. This limitation
prevents adding more complex tiles formats.

In this patch, we deprecate tile_ws and tile_hs from GstVideoFormatInfo and
replace if with an array of GstVideoTileInfo. Each plane tiles are then
described with their pixels width/height, line stride and total size.
The helper gst_video_format_info_get_tile_sizes() that depends on the
deprecated API is also being removed. This can simply be removed as it wasn't
in any stable release yet.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3424>
2022-11-18 22:59:29 +00:00
Mathieu Duponchelle b5cd758230 aggregator: Implement force_live API
Setting force_live lets aggregator behave as if it had at least one of
its sinks connected to a live source, which should let us get rid of the
fake live test source hack that is probably present in dozens of
applications by now.

+ Expose API for subclasses to set and get force_live
+ Expose force-live properties in GstVideoAggregator and GstAudioAggregator
+ Adds a simple test

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3008>
2022-11-18 18:14:26 +00:00
Víctor Manuel Jáquez Leal f74fb5142d pbutils: Fix vp9 mime mapping when caps when no chroma-site.
It's possible to have 4:2:0 chroma format without chroma-site in caps, but it
isn't validated by the current code. This patch fixes it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3405>
2022-11-16 01:29:50 +00:00
Sebastian Dröge 416dae67b2 videodecoder: Consider having output data when the subclass drops a frame
The subclass might drop a frame for QoS reasons (e.g. vpxdec) and if all
frames are dropped because of that it wouldn't make sense to post an
error message on EOS.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3408>
2022-11-15 21:18:50 +00:00
Edward Hervey 7988144048 pbutils/encoding-profile: Streamline cleanup
Cleanup all local variables in one place, and ensure failure cases go through there.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3390>
2022-11-13 06:59:11 +01:00
Edward Hervey 872b0a65cb pbutils/encoding-profile: Don't leak string array
It was never freed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3390>
2022-11-12 10:33:51 +01:00
Nicolas Dufresne aaa01ac30a gstgl: Fix handling of padded tile formats
When a tile format is padded and imported as DMABuf, the stride
contains the information about the actual width and height in
number of tiles. This information is needed by the detiling shader
in order accuratly calculate the location of pixels. To fix that,
we also copy the offset and strides into the otuput format and
the converter will ensure that the shader is recompiled whenever
the stride changes.

This fixes video corruptions observed when decoding on MT8195
with videos that aren't not aligned to 64bytes in width.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3365>
2022-11-09 17:15:32 +00:00
Sebastian Dröge 40800fa117 discoverer: Annotate DiscovererInfo::get_audio_streams() and others with the concrete stream info type
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3353>
2022-11-07 19:04:49 +00:00
Matthew Waters 1c835695a3 pbutils: add correct mime mapping for vp9
Based on https://www.webmproject.org/vp9/mp4/#codecs-parameter-string

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3260>
2022-10-28 00:06:07 +00:00
Sebastian Dröge c878d0f68b core/base: Only post latency messages if the latency values have actually changed
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1525

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3282>
2022-10-27 15:25:22 +00:00
Edward Hervey 8f286fc388 videodecoder: Only post latency message if it changed
Posting latency messages causes a full and potentially expensive latency
recalculation of the pipeline. While subclasses should check whether the latency
really changed or not before calling this function, we ensure that we do not
post such messages if it didn't change.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3282>
2022-10-27 15:25:22 +00:00
Sebastian Dröge 366893e9ac Fix various warnings from gobject-introspection
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3261>
2022-10-25 09:45:25 +03:00
Nirbheek Chauhan a083280a58 gl/vulkan: Fix static linking on macOS
duplicate symbol '__invoke_on_main' in:
    /Library/Frameworks/GStreamer.framework/Versions/1.0/lib/libgstvulkan-1.0.a(cocoa_gstvkwindow_cocoa.m.o)
    /Library/Frameworks/GStreamer.framework/Versions/1.0/lib/libgstgl-1.0.a(cocoa_gstglwindow_cocoa.m.o)
ld: 1 duplicate symbol for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Also make the same change in iOS for consistency.

Continuation of https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1132

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3242>
2022-10-24 00:48:08 +00:00
Matthew Waters 5ddb347a23 build/gl: fix automatic dispmanx detection for rpi4
rpi4 doesn't contain dispmanx but still contains bcm_host.pc which
confuses the configure detection.  Add an explicit check for
EGL_DISPMANX_WINDOW_T to ensure that we only build with dispmanx when
the types are available.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/893
Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/952
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3230>
2022-10-20 22:29:16 +00:00
Matthew Waters 5fed85c465 docs/glcontextconfig: rename title to not be GstGLContext
Can be confusing havint two pages that both have GstGLContext as the
title.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3227>
2022-10-19 13:01:06 +00:00
Sebastian Dröge 2650bba844 sdp: Add/fix various annotations
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3194>
2022-10-18 13:51:17 +03:00
Sebastian Dröge 4617b63b5f tag: Add/fix various annotations
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3194>
2022-10-18 13:51:17 +03:00
Sebastian Dröge 2b91f7e165 allocators: Add/fix various annotations
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3194>
2022-10-18 13:51:17 +03:00
Sebastian Dröge 39591cb13d gl: Add/fix various annotations
And fix a memory leaks in gst_gl_display_egl_new() error cases.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3194>
2022-10-18 08:56:58 +00:00
Sebastian Dröge 533ea9bd7c pbutils: Add/fix various annotations
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3194>
2022-10-18 08:56:58 +00:00
Sebastian Dröge 47e4110a1b rtp: Add/fix various annotations
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3194>
2022-10-18 08:56:58 +00:00
Sebastian Dröge 84ab8c9e12 rtsp: Add/fix various annotations
Also initialize out parameters so that they don't have an undefined
value in case of errors.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3194>
2022-10-18 08:56:58 +00:00
Sebastian Dröge 75731aec53 app: Add/fix various annotations
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3194>
2022-10-18 08:56:58 +00:00
Sebastian Dröge e0b06df223 audio: Add/fix various annotations
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3194>
2022-10-18 08:56:58 +00:00
Sebastian Dröge 2e5c73fff7 video: Add/fix various annotations
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3194>
2022-10-18 08:56:58 +00:00
Sebastian Dröge 4df3da3bab rtpbuffer: Initialize extended timestamp to the first wraparound period
This allows correct handling of wrapping around backwards during the
first wraparound period and avoids the infamous "Cannot unwrap, any
wrapping took place yet" error message.

It allows makes sure that for actual timestamp jumps a valid value is
returned instead of 0, which then allows the caller to handle it
properly. Not having this can have the caller see the same timestamp (0)
for a very long time, which for example can cause rtpjitterbuffer to
output the same timestamp for a very long time.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1500

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3202>
2022-10-18 06:09:08 +00:00
Julian Bouzas 9197235539 riff: Mark jpeg as parsed
This is needed so that autoplugging works with avidemux and JPEG decoders that
need parsed sink caps (eg rockchip 'mppjpegdec' decoder). It also works fine
with 'jpegdec' decoder regardless.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3175>
2022-10-13 13:53:29 -04:00
Nicolas Dufresne 82f63b0d64 opengl: Fix usage of eglCreate/DestroyImage
The implementation was inconsistent between create and destroy. EGLImage
creation and destruction is requires for EGL 1.5 and up, while
otherwise the KHR version is only available if EGL_KHR_image_base
feature is set. Not doing these check may lead to getting a function
pointer to a stub, which is notably the case when using apitrace.

Fixes #1389

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2925>
2022-10-11 08:23:45 +00:00
Seungha Yang c9f12b5086 videosink: Don't return unknown end-time from get_times()
... in case of reverse playback. Otherwise basesink will not
wait for clock

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3121>
2022-10-06 06:36:42 +00:00
Haihao Xiang 8f5399b156 eglimage: fix Y412_LE DMABuf import support
This fixed the error below:

GST_GL_PLATFORM=egl gst-launch-1.0 videotestsrc ! msdkvpp !
"video/x-raw(memory:DMABuf),format=Y412_LE" ! glimagesink

0:00:00.063737691 576978 0x557c11266920 ERROR             gleglimage
gsteglimage.c:577:_drm_rgba_fourcc_from_info: Unsupported format for
DMABuf.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1389>
2022-10-05 04:21:03 +00:00
Haihao Xiang fbbf44c48c eglimage: add Y410 DMABuf import support
This fixed the error below:

GST_GL_PLATFORM=egl gst-launch-1.0 videotestsrc ! msdkvpp ! \
"video/x-raw(memory:DMABuf),format=Y410" ! glimagesink

0:00:00.040553883 576732 0x55be9b35f920 ERROR             gleglimage
gsteglimage.c:577:_drm_rgba_fourcc_from_info: Unsupported format for
DMABuf.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1389>
2022-10-05 04:21:03 +00:00
Haihao Xiang 2d1496bc70 eglimage: add Y212_LE / Y212_BE DMABuf import support
This fixed the error below:

GST_GL_PLATFORM=egl gst-launch-1.0 videotestsrc ! msdkvpp \
! "video/x-raw(memory:DMABuf),format=Y212_LE" ! glimagesink

0:00:00.148086281 575148 0x562a6d36d920 ERROR             gleglimage
gsteglimage.c:555:_drm_rgba_fourcc_from_info: Unsupported format for
DMABuf.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1389>
2022-10-05 04:21:03 +00:00
Haihao Xiang 18215dcd3b eglimage: add Y210 DMABuf import support
This fixed the error below:

GST_GL_PLATFORM=egl gst-launch-1.0 videotestsrc ! msdkvpp ! \
"video/x-raw(memory:DMABuf),format=Y210" ! glimagesink

0:00:00.039881627 571365 0x56245eba6920 ERROR             gleglimage
gsteglimage.c:549:_drm_rgba_fourcc_from_info: Unsupported format for
DMABuf

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1389>
2022-10-05 04:21:03 +00:00
Tim-Philipp Müller 4c8a621809 pbutils: descriptions: add meta/x-klv
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3094>
2022-09-30 11:08:45 +03:00
Tim-Philipp Müller 2d53f9f97c pbutils: descriptions: fix gst_pb_utils_get_caps_description_flags()
And add a little unit test.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3094>
2022-09-30 11:08:45 +03:00
James Cowgill 4edfc86c2a xmptag: Call gst_tag_register_musicbrainz_tags during init
We need to call this to register the MusixBrainz tags before we use
them in an XMP schema.

Fixes this critical when attempting to run jpegparse on a JPEG
containing MusicBrainz XMP tags:

  GStreamer-CRITICAL **: 20:41:07.885: gst_tag_get_type: assertion 'info != NULL' failed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3092>
2022-09-29 23:29:20 +00:00
Philipp Zabel 3b900e1fa4 buffer: drop parent meta in deep copy/foreach_metadata
The purpose of a deep buffer copy is to be able to release the source
buffer and all its dependencies. Attaching the parent buffer meta to
the newly created deep copy needlessly keeps holding a reference to the
parent buffer.

The issue this solves is the fact you need to allocate more
buffers, as you have free buffers being held for no reason. In the good
cases it will use more memory, in the bad case it will stall your
pipeline (since codecs often need a minimum number of buffers to
actually work).

Fixes #283

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2928>
2022-09-28 12:34:44 -06:00
Edward Hervey 8c49fcbc83 video-converter: Fix doc
Argument names weren't correct

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3043>
2022-09-19 08:54:48 +02:00
Thibault Saunier a75f74d2cd gl:meson: Minor typo fix
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2954>
2022-09-15 20:11:46 +00:00
Thibault Saunier 1c4950718f discoverer: Fix discovering source that expose raw audio/video
Exposes a "uridecodebin:post-stream-topology" property as the discoverer
needs to have topology information about all streams so we need
`uridecodebin` to always plug decodebins for that case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3009>
2022-09-15 19:25:01 +00:00
Seungha Yang 11e4eb5490 video-format: Workaround MSVC build error
../gst-libs/gst/video/video-format.c(6779): error C2219: syntax error:
type qualifier must be after '*'

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2719>
2022-09-08 21:01:37 +00:00
Thibault Saunier bc9c1e3956 meson: Namespace the plugins_doc_dep/libraries variables
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2970>
2022-09-01 21:17:35 +00:00
Rafael Caricio 8648f5f7d2 audiovisualizer: fix buffer mapping to not increase refcount
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2953>
2022-08-30 15:22:42 +00:00
Guillaume Desmottes cb1dc5c9ac base: video-converter: add accessors for input and output formats
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2905>
2022-08-17 12:33:54 +00:00
Sebastian Dröge edb0e47074 rtspurl: Use gst_uri_join_strings() in gst_rtsp_url_get_request_uri_with_control() instead of a hand-crafted, wrong version
For example the query string of the base must not be taken over to the
request URL unless there is no control path, and control paths can be
absolute and must not be considered relative if they start with a /.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2868>
2022-08-12 18:52:29 +00:00
Mathieu Duponchelle 62c303c2e0 encoding-profile: don't order profiles by stream ID ..
when creating a profile from a discoverer info.

There is no justification for the existing code, and talking with
Thibault he cannot remember why the sort was in place.

On the other hand, this allows GES users to not have to implement
a callback for the select-tracks-for-object callback when using
it to trim a single clip, which the output profile was built from:
track elements will be placed in the appropriate track by default,
that is the one that will be connected to the matching profile.

For multi-clip timelines, the situation doesn't change, users will
still have to implement a callback and do the leg work of placing
track elements (if any) in a matching track (if any).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1549>
2022-08-02 15:48:12 +00:00
Mathieu Duponchelle 0f85a46148 encoding-profile: ignore more output caps fields
chroma-format, bit-depth-chroma, bit-depth-luma are all informative
fields set by the H265 and H265 parser upon receiving an SPS.

They shouldn't be constrained downstream of the parser, instead
if a user wants those to ultimately match certain values they
should do so by constraining a profile.

In this case however, we also always remove the profile constraint
in order to let encoders pick a suitable one as a function of the
raw input video format and their own capabilities.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1549>
2022-08-02 15:48:12 +00:00
Nirbheek Chauhan 5da9f62313 rtsp+rtmp: Forward warning added to tls-validation-flags to our users
With the 2.72 release, glib-networking developers have decided that
TLS certificate validation cannot be implemented correctly by them, so
they've deprecated it.

In a nutshell: a cert can have several validation errors, but there
are no guarantees that the TLS backend will return all those errors,
and things are made even more complicated by the fact that the list of
errors might refer to certs that are added for backwards-compat and
won't actually be used by the TLS library.

Our best option is to ignore the deprecation and pass the warning onto
users so they can make an appropriate security decision regarding
this.

We can't deprecate the tls-validation-flags property because it is
very useful when connecting to RTSP cameras that will never get
updates to fix certificate errors.

Relevant upstream merge requests / issues:

https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2214

https://gitlab.gnome.org/GNOME/glib-networking/-/issues/179

https://gitlab.gnome.org/GNOME/glib-networking/-/merge_requests/193

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2494>
2022-07-30 11:27:12 +00:00
Matthew Waters 598f2ab73f rtspconnection: protect cancellable by a mutex
It is entirely possible for the cancellable to be cancelled (and freed)
in gst_rtsp_connection_flush() while there may be an ongoing read/write
operation.

Nothing prevents gst_rtsp_connection_flush() from waiting for the
outstanding read/writes.

This could lead to a crash like (where cancellable has been freed
within gst_rtsp_connection_flush()):

 #0  0x00007ffff4351096 in g_output_stream_writev (stream=stream@entry=0x7fff30002950, vectors=vectors@entry=0x7ffe2c6afa80, n_vectors=n_vectors@entry=3, bytes_written=bytes_written@entry=0x7ffe2c6af950,  cancellable=cancellable@entry=0x7fff300288a0, error=error@entry=0x7ffe2c6af958) at ../subprojects/glib/gio/goutputstream.c:377
 #1  0x00007ffff44b2c38 in writev_bytes (stream=0x7fff30002950, vectors=vectors@entry=0x7ffe2c6afa80, n_vectors=n_vectors@entry=3, bytes_written=bytes_written@entry=0x7ffe2c6afb90, block=block@entry=1, cancellable=0x7fff300288a0) at ../subprojects/gst-plugins-base/gst-libs/gst/rtsp/gstrtspconnection.c:1320
 #2  0x00007ffff44b583e in gst_rtsp_connection_send_messages_usec (conn=0x7fff30001370, messages=messages@entry=0x7ffe2c6afcc0, n_messages=n_messages@entry=1, timeout=timeout@entry=3000000) at ../subprojects/gst-plugins-base/gst-libs/gst/rtsp/gstrtspconnection.c:2056
 #3  0x00007ffff44d2669 in gst_rtsp_client_sink_connection_send_messages (sink=0x7fffac0192c0, timeout=3000000, n_messages=1, messages=0x7ffe2c6afcc0, conninfo=0x7fffac019610) at ../subprojects/gst-rtsp-server/gst/rtsp-sink/gstrtspclientsink.c:1929
 #4  gst_rtsp_client_sink_try_send (sink=sink@entry=0x7fffac0192c0, conninfo=conninfo@entry=0x7fffac019610, requests=requests@entry=0x7ffe2c6afcc0, n_requests=n_requests@entry=1, response=response@entry=0x0, code=code@entry=0x0) at ../subprojects/gst-rtsp-server/gst/rtsp-sink/gstrtspclientsink.c:2845
 #5  0x00007ffff44d3077 in do_send_data (buffer=0x7fff38075c60, channel=<optimized out>, context=0x7fffac042640) at ../subprojects/gst-rtsp-server/gst/rtsp-sink/gstrtspclientsink.c:3896
 #6  0x00007ffff4281cc6 in gst_rtsp_stream_transport_send_rtp (trans=trans@entry=0x7fff20061f80, buffer=<optimized out>) at ../subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-stream-transport.c:632
 #7  0x00007ffff4278e9b in push_data (stream=0x7fff40019bf0, is_rtp=<optimized out>, buffer_list=0x0, buffer=<optimized out>, trans=0x7fff20061f80) at ../subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-stream.c:2586
 #8  check_transport_backlog (stream=0x7fff40019bf0, trans=0x7fff20061f80) at ../subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-stream.c:2645
 #9  0x00007ffff42793b3 in send_tcp_message (idx=<optimized out>, stream=0x7fff40019bf0) at ../subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-stream.c:2741
 #10 send_func (stream=0x7fff40019bf0) at ../subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-stream.c:2776
 #11 0x00007ffff7d59fad in g_thread_proxy (data=0x7fffbc062920) at ../subprojects/glib/glib/gthread.c:827
 #12 0x00007ffff7a8ce2d in start_thread () from /lib64/libc.so.6
 #13 0x00007ffff7b12620 in clone3 () from /lib64/libc.so.6

Fix by adding a cancellable lock and returning an extra reference used
across all read/write operations.  gst_rtsp_connection_flush() can free
the in-use cancellable and it will no longer affect any in progress
read/write.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2799>
2022-07-28 10:32:15 +00:00
Jan Schmidt 202c3bc4b1 video: Fix scaling in 4x horizontal co-sited chroma
4x downscaling of chroma with co-sited chroma has never worked
it seems.

Fixes incorrect videotestsrc output and videoconvert conversions
to Y41B, YUV9, YVU9 and IYU9 with co-sited chroma.

e.g.
gst-launch-1.0 videotestsrc ! video/x-raw,format=Y41B,width=1280,height=720 ! \
  videoconvert ! autovideosink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2789>
2022-07-23 09:28:32 +00:00
Seungha Yang 0cadd10474 videoaggregator: Don't force upstream alpha format
"video/x-raw,format=RGBA ! some-video-filter ! video/x-raw,format=NV12"
is a very common case and therefore such erroring at baseclass
does not seem to be a desired behavior.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2703>
2022-07-21 21:34:06 +00:00
Seungha Yang 953257782d video-converter: Use primaries compare function
Avoid conversion if both color primaries are functionally equal

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2765>
2022-07-18 08:56:45 +00:00
Seungha Yang 2ed64cad6a video-color: Add primaries and colorimetry compare functions
SMPTE 170M and 240M use the same RGB and white point coordinates
and therefore both primaries can be considered functionally
equivalent.
Also, some transfer functions have different name but equal
gamma functions. Adding another colorimetry compare function
to deal with thoes cases at once

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2765>
2022-07-18 08:56:45 +00:00
Jan Schmidt 3511be9a05 glupload: Add raw caps to sink pad when needed.
When checking if the current upload method can support
the requested caps filter in _transform_caps(),
make sure the sink pad reports raw caps.

Fixes #1311

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2725>
2022-07-12 09:30:46 +00:00
Jan Schmidt f8541b05aa gstglupload: Remove raw caps from individual methods
Raw memory upload should always be the least preferred input
caps, only added by the raw memory uploader as the last thing
in the caps.

Caps negotiation should still choose raw data when it needs to,
and other upload methods that can accept raw data buffers will still do so.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2725>
2022-07-12 09:30:46 +00:00
Mathieu Duponchelle 56ec817bf4 videoaggregator: always convert when user provides converter-config
The `converter-config` property may be used to perform cropping,
conversion should always be performed when the user set the property
to a non-NULL value.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2746>
2022-07-12 08:03:08 +00:00
Andoni Morales Alastruey 94e1ddad43 glwindow_cocoa: fix a leak of the GstNSView
This leak is also causing a leak of the GstGLCAOpenGLLayer
which leaks the GstGLWrappedContext and the GstGLDisplay

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2736>
2022-07-11 11:25:54 +00:00
Andoni Morales Alastruey 7db2a3cf11 gl: Fix leak of the whole CGL context
This was leaking the CGL context and several resources
allocated in the context, around 70MB for a 1080p clip

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2736>
2022-07-11 11:25:54 +00:00
Marc Leeman 18f2f83b4a base: lookup RGB format without alpha
librfb requests a colour space for depth 32 and bpp 32 with alpha set to
0x0, treat this the same as depth 24 with bpp 32.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2627>
2022-07-09 12:06:58 +00:00
Jan Schmidt 79d8b435d7 Revert "glupload: Fix caps query with no filter"
This reverts commit 6f9ae5d758.

The _transform_caps() function can't tell the difference
between the caller wanting to know the output caps
for the current method, or all possible output caps. If
it includes caps for all possible methods, glupload can
end up negotiating and sending the wrong output caps
downstream.

Partially reverts !2687
Fixes #1310

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2699>
2022-07-02 00:05:53 +10:00
Sebastian Dröge 3f71a467fc sdpmessage: Don't set SDP medias from caps without media/payload/clock-rate fields
Previously it would've silently failed reading the payload/clock-rate
and instead would've used some random value that happened to be on the
stack.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2689>
2022-06-30 09:28:27 +00:00
Jan Schmidt 6f9ae5d758 glupload: Fix caps query with no filter
If no filter caps are provided with a caps query, always
generate a full set of all caps from all upload methods,
not just the configured one. This is needed to handle
renegotiation when dealing with raw sysmem caps - as the upload
method might accept raw sysmem caps, but only the raw data
uploader adds those to the caps query.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2687>
2022-06-30 08:52:04 +00:00
Jan Schmidt de0e4b8fd6 Revert "glupload: allow system memory for dmabuf in transform_caps"
This reverts commit f3292dc156.

Only the raw data uploader should add sysmem caps to the
actual caps query, because we want them to be at the
lowest priority. If upstream does select to send raw
caps, then the correct upload method will still
be chosen because the accept_caps implementation
will accept them

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2687>
2022-06-30 08:52:04 +00:00
Jan Schmidt 342f02015b gl: Don't use the full transform_caps() method for reconfiguration check
When checking if we need to reconfigure when uploading, check
specifically the output caps of the current method will
result in compatible/incompatible caps, not the full set
of output caps from all upload methods.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2687>
2022-06-30 08:52:04 +00:00
Sebastian Dröge 7064404b1e video: Include new video-sei.h in video.h
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2688>
2022-06-30 08:42:43 +03:00
Xavier Claessens 18aa649f87 GstVideoFrame: Add g_auto() support
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2412>
2022-06-20 16:17:50 +00:00
Vivia Nikolaidou b90d02741e avviddec, video.c, h265parse: Workaround for broken field-based interlaced encoders
Some encoders (e.g. Makito) have H265 field-based interlacing, but then
also specify an 1:2 pixel aspect ratio. That makes it kind-of work with
decoders that don't properly support field-based decoding, but makes us
end up with the wrong aspect ratio if we implement everything properly.
As a workaround, detect 1:2 pixel aspect ratio for field-based
interlacing, and check if making that 1:1 would make the new display
aspect ratio common. In that case, we override it with 1:1.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2577>
2022-06-16 10:03:02 +00:00
Tim-Philipp Müller 9d9e59622f Bump GLib requirement to >= 2.62
Can't require 2.64 yet because of
https://gitlab.freedesktop.org/gstreamer/cerbero/-/issues/323

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2568>
2022-06-10 06:01:41 +00:00
Andoni Morales Alastruey efb8c5381c video: add new video-sei.h header to the list of video_headers
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1458>
2022-06-03 08:29:05 +00:00
Andoni Morales Alastruey 64a92b549d Fix documentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1458>
2022-06-03 08:29:05 +00:00
Brad Hards 804a6054bb h264parse: add unit test for Precision Time Stamp in SEI messages
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1458>
2022-06-03 08:29:05 +00:00
Brad Hards 9a2ce2683b h264parse: fix copying of data and UUID
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1458>
2022-06-03 08:29:05 +00:00
Andoni Morales Alastruey ca2eb9f65f h264parse: add support Precision Time Stamp in SEI messages
Expose User Data Unregistered as a new Meta and add
API to parse Precision Time Stamp (ST 0604).

Fixes #927

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1458>
2022-06-03 08:29:05 +00:00
Nicolas Dufresne f1756493d2 video: Fix NV12_16L32 size calculation
The subsampling of the second plane was not taken into account, resulting in a
16bit per pixel buffers instead of 12.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2512>
2022-05-31 16:23:01 +00:00
Eli Schwartz 79c3bbc2ed meson: use better zlib dependency fallback
zlib is required, and if it isn't found it is checked several ways and
then forced via subproject(). This code was added in commit
b93e37592a, to account for systems where
zlib doesn't have pkg-config files installed.

But Meson already does dependency fallback, and also, since 0.54.0, does
the in-between checks for find_library('z') and has_header('zlib.h') via
the "system" type dependency. Simplify dependency lookup by marking it
as required, which also makes sure that the console log doesn't
confusingly list "not found".

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2484>
2022-05-24 19:39:29 +00:00
Sebastian Dröge 39568918de pbutils: Add GST_PBUTILS_CAPS_DESCRIPTION_FLAG_METADATA and ONVIF XML Timed MetaData
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2453>
2022-05-20 13:01:44 +00:00
Thibault Saunier 3296c678b3 rtcpbuffer: Allow padding on first reduced size packets
It is valid to have the padding set to 1 on the first packet and it
happens very often from TWCC packets coming from libwebrtc. This means
that we were totally ignoring many TWCC packets.

Fix test that checked that a first packet with padding was not valid and
instead test a single twcc packet with padding to check precisely what
this patch was about.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2422>
2022-05-18 14:34:44 +00:00
Alicia Boya García bf9092592e appsink: Fix race condition on caps handling
Background:

Whenever a caps event is received by appsink, the caps are stored in the
same internal queue as buffers. Only when enough buffers have been
popped from the queue to reach the caps, `priv->sample` gets its caps
updated to match, so that they are correct for the following buffers.

Note that as far as upstream elements are concerned, the caps of appsink
are updated immediately when the CAPS event is sent. Samples pulled from
appsink retain the old caps until a later buffer -- one that was sent by
upstream elements after the new caps -- is pulled.

The race condition:

When a flush is received, appsink clears the entire internal queue. The
caps of `priv->sample` are not updated as part of this process, and
instead remain as those of the sample that was last pulled by the user.

This leaves open a race condition where:
1. Upstream sends a new caps event, and possibly some buffers for the
   new caps.
2. Upstream sends a flush (possibly from a different thread).
3. Upstream sends a new buffer for the new caps. Since as far as
   upstream is concerned, appsink caps are the new caps already, no new
   CAPS event is sent.
4. The appsink user pulls a sample, having not pulled before enough
   samples to reach the buffers sent in step 1.

Bug: the pulled sample has the old caps instead of the new caps.

Fixing the race condition:

To avoid this problem, when a buffer is received after a flush,
`priv->sample`'s caps should be updated with the current caps before the
buffer is added to the internal queue.

Interestingly, before this patch, appsink already had code for this, in
gst_app_sink_render_common():

    /* queue holding caps event might have been FLUSHed,
     * but caps state still present in pad caps */
    if (G_UNLIKELY (!priv->last_caps &&
            gst_pad_has_current_caps (GST_BASE_SINK_PAD (psink)))) {
      priv->last_caps = gst_pad_get_current_caps (GST_BASE_SINK_PAD (psink));
      gst_sample_set_caps (priv->sample, priv->last_caps);
      GST_DEBUG_OBJECT (appsink, "activating pad caps %" GST_PTR_FORMAT,
          priv->last_caps);
    }

This code assumes `priv->last_caps` is reset when a flush is received,
which makes sense, but unfortunately, there was no code in the flush
code path resetting it.

This patch adds such code, therefore fixing the race condition. A unit
test demonstrating the bug and testing its behavior with the fix has
also been added.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2413>
2022-05-17 08:49:30 +00:00
U. Artie Eoff c9417a1dea videoaggregator: unref temporary caps
The "possible_caps" needs unref after finished using to
avoid memory leak.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2430>
2022-05-16 22:38:13 +00:00
Matthew Waters a1f30f5b9b gl/context: disable timer queries for ARM Mali-G52
Performing a timer query with a default framebuffer that is incomplete
(from using a surfaceless context) will produce GL errors.  Disable the
timer query on this platform to avoid the errors.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2396>
2022-05-12 00:22:21 +00:00
Nicolas Dufresne 79ea87f256 opengl: Add NV12_4L4 conversion support
This format is produced notably by Hantro G1/G2 HW. Using a shader instead of
the Hantro embedded converter helps reduce drastrictly the memory usage at a
relatively small GPU overhead.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2190>
2022-05-02 19:10:43 +00:00
Nicolas Dufresne 39615e4f3c opengl: Add NV12_16L32S conversion support
This adds a first detiling shader with initial support for
NV12_16L32S as produced by Mediatek decoders.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2190>
2022-05-02 19:10:43 +00:00
Nicolas Dufresne 77a88c4572 glsl: Enable GLSL 1.30 if we have OpenGL 3.0/3.1
As implemented, we only support OpenGL 3 API from version 3.2. Though, there
is no issue enabling GLSL 1.30 even if we are going to restrict our API usage
to 2. This allows using texelFetch() on OpenGL 3.0 and 3.1 drivers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2190>
2022-05-02 19:10:43 +00:00
Nicolas Dufresne 4b4d607f4c opengl: Add low level support for tiled formats
This adds support for tiled format in stride and plane size
code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2190>
2022-05-02 19:10:43 +00:00
Nicolas Dufresne 6a6c3687f1 video: Port video frame to the new tile size helper
This is now moved to the library, so it can be used in multiple
places.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2190>
2022-05-02 19:10:43 +00:00
Nicolas Dufresne 8fcfc44c15 video: Add a helper to get the tile size information
Since the addition of tiling format with subsampled tile size
(NV12_16L32S), getting the tile width/height shifts and tile
size have become more complex. Add a helper to extract and
scale this information for the selected plane and format.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2190>
2022-05-02 19:10:43 +00:00
Nicolas Dufresne 04339c8df5 eglimage: Add missing NV21/61 support
Caps would allow that, but selecting this format would lead to
an "no reached" assertion in the code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2190>
2022-05-02 19:10:43 +00:00
Philippe Normand b8e3d167ea videodecoder: release stream lock after handling gap events
The stream lock is taken before handling gap events but was not released in all
possible runtime situations. This issue was introduced in:
https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1274

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2307>
2022-04-28 07:12:28 +00:00
Mathieu Duponchelle a03db32bbe rtpbasepayload: always store input buffer meta before negotiation
The decision to store the input buffer depends on whether extensions
are to be added to the output buffer, I assume as an optimization.

This creates an issue for subclasses that call negotiate(), where
header_exts is actually populated, from their handle_buffer()
implementation: at chain time, no header extension has been negotiated
yet, which means that we don't add extensions to the first batch of
buffers that comes out.

Keep track of whether negotiate has been called (this is different
from the negotiated field) and always store the input buffer until
then. This fixes the issue while largely preserving the optimization.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2304>
2022-04-27 08:43:30 +00:00
Xavier Claessens 1a0eea3299 Meson: Fix deprecation warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1876>
2022-04-23 00:33:00 +00:00
Mathieu Duponchelle 4ef3b1ad8f videoaggregator: keep old buffer when processing a MISSING_DATA gap
GAP events flagged with MISSING_DATA are transformed into GAP buffers
flagged with CORRUPTED.

In these cases, it is preferable to simply keep rendering the previous
buffer (if there was one) instead of flashing the pad in and out of
view.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/708>
2022-04-22 17:43:50 +00:00
Sebastian Dröge 06f90deb5f sdp: Parse the RFC5576 Source-specific media SDP attributes into caps
The format of the caps fields is
    ssrc-(SSRC_VALUE)-(ATTRIBUTE_NAME)=(ATTRIBUTE_VALUE)
.

Parsing of the attributes from the caps into the SDP is not implemented
as this depends not only a single stream's caps but on the whole rtpbin
configuration.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2132>
2022-04-20 14:40:25 +00:00
Xavier Claessens 82ca0e291b Delete unused i18n headers
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2028>
2022-04-19 18:01:06 +00:00
Xavier Claessens b99ecc78ca Replace gst-i18n-*.h with gi18n-lib.h
GLib guarantees libintl is always present, using proxy-libintl as
last resort. There is no need to mock gettex API any more.

This fix static build on Windows because G_INTL_STATIC_COMPILATION must
be defined before including libintl.h, and glib does it for us as part
as including glib.h.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2028>
2022-04-19 18:01:06 +00:00
Thibault Saunier c033f8fad2 cuda: Factor out a public GstCUDA library
So applications and elements implemented outside GStreamer can reuse
our infrastructure

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1472>
2022-04-19 16:39:43 +00:00
Nicolas Dufresne b7ded51382 video: Fix possible overrun when iterating comp[] array
Fix 2 iterations that can overrun the array if the number of component is
equal to the size of the array.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2239>
2022-04-19 11:12:42 -04:00
Nicolas Dufresne e0ad0eda23 Revert "video-frame: avoid possible out of bound memory access"
This reverts commit c4255f08f7.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2239>
2022-04-19 10:57:14 -04:00
Nirbheek Chauhan 97655eb8ac meson: Add -Wl,-rpath,${libdir} on macOS
We made the gstreamer installation prefix relocatable by picking up
plugins relative to the location of libgstreamer-1.0.dylib, similar to
how it's done for Windows:

https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1627

This had a lot of side-effects:

https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1051
https://gitlab.freedesktop.org/gstreamer/cerbero/-/issues/363
https://gitlab.freedesktop.org/gstreamer/cerbero/-/issues/371
https://gitlab.freedesktop.org/gstreamer/cerbero/-/issues/362

A partial fix for the cerbero side of these was:

https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/807

However, this relied on the consumers knowing that they need to add
`LC_RPATH` entries to the libdir of the prefix. This is done
automatically by build systems like Meson, but not by others, such as
Autotools, CMake, Cargo, XCode, etc. For those, we need to add the
RPATH entries to the gstreamer-1.0.pc file.

This also has the side-effect of fixing the loading of gstreamer rust
plugins on macOS:

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1159

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1149

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2218>
2022-04-19 12:11:17 +00:00
Camilo Celis Guzman c4255f08f7 video-frame: avoid possible out of bound memory access
Although the components' initialization code would fill in -1 to all
unset components, make the code a bit more defensive and check for an
index bound first.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2231>
2022-04-19 11:18:52 +00:00
Tim-Philipp Müller f515ee6bdf appsrc: fix annotations
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2188>
2022-04-15 23:49:40 +00:00
Sebastian Dröge fa070d20cf rtpbasepayload: Don't write header extensions if there's no corresponding input buffer for the packet
The GstRTPHeaderExtension API requires the input buffer to exist.

This can happen if the output packet is generated e.g. from a caps or
tags event like in the case for rtpgstpay.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2198>
2022-04-15 19:56:49 +03:00
Sebastian Dröge c1a3aaa3ec Fix transfer gobject-introspection annotation typos
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2160>
2022-04-12 12:43:08 +00:00
Mathieu Duponchelle 4c98e2d289 rtpbasepayload: fix transfer annotation for push and push_list
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2133>
2022-04-08 07:20:31 +00:00
hoonhee.lee 27b945aa03 riff-media: fix memory leak after usage for g_strjoin
This leak is observed with valgrind.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2129>
2022-04-07 20:36:42 +00:00
Nirbheek Chauhan bfe43121f1 appsrc: Clarify buffer ref semantics in signals
The documentation could be read to mean that the caller continuous to
'own' the buffer, and that there is some other mechanism to find out
when to unref it.

Clarify that "not taking ownership" here means "taking a reference",
and specify that you can unref it at any time after calling the
function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2110>
2022-04-05 14:40:21 +00:00
Xavier Claessens b004464ac6 Remove glib and gobject dependencies everywhere
They are part of gst_dep already and we have to make sure to always have
gst_dep. The order in dependencies matters, because it is also the order
in which Meson will set -I args. We want gstreamer's config.h to take
precedence over glib's private config.h when it's a subproject.

While at it, remove useless fallback args for gmodule/gio dependencies,
only gstreamer core needs it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2031>
2022-04-01 16:32:17 +00:00
Xabier Rodriguez Calvar 199b62570f glcolorconvert: should copy metadatas from the incoming buffer
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2094>
2022-04-01 13:07:46 +02:00
Thibault Saunier b358897a3b navigation: Rename parse_state to parse_modifier_state
`parse_state` sounds a bit weird and `parse_modifier_state` is clearer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2087>
2022-04-01 06:38:43 +00:00
Stéphane Cerveau 8492dd4255 base:gl: add x11 deps to gstglx11_dep
On MacOS with homebrew the xlib-xcb.h is in
own cellar /opt/homebrew/Cellar/libx11/1.7.3.1/include
Need to add the windowing dependencies to gl tests

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2061>
2022-04-01 00:43:54 +00:00
Edward Hervey 00187ddb0c pbutils: Fix wmv screen detection
strncmp vs !strncmp :)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2050>
2022-03-29 17:31:44 +00:00
Sebastian Dröge a4ea62ef5b video-format: Move NV12_8L128 into the correct position in GST_VIDEO_FORMATS_ALL
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2045>
2022-03-28 10:39:24 +03:00
Stéphane Cerveau 4f970bb811 gl: cocoa: fix warnings of unused variables
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2026>
2022-03-25 18:01:11 +00:00
Thibault Saunier 25819c41fb navigation: Add support for key Modifiers in all relevant events
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2010>
2022-03-25 15:16:03 +00:00
Vivienne Watermeier 09ebe06fdf navigation: Add missing annotation to send_event_simple
Adds the missing "transfer full" annotation for the event argument.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2017>
2022-03-24 18:07:16 +00:00
Vivienne Watermeier 01876d5712 navigation: Add API for touchscreen events
Add 5 new navigation event types for touchscreen events, with the same
naming and meaning as in libinput - touch-down, touch-motion, touch-up,
touch-frame and touch-cancel - as well as constructors and parse
functions for them.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1633>
2022-03-23 13:14:52 +00:00
Vivienne Watermeier f402b2e180 navigation: Add coordinate helper functions
Add a function to get x/y coordinates from suitable navigation events,
and one to create a copy with given coordinate values.

For e.g. translating event coordinates, this avoids having to either
switch on the event type to select the right parse function, or
having to rely on implementation details of the underlying event
structure.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1633>
2022-03-23 13:14:51 +00:00
Vivienne Watermeier 8648275601 navigation: Improve interface to avoid exposing implementation details
This deprecates the current send_event interface, and the wrapper
functions based on it, replacing it with a send_event_simple interface and
wrapper function. Together with the new event constructors, this avoids
implementations having to directly access the underlying structure.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1633>
2022-03-23 13:14:51 +00:00
Ming Qian 094d121812 video: Add support for linear 8x128 NV12 tiles and 10bit BE tiles
This adds linear 8x128 NV12 based tiles and NV12 10bit big endian tiles.
These formats are used by i.MX 8QXP/8QM VPU and exposed in V4L2.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1379>
2022-03-22 00:41:39 +00:00
Matthew Waters 203e34fb75 discoverer: chain up to parent finalize methods in all our types
Fixes a memory leak:

Direct leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x5ac5cd in malloc /src/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:129:3
    #1 0x1007007 in g_malloc /work/glib-2.72.0/_builddir/../glib/gmem.c:125:13
    #2 0xf82e82 in g_data_set_internal /work/glib-2.72.0/_builddir/../glib/gdataset.c:464:8
    #3 0xf833f7 in g_datalist_id_set_data_full /work/glib-2.72.0/_builddir/../glib/gdataset.c:670:3
    #4 0xef81be in g_object_notify_queue_freeze /work/glib-2.72.0/_builddir/../gobject/gobject.c:295:7
    #5 0xef79c6 in g_object_unref /work/glib-2.72.0/_builddir/../gobject/gobject.c:3632:16
    #6 0x5e58bf in LLVMFuzzerTestOneInput /src/gstreamer/ci/fuzzing/gst-discoverer.c:132:5
    #7 0x4dd1a2 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
    #8 0x4dc98a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3
    #9 0x4de6c4 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:809:5
    #10 0x4dea29 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:857:3
    #11 0x4ce4a0 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6
    #12 0x4f6f52 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
    #13 0x7f1c709980b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b2)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1984>
2022-03-18 17:49:08 +00:00
Corentin Noël a5249f7c5f gst-plugins-base: Fix several annotations
Add annotations for virtual methods when possible.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1965>
2022-03-16 10:37:44 +00:00
Nirbheek Chauhan 1ae7ea508d rtpbuffer: The out args for rtp extension data are optional
The code checks that these are != NULL before dereferencing them.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1962>
2022-03-16 02:48:34 +00:00
Bastien Nocera bd39ad4519 convertframe: Add support for GL-memory backend GstFrame input
Add "gldownload" early in the pipeline so that GL-memory backed raw
frames can be downloaded and processed on the CPU.

Closes: #1073
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1916>
2022-03-15 20:31:24 +00:00
Xavier Claessens 0fa7923937 Meson: Set install_tag on some files
Meson tries to guess the tag (runtime, devel, etc) for every installed
file, but it cannot guess them all. There is a list at the end of
meson-log.txt of files we need to tag manually.

See https://mesonbuild.com/Installing.html#installation-tags.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1934>
2022-03-14 08:56:54 -04:00
Edward Hervey bce779e66d pbutils: Add function to parse RFC 6381 codecs field
This is the opposite of `gst_codec_utils_caps_get_mime_codec()`, which allows
elements to get the `GstCaps`

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1894>
2022-03-11 07:14:33 +00:00
Nirbheek Chauhan 146111d7c2 rtpbasepayload: Remove dead twcc code
This feature was removed in 7a53fbad68,
but this code was left behind.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1902>
2022-03-10 11:27:49 +00:00
Edward Hervey 0d617885f1 tagdemux: Properly propagate sequence numbers
If we received a time segment from upstream, we need to make sure we propagate
it downstream with the same sequence number.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1903>
2022-03-09 23:58:07 +00:00
Seungha Yang 16f37f8b9c gldisplay: Reorder GST_GL_WINDOW check for egl-device
"egl-device" should be checked before the "egl", otherwise unexpected egl will be picked

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1853>
2022-03-04 13:34:34 +00:00
Matthew Waters 207769edbb sdp: support multiple rid parameters
As specified formally in RFC8851

Each rid description is placed in its own caps field in the structure.
This is very similar to the already existing extmap-$id sdp<->caps
transformations that already exists.

The mapping is as follows:

  a=rid:0 direction ';'-separated params

where direction is either 'send' or 'recv'

gets put into a caps structure like so:

   rid-0=(string)<"direction","param1","param2",etc>

If there are no rid parameters then the caps structure is generated to
only contain the direction as a single string like:

   rid-0=(string)direction

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1760>
2022-03-03 03:34:38 +00:00
Sebastian Fricke 0b6bbce012 Remove the uninstalled term
Remove the symbolic link `gst-uninstalled` which points to `gst-env`.
The `uninstalled` is the old name and the project should stick to a
single name for the procedure.
Remove the term from all the files, exceptions are variables from
dependencies like `uninstalled_variables` from pkgconfig and
`meson-uninstalled`.
Adjust mentions of the script in the documentation and README.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1743>
2022-03-01 11:33:10 +00:00
Célestin Marot cabff7a20f video-info: encoded format can have RGB color-matrix (Fixes #1435)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1435>
2022-02-28 16:05:43 +00:00
Sebastian Dröge 6c3642da49 video-format-info: Use correct parameter name in gst_video_format_info_extrapolate_stride() docs
../subprojects/gst-plugins-base/gst-libs/gst/video/video-format.c:7570: Warning: GstVideo: gst_video_format_info_extrapolate_stride: unknown parameter 'info' in documentation comment, should be 'finfo'

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1803>
2022-02-27 13:19:49 +02:00
Sebastian Dröge 3941eb7dbd audioconvert: Add dithering-threshold property
By default, no dithering is applied if the target bit depth is above 20
bits. This new property allows to apply dithering nonetheless in these
cases.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1730>
2022-02-25 19:32:28 +00:00
Sebastian Dröge e119cdee3b audio-quantize: Switch dither PRNG from LCG to xorshift
While this is slightly more expensive (~48% slower per random number) it
does not cause any measurable difference when running through a complete
audio conversion pipeline.

On the other hand its random numbers are of much higher quality and on
spectrograms for 32 bit to 24 bit conversion the difference is clearly
visible.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1729>
2022-02-25 12:41:18 +00:00
Jan Alexander Steffens (heftig) 4567d569ca videoaggregator: Correct use of start_time/end_time
When 29713c5d changed most uses of `start_time` and `end_time` to
`start_running_time` and `end_running_time`, it missed two.

Fixes: 29713c5d40
Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1038
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1779>
2022-02-22 16:00:54 +00:00
Sebastian Dröge 2d134c0432 rtpbasepayload: Copy all buffer metadata instead of just GstMetas for the input meta buffer
This gives RTP header extensions some more metadata to work from.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1774>
2022-02-22 10:54:23 +02:00
Sebastian Dröge a10b35c011 gl: Mark GL memory GType functions as deprecated
They can't be used in any useful way. The type of every GstMemory is
always GST_TYPE_MEMORY and the subtyping relationship has to be
implemented on top of that via the associated allocator and mem_type
string.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1764>
2022-02-21 21:26:43 +00:00
Sebastian Dröge bd867aea4f gl: Add #ifndef GST_REMOVE_DEPRECATED for existing deprecated API
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1764>
2022-02-21 21:26:43 +00:00
Sebastian Dröge 5acb8ac559 gl: Add versioned Deprecated marker to gst_gl_display_find_window
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1764>
2022-02-21 21:26:43 +00:00
Sebastian Dröge 5d8705437d gl: Replace existing G_DEPRECATED_FOR usage with GST_GL_DEPRECATED_FOR
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1764>
2022-02-21 21:26:43 +00:00
Sebastian Dröge 6d83665d7a gl: Add GST_GL_DEPRECATED
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1764>
2022-02-21 21:26:43 +00:00
Sebastian Groß 6372aaa608 audiovisualizer: shader: Fix dframe out of bound write
shader_fade_and_move_horiz_out writes a complete stride at the end of its
dframe data

This led to SIGSEGV since the stride reached into sframe->map[0]->memory
which could not be umpapped later on.

This is due to `d` is increased twice. Once at the end of the upper loop
and at the start of the lower loop.
The corresponding dframe stride is therefore skipped.

Rewind `d` and start at the correct position.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1702

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1751>
2022-02-21 08:20:44 +01:00
Nicolas Dufresne fa1f042d1d video: Add an helper to extrapolate strides
Many of the legacy APIs, specifically in the Linux Kernel, have a
single stride for the pictures. In this context, it is common
to extrapolate the other strides based on the selected pixel
format. Such function have been copy pasted from video4linux2
plugin into wayland, kms and v4l2codecs plugins.

This patch implements a generalized from of that function and
make it available to everyone through the video library.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1567>
2022-02-20 22:32:55 +00:00
Nicolas Dufresne c9b127dae3 video: Add NV12_16L32S aka Mediatek MM21 support
Unlike other simple tiled formats, the Mediatek HW use different tile size
per-plane. The tile size is scaled according to the subsampling. Effectively,
using the name 16L32S to represent linearly layout tiles of size 16x32 bytes
in the Y plane, and 16x16 in the UV plane. In order to make this specificity
discoverable, a new SUBTILES flags have been added.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1567>
2022-02-20 22:32:55 +00:00
Seungha Yang a0dc29841c videoaggregator: Use floor() to calculate current position
... instead of round(). Depending on framerate, calculated position
may not be clearly represented by using uint64, 30000/1001 for example.
Then the result of round() can be sliglhtly larger (1ns) than
buffer timestamp. And that will cause unnecessary frame delay.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1747>
2022-02-19 06:53:02 +00:00
Nicolas Dufresne 6bd1f2753a base: audioencoder: Keep serialize event behind buffers
If a serialized event arrives behind a buffer, it should not be send before
it. This fixes the pending event handling so that only early pending events,
the one that arrrived or was generated while the adapter was empty get send
before pushing buffer. All other events are not pushed after.

This issue lead the latency tracer to think our audio encoder did not have any
latency. This was testing with opusenc in a live pipeline.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1266>
2022-02-18 14:40:29 -05:00
Seungha Yang 04f3a2bd22 gstinfo,ptpclock,libcheck: Use GetCurrentProcessId() instead of getpid() on Windows
getpid() shouldn't be used in case of UWP. Use GetCurrentProcessId()
instead which provides exactly the same functionality and can be
used with UWP as well.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1006>
2022-02-16 17:03:29 +00:00