Commit graph

735 commits

Author SHA1 Message Date
Corentin Noël 7b1958c8de pushsrc: Add missing annotations
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1392>
2021-11-30 02:28:15 +00:00
Corentin Noël 4e2e8492c9 bitwriter: Add missing annotations
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1392>
2021-11-30 02:28:15 +00:00
Corentin Noël 6da9285158 baseparse: Add missing annotations
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1392>
2021-11-30 02:28:15 +00:00
Nicolas Dufresne 4ca7f1e014 v4l2codecs: h264: Fix typo in comment
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1387>
2021-11-30 00:28:34 +00:00
Nicolas Dufresne 83933b7772 v4l2codecs: h264: Properly set pic_num/frame_num
The V4L2 uAPI uses pic_num for both PicNum and ShortTermPicNum. It also
doe the same for both FrameNum and LongTermFrameIdx. This change does
not change the fluster score, but fixed a visual corruption noticed
with some third party streams.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1387>
2021-11-30 00:28:34 +00:00
He Junyan b5c07e11ca va: Use a lock to protect the surface copy by using vpp.
If we use vpp to do the surface copy, its operation is not atomic.
 We need to maintain the filter's context unchanged during the whole
 copy progress.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1373>
2021-11-29 19:25:31 +00:00
He Junyan 954f7cf88c va: Use the GstVaSurfaceCopy of the allocator atomically.
The mem_copy() of the allocator can be called simultaneously from
different threads. We should use atomic pointer operations to create
and use the GstVaSurfaceCopy of the allocator.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1373>
2021-11-29 19:25:31 +00:00
He Junyan 7f31dcf084 va: DMA allocator: Set the copied memory properly when popped from pool.
The current code does not set the copied memory correctly when it is popped
from the surface cache pool.
1. We forget to ref the allocator, which causes the allocator to be freed
   unexpected, and we get a crash later because of the memory violation.
2. We forget to add ref_mems_count, which causes the surface leak because
   the surface can not be pushed back to the cache pool again.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1373>
2021-11-29 19:25:31 +00:00
Daniel Almeida 285695ee52 v4l2codecs: gstv4l2decoder: set minimum sizeimage
Set minimum sizeimage such that there is enough space for any overhead
introduced by the codec.

Notably fix a vp9 issue in which a small image would not have a
bitstream buffer large enough to accomodate it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1012>
2021-11-29 17:41:19 +00:00
Daniel Almeida 120b96a974 v4l2codecs: gstv4l2codecsvp9dec: implement a render delay
The v4l2 backend support delayed output for performance reasons.
It is then possible to use render delays to queue multiple requests
simultaneously, thus increasing performance.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1012>
2021-11-29 17:41:19 +00:00
Daniel Almeida ccab90773f v4l2codecs: vp9dec: Implement VP9 v4l2 decoder
Implement a v4l2 based vp9 decoder element based on the preexisting vp8
v4l2 decoder.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1012>
2021-11-29 17:41:19 +00:00
Daniel Almeida c51d74ae3a v4l2codecs: update to the new uAPI
The new VP9 stateless API is in its way to be destaged. Update our
headers to match.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1012>
2021-11-29 17:41:19 +00:00
Daniel Almeida a2b0837bc5 codecs: gstvp9decoder: copy frame->system_frame_number into picture
A comment in gstvp9picture.h states that picture->system_frame_number
should get its value from frame->system_frame_number, but in fact
it was never copied at all.

Fix it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1012>
2021-11-29 17:41:19 +00:00
Daniel Almeida 98dc7a64a0 codecs: gstvp9{decoder|statefulparser}: optionally parse compressed headers
Rework gstvp9{decoder|statefulparser} to optionally parse compressed headers.
The information in these headers might be needed for accelerators
downstream, so optionally parse them if downstream requests it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1012>
2021-11-29 17:41:19 +00:00
Wim Taymans 9aaef931bf v4l2: handle 0x0 sizes gracefully
Also ignore 0x0 sizes in the fallback case and assume the size can be
anything between 1x1 and MAXxMAX.

This fixes the case where a width=0, height=0 caps are created. Whith
this patch the caps will contain width=[1,MAX], height=[1,MAX].

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1396>
2021-11-29 15:35:36 +01:00
Mathieu Duponchelle e90859f4d8 webrtcbin: deduplicate extmaps
When an extmap is defined twice for the same ID, firefox complains and
errors out (chrome is smart enough to accept strict duplicates).

