Commit graph

63 commits

Author SHA1 Message Date
Tim-Philipp Müller
f741543a3f dv, opusparse: fix duplicate symbols in static build
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1262

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2673>
2022-06-28 14:24:50 +01:00
Bastien Nocera
1a12d1344e gtk: Fix double-free when OpenGL can't be initialised
gtk_gl_area_get_error() doesn't return a copy of the error, but just the
error. If initialising OpenGL fails, then GtkGstGLWidget will consume
the error, and cause GTK to try and display freed memory.

==50914== Invalid read of size 8
==50914==    at 0x4C4CB8A: gtk_gl_area_draw_error_screen (gtkglarea.c:663)
==50914==    by 0x4C4CB8A: gtk_gl_area_draw (gtkglarea.c:687)
==50914==    by 0x4E061CA: gtk_widget_draw_internal (gtkwidget.c:7084)
==50914==    by 0x4BAEFB1: gtk_container_propagate_draw (gtkcontainer.c:3854)
==50914==    by 0x4D4B6BF: gtk_stack_render (gtkstack.c:2207)
==50914==    by 0x4BB4B03: gtk_css_custom_gadget_draw (gtkcsscustomgadget.c:159)
==50914==    by 0x4BBA4C4: gtk_css_gadget_draw (gtkcssgadget.c:885)
==50914==    by 0x4D4D780: gtk_stack_draw (gtkstack.c:2119)
==50914==    by 0x4E061CA: gtk_widget_draw_internal (gtkwidget.c:7084)
==50914==    by 0x4BAEFB1: gtk_container_propagate_draw (gtkcontainer.c:3854)
==50914==    by 0x4BAF0C3: gtk_container_draw (gtkcontainer.c:3674)
==50914==    by 0x4E061CA: gtk_widget_draw_internal (gtkwidget.c:7084)
==50914==    by 0x4BAEFB1: gtk_container_propagate_draw (gtkcontainer.c:3854)
==50914==  Address 0x187a0818 is 8 bytes inside a block of size 16 free'd
==50914==    at 0x48480E4: free (vg_replace_malloc.c:872)
==50914==    by 0x49A5B8C: g_free (gmem.c:218)
==50914==    by 0x49C1013: g_slice_free1 (gslice.c:1183)
==50914==    by 0x4990DE4: g_error_free (gerror.c:870)
==50914==    by 0x4990FE9: g_clear_error (gerror.c:1052)
==50914==    by 0x1A489780: _get_gl_context (gtkgstglwidget.c:540)
==50914==    by 0x1A4863CB: gst_gtk_invoke_func (gstgtkutils.c:39)
==50914==    by 0x49A3834: g_main_context_invoke_full (gmain.c:6137)
==50914==    by 0x1A486450: gst_gtk_invoke_on_main (gstgtkutils.c:59)
==50914==    by 0x1A48A29E: gtk_gst_gl_widget_init_winsys (gtkgstglwidget.c:632)
==50914==    by 0x1A4887E7: gst_gtk_gl_sink_start (gstgtkglsink.c:267)
==50914==    by 0x6579810: gst_base_sink_change_state (gstbasesink.c:5662)
==50914==  Block was alloc'd at
==50914==    at 0x484586F: malloc (vg_replace_malloc.c:381)
==50914==    by 0x49A9278: g_malloc (gmem.c:125)
==50914==    by 0x49C1BA5: g_slice_alloc (gslice.c:1072)
==50914==    by 0x49C3BCC: g_slice_alloc0 (gslice.c:1098)
==50914==    by 0x499096B: g_error_allocate (gerror.c:708)
==50914==    by 0x4990AF1: UnknownInlinedFun (gerror.c:722)
==50914==    by 0x4990AF1: g_error_copy (gerror.c:892)
==50914==    by 0x4C4B9F9: gtk_gl_area_set_error (gtkglarea.c:1036)
==50914==    by 0x4C4BAF7: gtk_gl_area_real_create_context (gtkglarea.c:346)
==50914==    by 0x4B21B28: _gtk_marshal_OBJECT__VOIDv (gtkmarshalers.c:2730)
==50914==    by 0x4920B78: UnknownInlinedFun (gclosure.c:893)
==50914==    by 0x4920B78: g_signal_emit_valist (gsignal.c:3406)
==50914==    by 0x4920CB2: g_signal_emit (gsignal.c:3553)
==50914==    by 0x4C4B927: gtk_gl_area_realize (gtkglarea.c:308)