To work around this, we deduplicate extmap attributes, and also error
out when a different extmap is defined for the same ID.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1383>
2021-11-25 18:38:22 +00:00
He Junyan d867180b4e codecs: mpeg2decoder: drain() only when significant sequence changes.
There are a lot of info in the mpeg2's sequence(also including ext
display_ext and scalable_ext). We need to notify the subclass about
its change, but not all the changes should trigger a drain(), which
may change the output picture order. For example, the matrix changes
in sequence header does not change the decoder context and so no need
to trigger a drain().

Fixes: #899
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1375>
2021-11-24 14:42:57 +00:00
Seungha Yang 2a17618dcc openjpegenc: Fix build warning
Compiling C object subprojects/gst-plugins-bad/ext/openjpeg/gstopenjpeg.dll.p/gstopenjpegenc.c.obj
../subprojects/gst-plugins-bad/ext/openjpeg/gstopenjpegenc.c(416):
  warning C4133: '=': incompatible types - from 'GstFlowReturn (__cdecl *)(GstVideoEncoder *,GstVideoCodecFrame *)' to
  'gboolean (__cdecl *)(GstVideoEncoder *,GstVideoCodecFrame *)'

../subprojects/gst-plugins-bad/ext/openjpeg/gstopenjpegenc.c(418):
  warning C4133: '=': incompatible types - from 'GstFlowReturn (__cdecl *)(GstVideoEncoder *,GstVideoCodecFrame *)' to
  'gboolean (__cdecl *)(GstVideoEncoder *,GstVideoCodecFrame *)'

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1378>
2021-11-24 13:11:23 +00:00
Mathieu Duponchelle 4412198c05 rtpfunnel: fix extmap handling on accept-caps
Follow-up on 97d83056b3, only check
for intersection with the current srccaps when checking if a sinkpad
can accept caps.

I must have been lucky in my firefox testing then, and always entered
the code path with audio getting negotiated first, thus not failing
the is_subset check when srccaps had been negotiated as
application/x-rtp, and an accept-caps query was made for the video
caps with a defined extmap.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1384>
2021-11-23 20:26:30 +00:00
Krystian Wojtas 423acef4d9 tutorials: Fix typos
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1382>
2021-11-23 19:56:27 +01:00
Guillaume Desmottes d67a63a298 gssink: add metadata property
This property can be used to set metadata on the storage object.

Similar API has been added to the S3 sink already, see
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/613

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1377>
2021-11-23 16:00:53 +01:00
Corentin Noël 578fddbf58 basesrc: Add annotation to virtual methods with (out) parameters
This allows to actually use these virtual methods from the GObject introspection.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1376>
2021-11-23 08:54:01 +00:00
Seungha Yang ffa8aff6b1 d3d11: Update comments
Remove copy & paste mistake (this is not GstGL) and add more
description.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1374>
2021-11-23 07:23:12 +00:00
Víctor Manuel Jáquez Leal 5e3bf0fff7 vapostproc, vadeinterlace: don't transform caps if no intersection.
If caps to transform don't intersect with those supported by the VA
filter (VAEntrypointVideoProc) then return them as is, because only
pass-through mode is the only possibility.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1369>
2021-11-22 15:27:10 +00:00
Víctor Manuel Jáquez Leal 68379649db vapostproc: Append featured caps rather than merge.
So it would be possible to honor upstream preference.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1369>
2021-11-22 15:27:10 +00:00
Víctor Manuel Jáquez Leal 718e83ed4c vapostproc: Remove dead code.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1369>
2021-11-22 15:27:10 +00:00
Víctor Manuel Jáquez Leal 26040bd932 va: filter: Validate input parameter in internal function.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1369>
2021-11-22 15:27:10 +00:00
Víctor Manuel Jáquez Leal 8377463128 va: allocator: log drm modifier
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1369>
2021-11-22 15:27:10 +00:00
He Junyan a14f0da324 va: vpp: Fix the memory leak in fixate_caps().
For the BaseTransform class, the function of fixate_caps(), takes
the ownership of "othercaps". So we should clear it in our subclass.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1372>
2021-11-22 10:54:23 +00:00
Jean Felder f8bc5e89fd id3v2mux: Map GST_TAG_MUSICBRAINZ_RELEASETRACKID
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1342>
2021-11-22 09:57:16 +00:00
Jean Felder 941e1b8343 id3v2mux: Map GST_TAG_MUSICBRAINZ_RELEASEGROUPID
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1342>
2021-11-22 09:57:16 +00:00
Philippe Normand ee7fe545b2 player: Ensure the GstPlay is created before the wrapped renderer
The GstPlayerWrappedVideoRenderer implicitely depends on GstPlay.

Fixes #878

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1345>
2021-11-20 10:15:49 +00:00
Philippe Normand 12a5bf64f8 play: Allow runtime configuration of video-renderer
This is a requirement for GstPlayer when using the default overlay interface
provided by the pipeline. The GstPlayerWrappedVideoRenderer requires a valid
pipeline, but that's available only after the GstPlay thread has successfully
started.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1345>
2021-11-20 10:15:49 +00:00
He Junyan c2bffe22f3 va: decoder: Also ref the display when duplicating pictures.
The _destroy_buffers() will check the display handle using the
g_return_val_if_fail. we should not generate the invalid pointer
warning.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1368>
2021-11-19 14:40:18 +00:00
Seungha Yang 53391d2b8d docs: Update doc cache for Windows specific plugins
Updating doc cache for d3d11, mediafoundation and wasapi2 plugins

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1360>
2021-11-19 13:38:19 +00:00
Seungha Yang 7f796b10b2 wasapi2: Fix typo in doc
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1360>
2021-11-19 13:38:19 +00:00
Seungha Yang 6acf89b3d3 mediafoundation: Skip doc for non-default encoder elements
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1360>
2021-11-19 13:38:19 +00:00
Seungha Yang 7fe08d8bed d3d11: Stop doc for non-default decoder and deinterlacer elements
Just skip doc for non-default decoder/deinterlacer elements
since there are multiple element in case that system has
multiple GPUs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1360>
2021-11-19 13:38:19 +00:00
Seungha Yang 97c7fec8be gst: Add APIs to allow documentation for element to be skipped
Dynamically registered elements (hardware element in most cases)
may or may not be available on a system and properties may be different
per system.
This new API will make documentation skipping possible in programmable way.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1360>
2021-11-19 13:38:18 +00:00
Wonchul Lee ae7a365274 d3d11: Fix deadlock while doing unprepare
ShowWindow() could be blocked while doing gst_d3d11_window_win32_unprepare
when external window handle provided to d3d11videosink in multi-threaded
environment.
The condition that issue happened is, UI thread is waiting for a
background thread that changes d3d11videosink state to NULL, and the
background thread would try to send a window message to the queue.
The queue is already occupied by the UI thread, so the background
thread will be blocked.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1366>
2021-11-19 13:42:53 +09:00
Thomas Klausner 0b0bc5956d tcp: fix build on Solaris
Add missing header.

From Claes Nästén via http://gnats.netbsd.org/56509

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1364>
2021-11-19 00:07:42 +00:00
Tobias Reineke 9e2f679ae1 shout2: Add compatibility for libshout >= 2.4.2
In libshout >=2.4.2 shout_open() can return SHOUTERR_RETRY in addition
to SHOUTERR_BUSY.

The nonblocking example in libshout fixes the problem in a similar
way, as mentioned by the author in this issue:
https://gitlab.xiph.org/xiph/icecast-libshout/-/issues/2316

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1363>
2021-11-19 04:23:35 +05:30
Víctor Manuel Jáquez Leal 92f8b54657 vaapi: libs: Use unsized arrays as parameters.
Instead of defining a sized array for function signature, use it
unsized (a pointer alias, basically). In this way clang warning is
silenced:

warning: ‘fill_profiles’ accessing 64 bytes in a region of size 12 [-Wstringop-overflow=]

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1357>
2021-11-18 07:32:26 +00:00
Víctor Manuel Jáquez Leal 2d5a10f6a6 vaapi: meson: Fail if static build.
And initialize the plugin array.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1357>
2021-11-18 07:32:26 +00:00
Thibault Saunier f95f63c5af python: Avoid treating float as int
Since python 3.10 implicit conversion to integers using `__int__` as
been completely removed (was deprecated behavior in 3.9) so we need
to cleanly handle it now.