Reproduced by running:
MESA_GL_VERSION_OVERRIDE=2.7 totem

See https://gitlab.gnome.org/GNOME/totem/-/issues/522

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2567>
2022-06-07 18:17:46 +01:00
Stéphane Cerveau
4361898015 soup: fix soup debug category
Use soup debug category in souploader
for soup plugin element load.

Inititalize properly soup utils category.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2547>
2022-06-03 10:39:01 +01:00
Nirbheek Chauhan
8eb3f2a74c jack: Always use jack_free as specified by the docs
Fixes a crash on Windows due to a CRT mismatch. The JACK installation
still uses MSVCRT, and we the Universal CRT for both MinGW and MSVC.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2515>
2022-05-28 16:34:02 +01:00
Nirbheek Chauhan
3b857965e8 jack: Add support for detecting libjack on Windows
No source code changes were necessary to get the plugin working on
Windows with MSVC.

Run QJackCtl and audiotestsrc ! jackaudiosink just works.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2515>
2022-05-28 16:34:02 +01:00
Stéphane Cerveau
26c7290e17 soup: Fix plugin/element init
In case of per features registration such as the
customizable gstreamer-full library, each
element should check that the soup library can be loaded to
facilitate the element registration.

Initialize the debug category properly

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2491>
2022-05-25 12:20:07 +01:00
Guillaume Desmottes
3927e77f4e vpxenc: fix crash if encoder produces unmatching ts
If for some reason the encoder produces frames with a pts higher than
the input one, we were dropping all the video encoder frames and ended
up crashing when trying to access the pts of a NULL pointer returned by
gst_video_encoder_get_oldest_frame().

I hit this scenario by feeding a decreasing timestamp to vp8enc which
seem to confuse the encoder.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2436>
2022-05-17 11:12:43 +02:00
Nirbheek Chauhan
69936ad852 meson: Add some messages when selecting libsoup
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2082>
2022-03-31 15:32:17 +01:00
Nirbheek Chauhan
45ce19dd2d soup: Fix usage of symbols / defines that are gone in libsoup3
I am not sure about the SOUP_MESSAGE_OVERWRITE_CHUNKS change, but it
was definitely already broken when using libsoup-3.0 in a shared
build. souphttpsrc probably needs to be ported from SoupMessage to
SoupServerMessage when using libsoup-3.0.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2082>
2022-03-31 15:32:17 +01:00
Nirbheek Chauhan
2813e30392 soup: Fix pre-processor macros in souploader for libsoup-3.0
Some of the preprocessor conditionals in the loader were very broken
with libsoup-3.0 + --default-library=static

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2082>
2022-03-31 15:32:17 +01:00
Nirbheek Chauhan
b9574c5e6a soup: Load the runtime library, not the development library
libsoup-2.4.so / libsoup-3.0.so are symlinks installed by development
packages, they are not available at runtime.

Also eliminate G_MODULE_SUFFIX since it's not useful for us, and is
actually incorrect on macOS anyway.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1907>
2022-03-09 16:36:04 +00:00
Nirbheek Chauhan
061d3d8cf8 soup: Fix static build with MSVC
../ext/soup/gstsouploader.c(818): error C4098: '_soup_session_send_async': 'void' function returning a value

It's technically a false warning, but that's how MSVC works, so fix
it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1846>
2022-03-03 18:46:31 +00:00
Nirbheek Chauhan
a0ad4b15dd soup: Fix pkgconfig generation and documentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1846>
2022-03-03 18:46:31 +00:00
Nirbheek Chauhan
299703f297 soup: Fix static build when default_library=both
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1007

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1846>
2022-03-03 18:46:31 +00:00
Nirbheek Chauhan
06e79311c5 soup: Don't error out in static build unless option is enabled
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1846>
2022-03-03 18:46:31 +00:00
Philippe Normand
496aa91a5e soup: Lookup libsoup dylib files on Apple platforms
Fixes #1007

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1846>
2022-03-03 18:46:31 +00:00
Marek Vasut
29d32a8f00 jpegdec: Pull row_stride from GST_VIDEO_FRAME_PLANE_STRIDE()
The libjpeg-turbo internal state might not be correctly initialized for
the first frame in a stream, pull the frame stride from gstreamer frame
metadata instead, which is correct even for the first frame, and which
makes this code consistent with the surrounding lines.