See https://gitlab.gnome.org/GNOME/pitivi/-/issues/2589

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1358>
2021-11-18 00:19:46 +00:00
Ung, Teng En 219d757ac5 vaapipostproc: fix mising metadata when using system
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1325>
2021-11-17 10:35:05 +00:00
Matthew Waters 55e04d129f qmlglsink: fix another resize case
If qt asks us to redraw before we have both set a buffer and caps we
would attempt to use the new caps with the old buffer which could result
in bad things happening.

Only update caps from new_caps once the buffer has actually been set.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1346>
2021-11-17 03:08:14 +00:00
Philippe Normand a6fd767025 wpevideosrc: Fix frame stuttering in GL rendering path
Make sure the EGLImage we're rendering to the GL memory stays alive long enough,
until the the GL memory has been destroyed.

This change fixes tearing and black flashes artefacts that were happening
because the EGLImage was sometimes destroyed before the sink actually rendered
the associated texture.

Fixes #889

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1354>
2021-11-16 21:55:41 +00:00
Philippe Normand 053dd564a1 wpevideosrc: Run through gst-indent
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1354>
2021-11-16 21:55:41 +00:00
Sebastian Dröge 5dc95e00fa gstinfo: Add gst_debug_log_literal() function
This takes a plain message string and not a format string, and as a
result doesn't have to be passed through vasprintf() and lead to further
unnecessary allocations. It can also contain literal `%` because of
that.

The new function is mostly useful for bindings that would have to pass a
full string to GStreamer anyway and would do formatting themselves with
language-specific functionality.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1356>
2021-11-16 16:32:55 +00:00
Trung Do a87be69ce5 v4l2: Update fmt if padded height is greater than fmt height
If padded height is greater, buffer bytesused could be larger than plane length,
and cause VIDIOC_QBUF failure.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1355>
2021-11-16 10:46:29 -05:00
Víctor Manuel Jáquez Leal 6d7dc93a45 uridecodebin3: Nullify current item after all play items are freed.
There's a potential race condition with this sort of pipelines on
certain systems (depends on the processing load):

GST_DEBUG_DUMP_DOT_DIR=/tmp \
gst-launch-1.0 uridecodebin3 uri=file://stream.mp4 ! glupload ! \
glimagesink --gst-debug=*:4

Right after the pipeline passes from PAUSED to READY, bin_to_dot_file
dumps uridecodebin3 properties, but current uri and suburi might be
already freed, causing a potential use-after-freed.

This patch makes NULL the current item right after all the play items
are freed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1353>
2021-11-16 13:25:02 +01:00
Thibault Saunier 3729704132 gst: Fix license headers and add SPDX
Fixes https://gitlab.freedesktop.org/gstreamer/gst-python/-/issues/57

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1351>
2021-11-15 22:12:09 -03:00
Daniel Knobe 74957bfd50 caps: fix type of return value if string is null in gst_caps_from_string
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1348>
2021-11-15 10:56:43 +00:00
Mathieu Duponchelle 97d83056b3 rtpfunnel: don't enforce twcc during upstream negotiation
A previous patch has caused rtpfunnel to output twcc-related
information downstream, however this leaked into upstream
negotiation (through funnel->srccaps), causing payloader to
negotiate twcc caps even when not prompted to do so by the user.

Fix this by only enforcing that upstream sends us application/x-rtp
caps as was the case originally.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1278>
2021-11-12 18:40:32 +00:00
Mathieu Duponchelle 72118b9db4 rtptwcc: complete bufferlist fix
When dealing with bufferlists, we need to store one "SentPacket"
structure per buffer, not one per buffer list!

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1278>
2021-11-12 18:40:32 +00:00
Sebastian Dröge efb2b6d478 qtdemux: Log cslg_shift that was determined
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1294>
2021-11-12 17:51:04 +00:00
Sebastian Dröge 12e918428a qtdemux: Use a composition time offset of 0 for "no decode samples" for the time being
This needs codec-specific handling, but using 0 instead of G_MININT32 at
least gives somewhat reasonable behaviour.

See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/883

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1294>
2021-11-12 17:51:03 +00:00
Sebastian Dröge ad412d257b qtdemux: Always check ctts for unreasonably large offsets
If this happens then ignore the whole ctts. Previously we only did this
if the PTS/DTS shift was determined from the ctts instead of the cslg.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1294>
2021-11-12 17:51:03 +00:00
Sebastian Dröge 93a10a4ba1 qtdemux: Dump composition time offsets in trun as signed integers
Just like we do for ctts without regard of the version of the box.
Huge offsets are interpreted as negative offsets by qtdemux so this
works.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1294>
2021-11-12 17:51:03 +00:00
Sebastian Dröge a6f3391c81 qtdemux: Add a comment why only positive cslg shifts are considered
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1294>
2021-11-12 17:51:03 +00:00
Sebastian Dröge a33e30cfc4 qtdemux: Only adjust segment.stop by cslg_shift if stop is not -1
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1294>
2021-11-12 17:51:03 +00:00
Sebastian Dröge bb5a5ae8a8 qtdemux: Handle negative composition offsets in the trun box the same way as for non-fragmented streams
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1294>
2021-11-12 17:51:03 +00:00
Sebastian Dröge 767e8bf668 qtdemux: Parse ctts version
Negative composition time offsets are only allowed with version 1 of the
box, however we parse it as a signed value also for version 0 boxes as
unfortunately there are such files out there and it's unlikely to have
(valid) huge composition offsets.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1294>
2021-11-12 17:51:03 +00:00
Sebastian Dröge 284dd5443f qtdemux: Add support for version 1 cslg boxes
They use 64 bit fields instead of 32 bit.

Also parse offset as a signed integer (in both versions) and clamp it to
a positive value as negative values don't really interest us here.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1294>
2021-11-12 17:51:03 +00:00
Sebastian Dröge 7f105a919a qtdemux: Don't free cslg data that we don't own on corrupt files
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1294>
2021-11-12 17:51:03 +00:00
Nirbheek Chauhan 5d3009b7f8 audio-resampler: Fix segfault when we can't output any frames
Sometimes the resampler has enough space to store all the incoming
samples without outputting anything. When this happens,
gst_audio_resampler_get_out_frames() returns 0.

In that case, the resampler should consume samples and just return.
Otherwise, we get a segfault when gst_audio_resampler_resample() tries
to resample into a NULL 'out' pointer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1343>
2021-11-12 16:12:27 +00:00
Rafał Dzięgiel 41385ab6f7 matroska: Ref index table when updating track info
Track index table array was being lost during track info update.
Ref it over to updated info, so it can be used for finding
nearest seek points.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1203>
2021-11-12 12:28:40 +00:00
Rafał Dzięgiel 478f94edc7 matroska: Use g_array_unref everywhere
Instead of using g_array_free which is not thread safe use g_array_unref instead

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1203>
2021-11-12 12:28:40 +00:00
Tim-Philipp Müller 972615cf22 docs: fix unnecessary ampersand, < and > escaping in code blocks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1340>
2021-11-12 11:39:19 +00:00
Mathieu Duponchelle 792fb05cec st2022-1-fecdec: fix packet trimming
g_sequence_remove_range's end iter is exclusive, so if one
wants to remove that item as well, it should be called with
the next iter.

This could in theory fix an issue where:

* The sequence isn't entirely trimmed, with an old item lingering

* Following FEC packets are immediately discarded because they
  arrived later than corresponding media packets, long enough for
  seqnums to wrap around

* We now try to reconstruct a media packet with a completely obsolete
  FEC packet, chaos ensues.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1341>
2021-11-12 08:15:28 +00:00
Matthew Waters d2fd5f1534 qmlsink: support caps changes better
We need to hold onto the last buffer until the next buffer arrives.
Before, if a caps change comes we would remove the currently rendering
buffer.  if Qt asks use to render something, we would render the dummy
black texture.

Fixes a period of black output when upstream is e.g. changing resolution
as in hls adaptive bitrate scenarios.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1338>
2021-11-12 07:17:17 +00:00
James Cowgill 1e27ea63af v4l2: Record buffer states in pool to fix dequeue race
The `gst_v4l2_buffer_pool_dqbuf` function contains this ominous comment:

    /* get our GstBuffer with that index from the pool, if the buffer was
     * outstanding we have a serious problem.
     */
    outbuf = pool->buffers[group->buffer.index];

Unfortunately it is common for buffers in _output_ buffer pools to be
both queued and outstanding at the same time. This can happen if the
upstream element keeps a reference to the buffer, or in an encoder
element itself when it keeps a reference to the input buffer for each
frame.

Since the current code doesn't handle this case properly we can end up
with crashes in other elements such as:

    (gst-launch-1.0:32559): CRITICAL **: 17:33:35.740: gst_video_frame_map_id: assertion 'GST_IS_BUFFER (buffer)' failed