Fixes: e6d83d8f96 ("jpegdec: Support libjpeg-turbo colorspace conversion")
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1716>
2022-02-16 11:09:00 +00:00
Marek Vasut
7a93616ed6 jpegdec: Call gst_jpeg_turbo_parse_ext_fmt_convert() before jpeg_start_decompress()
It is imperative that the libjpeg-turbo state is properly initialized
before jpeg_start_decompress() is called. Make sure cinfo.out_color_space
and cinfo.raw_data_out are set to their final values matching their peer
caps before calling jpeg_start_decompress().

Fixes: e6d83d8f96 ("jpegdec: Support libjpeg-turbo colorspace conversion")
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1716>
2022-02-16 11:09:00 +00:00
Marek Vasut
3cc743cfc8 jpegdec: Factor out gst_jpeg_turbo_parse_ext_fmt_convert()
Pull out peer caps checking code into gst_jpeg_turbo_parse_ext_fmt_convert().
This code is used by libjpeg-turbo extras to determine whether peer is capable
of handling buffers into which libjpeg-turbo can directly decode data. This
kind of check must be performed before jpeg_start_decompress() is called in
gst_jpeg_dec_prepare_decode() as well as in gst_jpeg_dec_negotiate(), hence
the common code.

This commit does modify the code a little to make it easier to call from both
call sites without much duplication, hence the extra `if (*clrspc)` test.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1716>
2022-02-16 11:09:00 +00:00
Marek Vasut
b0ad4d3aee Revert "jpegdec: only allow conversions from RGB"
This reverts commit 2aa2477208.
The commit is completely wrong, libjpeg-turbo is perfectly capable
of decoding I420 (YUV) to RGB. The test case provided alongside the
aforementioned commit passes without this revert because it decodes
image of JCS_YCrCb color space, so the new `if (clrspc == JCS_RGB)`
condition is false on that image, and the libjpeg-turbo decoding
does not get used. The real bug is hidden by that commit.

The real problem is in the call order of gst_jpeg_dec_prepare_decode()
and gst_jpeg_dec_negotiate(). The gst_jpeg_dec_prepare_decode() calls
jpeg_start_decompress() which sets up internal state of the libjpeg,
however, neither cinfo.out_color_space nor cinfo.raw_data_out are
set correctly yet. Those two are set up in gst_jpeg_dec_negotiate()
which is called a bit later. Therefore, the real fix is the set up
cinfo.out_color_space and cinfo.raw_data_out before calling
jpeg_start_decompress(). This is however a separate patch.

Fixes: 2aa2477208 ("jpegdec: only allow conversions from RGB")
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1716>
2022-02-16 11:09:00 +00:00
Heiko Becker
a6d9ce54ba meson: Don't build lame plugin with -Dlame=disabled
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1720>
2022-02-16 03:58:02 +00:00
Bastien Nocera
bdee775ebd gtk: Fix rotation not being applied when paused
The video wouldn't be redrawn immediately when a rotation was applied
but the pipeline was paused, as no new buffers were scheduled to be
displayed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1710>
2022-02-15 12:28:28 +00:00
Bastien Nocera
30f85ca806 gtk: Add a way to queue redrawing the base GTK widget
This will be used to request a redraw of the GTK widget should the
display be changed using properties not directly handled by the base GTK
widget, but by one of its descendants.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1710>
2022-02-15 12:28:28 +00:00
Sebastian Dröge
4ae3685ac4 soup: Don't store a strong reference to the logging object
Otherwise this causes a reference cycle between the session, the logger
and the logging object (i.e. the sink element or session wrapper).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1603>
2022-01-29 16:22:48 +00:00
Sebastian Dröge
bd6e1a9f70 souphttpsrc: Always abort the session once its last user is gone
And wait until there are no pending GSources on the main context anymore
afterwards.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1603>
2022-01-29 16:22:48 +00:00
Sebastian Dröge
1db95a61c0 souphttpsrc: Post context message after setting up the context from the source's thread
This simplifies the code and especially the locking a bit, and makes
sure we only export the session after it is fully set up.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1603>
2022-01-29 16:22:48 +00:00
Sebastian Dröge
0b068c9015 souphttpsink: Protect against spurious wakeups during startup
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1594>
2022-01-28 15:47:44 +02:00
Sebastian Dröge
42f5873eeb souphttpsrc: Don't use the source element after setup from the session thread
The source element might be gone already if the session is shared with
other source elements.