and:

    (gst-launch-1.0:231): GStreamer-CRITICAL **: 00:16:20.882: write map requested on non-writable buffer

Both these crashes are caused by a race condition related to releasing
the same buffer twice from two different threads. If a buffer is queued
and outstanding this situation is possible:

**Thread 1**
- Calls `gst_buffer_unref` decrementing the reference count to zero.
- The core GstBufferPool object marks the buffer non-outstanding.
- Calls the V4L2 release buffer function.
- If the buffer is _not_ queued:
  - Release it back to the free pool (containing non-queued buffers).

**Thread 2**
- Dequeues the queued output buffer.
  - Marks the buffer as not queued.
- If the buffer is _not_ outstanding:
  - Calls the V4L2 release buffer function.
  - Release it back to the free pool (containing non-queued buffers).

If both of these threads run at exactly the same time there is a small
window where the buffer is marked both not outstanding and not queued
but before it has been released. In this case the buffer will be freed
twice causing the above crashes.

Unfortunately the variable recording whether a buffer is outstanding is
part of the core `GstBuffer` object and is managed by `GstBufferPool` so
it's not as straightforward as adding a mutex. Instead we can fix this
by additionally recording the buffer state in `GstV4l2BufferPool`, and
handle "internal" and "external" buffer release separately so we can
detect when a buffer becomes not outstanding.

In the new solution:
- The "external" buffer pool release and the "dqbuf" functions
  atomically update the buffer state and determine if a buffer is still
  queued or outstanding.
- Subsequent code and a new
  `gst_v4l2_buffer_pool_complete_release_buffer` function can proceed to
  release (or not) a buffer knowing that it's not racing with another
  thread.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1010>
2021-11-11 22:30:31 +00:00
Xavier Claessens ffcf697c2d gst-python: Add option to disable python plugin
It is not always needed, at least Ubuntu package it separately and don't
install it by default. Also when doing a static build there is an
unavoidable warning otherwise.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1337>
2021-11-10 13:38:04 -05:00
Timo Wischer 8e7ce64a6e avtp: crf: Process also local CRF streams
Without this patch locally generated CRF streams will be ignored.
Therefore the same network interface could not be CRF talker and
CRF listener.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1074>
2021-11-10 16:53:04 +00:00
Olivier Crête 27808444ea webrtc janus rust: Update extra dependencies
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1332>
2021-11-10 16:13:38 +00:00
Olivier Crête 5ab09323cd webrtc multiparty rust: Upgrade all other deps
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1332>
2021-11-10 16:13:38 +00:00
Olivier Crête c592f75cdd webrtc sendrecv rust: Upgrade all other deps
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1332>
2021-11-10 16:13:38 +00:00
Olivier Crête 26e8624c9b webrtc multiparty rust: Port to bindings 0.17 version
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1332>
2021-11-10 16:13:38 +00:00
Olivier Crête 93032b2ecc webrtc sendrecv rust: Port to bindings 0.17 version
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1332>
2021-11-10 16:13:38 +00:00
Jiri Uncovsky 9abac91c96 glcontext/egl: add missing unref
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1328>
2021-11-10 15:27:45 +00:00
Matthew Waters 71dd47516c rtpbin: separate out the two fec decoder locations
The pipeline flow for receiving looks like this:

rtpsession ! rtpssrcdemux ! session_fec_decoder ! rtpjitterbuffer ! \
  rtpptdemux ! stream_fec_decoder ! ...

There are two places where a fec decoder could be placed.
1. As requested from the 'request-fec-decoder' signal: after rtpptdemux
   for each ssrc/pt produced
2. after rtpssrcdemux but before rtpjitterbuffer: added for the
   rtpst2022-1-fecenc/dec elements,

However, there was some cross-contamination of the elements involved and
the request-fec-decoder signal was also being used to request the fec
decoder for the session_fec_decoder which would then be cached and
re-used for subsequent fec decoder requests.  This would cause the same
element to be attempted to be linked to multiple elements in different
places in the pipeline.  This would fail and cause all kinds of havoc
usually resulting in a not-linked error being returned upstream and an
error message being posted by the source.