As a consequence, do all logging via the session object instead of using
the source element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1594>
2022-01-28 15:41:54 +02:00
Sebastian Dröge
080d85b19a souphttpsrc: Don't abort all pending operations on the session if shutting down a source with a shared session
Only do it for a non-shared session. Other sources would otherwise get
their requests cancelled unexpectedly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1594>
2022-01-28 15:31:55 +02:00
Sebastian Dröge
499e0acd43 souphttpsrc: Don't set boolean to FALSE right after checking that it is FALSE
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1594>
2022-01-28 15:31:25 +02:00
Sebastian Dröge
165be69017 souphttpsrc: soup_session_new_with_options() can't fail with NULL
So don't check for it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1594>
2022-01-28 15:30:56 +02:00
Daniel Kolesa
0bcefa7350 soup: move libsoup session into its own thread
Starting with libsoup3, there is no attempt to handle thread safety
inside the library, and it was never considered fully safe before
either. Therefore, move all session handling into its own thread.

The libsoup thread has its own context and main loop. When some
request is made or a response needs to be read, an idle source
is created to issue that; the gstreamer thread issuing that waits
for that to be complete. There is a per-src condition variable to
deal with that.

Since the thread/loop needs to be longer-lived than the soup
session itself, a wrapper object is provided to contain them. The
soup session only has a single reference, owned by the wrapper
object.

It is no longer possible to force an external session, since this
does not seem to be used anywhere within gstreamer and would be
tricky to implement; this is because one would not have to provide
just a session, but also the complete thread arrangement made in
the same way as the system currently does internally, in order to
be safe.

Messages are still built gstreamer-side. It is safe to do so until
the message is sent on the session. Headers are also processed on
the gstreamer side, which should likewise be safe.

All requests as well as reads on the libsoup thread are issued
asynchronously. That allows libsoup to schedule things with as
little blocking as possible, and means that concurrent access
to the session is possible, when sharing the session.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1555>
2022-01-28 08:49:09 +00:00
Philippe Normand
0b6df00606 soup: Reintroduce compile-time libsoup dependency for static builds
On Android (especially) and for static builds in general it is safer to link
against libsoup and have the dynamic custom loading disabled. For those cases we
can safely assume the application will use either libsoup2 or libsoup3 and not
both.

Fixes #939

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1536>
2022-01-21 07:23:33 +00:00
Philippe Normand
a44a1bf193 soup: Initialize debug category before use
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1536>
2022-01-21 07:23:33 +00:00
Philippe Normand
d764b6c4f2 soup: Fix return types for a couple VTable functions
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1536>
2022-01-21 07:23:33 +00:00
Nirbheek Chauhan
23cc02d7c3 meson: Build cairo subproject when unavailable on the system
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/952

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1523>
2022-01-21 06:34:33 +00:00
Bastien Nocera
c63365c80f gtk: Add "video-aspect-ratio-override" property
Allow front-ends to override the pixel aspect ratio found inside the
video file itself, or most likely, missing from the video file.

This is a long-standing feature of totem.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1137>
2022-01-12 13:27:31 +00:00
Bastien Nocera
522be6cf7c gtk: Remove _update_par() forward declaration
No functional changes.

https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1137/diffs#note_1102782

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1137>
2022-01-12 13:27:31 +00:00
Bastien Nocera
6f677a8993 gtk: Mark properties as changeable in the PLAYING state
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1137#note_1102789

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1137>
2022-01-12 13:27:31 +00:00
Bastien Nocera
5dfe92a579 gtk: Fix "pixel-aspect-ratio" property range
Fix the arguments passed to gst_param_spec_fraction in the incorrect
order.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1137>
2022-01-12 13:27:31 +00:00
Bastien Nocera
488d29eb41 gtk: Rename display pixel aspect ratio related constants
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1137>
2022-01-12 13:27:31 +00:00
Bastien Nocera
17130de754 gtk: Make "pixel-aspect-ratio" changes immediate
Schedule a resize when the display's pixel aspect ratio has changed, if
one isn't already scheduled.

Closes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/883
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1137>
2022-01-12 13:27:31 +00:00
Florian Zwoch
3e680d8d5d aatv: Fixes for rain-mode
Some rain-mode properties tried to read float from int value.
Initialize rain after setting rain-mode. Rain was non-functional if
width/height were left at default values.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1459>
2021-12-20 09:28:50 +00:00
Guillaume Desmottes
2aa2477208 jpegdec: only allow conversions from RGB
libjpeg-turbo only supports converting from RGB to other RGB formats.
Fix runtime error when trying to convert from a YUV format for example.

Fix #916

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1421>
2021-12-06 16:52:38 +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
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
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
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
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