Fix by not using the request-fec-decoder signal for requesting the
session_fec_decoder and instead solely rely on the added properties for
that case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1300>
2021-11-10 10:38:26 +00:00
Jean Felder bd91286a3b id3tag: Map GST_TAG_MUSICBRAINZ_RELEASETRACKID
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1331>
2021-11-10 01:33:33 +00:00
Jean Felder aaf72b9ff4 id3tag: Map GST_TAG_MUSICBRAINZ_RELEASEGROUPID
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1331>
2021-11-10 01:33:33 +00:00
Jean Felder b1c74609e8 id3tag: Remove trailing whitespace
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1331>
2021-11-10 01:33:33 +00:00
Zhao, Gang 6cad2a7150 qtdemux: Fix can not demux Opus track made by qtmux
Opus stream info is read from dOps box [1]. The offset of dOps box in Opus box is different in mp4a version 1 and 0 [2]. Calculate the offset of dOps box according to mp4a version.

[1] https://opus-codec.org/docs/opus_in_isobmff.html

[2] subprojects/gst-plugins-good/gst/isomp4/atoms.c:sample_entry_mp4a_copy_data:2146

Fixed: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/918
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1329>
2021-11-09 17:57:49 +00:00
Ralf Sippl 0c9d9d90d9 docs: app-dev: events: seeking: use CLOCK_TIME_NONE instead of -1 and fix parameter names
to match the parameter names in the gst_element_seek() declaration.

Closes https://gitlab.freedesktop.org/gstreamer/gst-docs/-/merge_requests/34/

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1324>
2021-11-09 17:46:31 +00:00
wuchang li 7ac662f19d docs: installing-on-macos: flesh out instructions what to download
Closes https://gitlab.freedesktop.org/gstreamer/gst-docs/-/merge_requests/106/

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1324>
2021-11-09 17:46:31 +00:00
Tyler Compton ebb61c5e24 plugin-development: basics-boilerplate: Remove unneeded meson.build edit step
Closes https://gitlab.freedesktop.org/gstreamer/gst-docs/-/merge_requests/157/

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1324>
2021-11-09 17:46:31 +00:00
Teh Yule Kim c66b10b5cb docs: installing-on-windows: mention packages to download
Closes https://gitlab.freedesktop.org/gstreamer/gst-docs/-/merge_requests/158/

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1324>
2021-11-09 17:46:31 +00:00
Teh Yule Kim bda72282dd docs: tutorials: add link to Rust version of the tutorials
Closes https://gitlab.freedesktop.org/gstreamer/gst-docs/-/merge_requests/159/

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1324>
2021-11-09 17:46:31 +00:00
fjmax 5c9fe1dc3c docs: tutorials: playback-3: flesh out build instructions
Add information about how to compile this file. The code in this
tutorial also requires `gstreamer-audio-1.0`, so we cannot use
the commands from the previous tutorial.

Closes https://gitlab.freedesktop.org/gstreamer/gst-docs/-/merge_requests/164/

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1324>
2021-11-09 17:46:31 +00:00
wngecn bcff6abafd docs: plugin-dev: basics-boilerplate: fix typo in variable name
Closes https://gitlab.freedesktop.org/gstreamer/gst-docs/-/merge_requests/166/

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1324>
2021-11-09 17:46:31 +00:00
Timo Wischer 36006c61e9 avtpsrc: Use correct size for provided buffers
Without this patch the following pipeline would send packets containing
garbage in the data section.
$ gst-launch-1.0 avtpsrc ! avtpsink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1077>
2021-11-09 16:59:10 +00:00
Guillaume Desmottes 9b809d4cc3 appsrc: log when segment changes
We were logging when it does not change but not when it does, which is
confusing when reading logs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1327>
2021-11-09 16:19:05 +00:00
Timo Wischer de95d3a1c4 avtp: crfsync: Warn when CRF package not yet received
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1075>
2021-11-09 15:36:25 +01:00
Haihua Hu a66124a79c v4l2bufferpool: set video alignment of video meta
need apply video alignment info on video meta, downstream
element can get buffer alignment from video meta

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1326>
2021-11-09 13:32:46 +00:00
Timo Wischer 214691b972 test: avtp: crf: Check for rounding errors
on average period calculation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1073>
2021-11-09 10:59:00 +00:00
Timo Wischer 5a25eb61b7 avtp: crf: Use double for average period calculation
to also support CRF intervals like every 1,333,333ns 64 events

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1073>
2021-11-09 10:59:00 +00:00
Timo Wischer 6a576938ac tests: avtp: crf: Test for timestamp_interval > 1
in case of CRF AVTPDUs with single CRF timestamp.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1076>
2021-11-09 09:07:01 +01:00