Commit Graph

3048 Commits

Author SHA1 Message Date
Michael Scherle
8568c6e1bd decode delay print 2024-04-05 15:48:37 +02:00
Christoph Brinkhaus
b906739f0e po: update german translation
This fixes https://gitlab.freedesktop.org/spice/spice-gtk/-/issues/179.

Signed-off-by: Christoph Brinkhaus <c.brinkhaus@t-online.de>
2023-11-14 17:57:24 +00:00
Frediano Ziglio
581ca654ff gstreamer: Fallback to S/W decoder if H/W one is not working
In case the H/W decoder is not able to decode the stream (like too high
profile) try the S/W version.
This is done detecting the failure and trying to recreate the pipeline
in case:
- we are using a H/W pipeline;
- we didn't decode any frame (otherwise it means we lost the beginning
  or it was not a problem of H/W decoder).

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
2023-11-05 15:25:31 +00:00
Frediano Ziglio
d29a0a04da gstreamer: Fix leak using GstBus watch
This patch fixes a leak due to not freeing GstBus watch.
The watch is attached (as GSource) to the main loop and retains
a pointer to the bus so we need to remove it to release the bus
when we release the pipeline.
This was detected forcibly creating and destroying lot of streams.
After a while the client program consumed all file descriptors
and stopped working. This as GstBus retains a GPoll which,
under Unix, uses 2 file descriptors.
For some reasons using gst_pipeline_get_bus again in free_pipeline
do not fix entirely the leak so keep a pointer to the exact
bus we set our watch on.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
2023-11-05 15:23:46 +00:00
Vivek Kasireddy
a5ff1b1414 channel-display-gst: Use h/w based decoders with Intel GPUs if possible
We first try to detect if an Intel GPU is available (by looking into
udev's database) and then probe Gstreamer's registry cache to see
if there is h/w based decoder (element) available for the incoming
video codec format. If both these conditions are satisfied (i.e,
Intel Media SDK Gstreamer plugin (libgstmsdk.so) and associated
libraries are properly installed), we then create a simple decode
pipeline using appropriate h/w based decoder and post-processor
elements instead of relying on playbin -- which may not be able to
auto-select these elements.

For example, if the incoming codec format is h264, we then create
a pipeline using msdkh264dec and vaapipostproc elements instead of
avdec_h264 and videoconvert.

Cc: Frediano Ziglio <freddy77@gmail.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: Dongwon Kim <dongwon.kim@intel.com>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
Signed-off-by: Hazwan Arif Mazlan <hazwan.arif.mazlan@intel.com>
Signed-off-by: Jin Chung Teng <jin.chung.teng@intel.com>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
2023-11-03 08:31:41 +00:00
Frediano Ziglio
e2bcf5727b gstreamer: Avoid dangling pointers in free_pipeline
Although currently after free_pipeline we free the entire structure
the name and the function suggests that we only free the pipeline.
Also this is fixing a future possible problem with the series
from Vivek Kasireddy reusing the SpiceGstDecoder for another
pipeline if H/W encoder pipeline creation fails.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
2023-11-03 08:31:06 +00:00
Frediano Ziglio
fa9922f39a Update spice-common submodule
This brings in the following changes:

Vivek Kasireddy (1):
      common: Add a udev helper to identify GPU Vendor

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2023-11-03 08:31:06 +00:00
Jin Chung Teng
2a8dc65b9b channel-display-gst: Prefer playbin3 to playbin
If playbin3 is available (checked in Gstreamer registry), it
makes sense to prefer it given the major improvements and
features it offers including the capability to handle higher
bitrates.

Cc: Frediano Ziglio <freddy77@gmail.com>
Cc: Dongwon Kim <dongwon.kim@intel.com>
Cc: Hazwan Arif Mazlan <hazwan.arif.mazlan@intel.com>
Signed-off-by: Jin Chung Teng <jin.chung.teng@intel.com>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
2023-10-06 09:03:26 +01:00
Vivek Kasireddy
20c414f88a channel-display-gst: Add "byte-stream" as the stream format for h264
Adding the string "stream-format=byte-stream" to decoder capabilities
(dec_caps) for h264/h265 codecs stops Gstreamer from complaining
about missing stream format.

Cc: Frediano Ziglio <freddy77@gmail.com>
Cc: Dongwon Kim <dongwon.kim@intel.com>
Cc: Jin Chung Teng <jin.chung.teng@intel.com>
Cc: Hazwan Arif Mazlan <hazwan.arif.mazlan@intel.com>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
2023-09-18 09:18:58 +01:00
Marc-André Lureau
4e0ff75791 Merge branch 'single' into 'master'
Use single version of double exported functions

See merge request spice/spice-gtk!122
2023-07-25 10:48:51 +00:00
Frediano Ziglio
9f1a9bec6c Use single version of double exported functions
Solve double export issue of some functions between spice-gtk
and spice-glib libraries.
Some functions are exported by both spice-gtk and spice-glib.
As the state of these function can be duplicate this can create
some issues. Specifically you can enable debug but get only partly
enabled.
So to solve this and have a consistent behaviour across system
add new functions in spice-glib (where these functions where supposed
to be) and use them (we need to keep providing old functions for
ABI compatibility).

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2023-07-25 11:37:17 +01:00
Frediano Ziglio
3892983eda Use visibility instead of just filtering using version script
In case version script support is not available we can still
able to filter symbols exported.
This for instance will work with linkers not supporting
--version-script (like system MacOS one).
Use new version macros similar to Glib to detect also
deprecated function.
Tested that exported symbols remains the same from both Linux
and Windows shared libraries.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2023-07-09 08:25:14 +01:00
Frediano Ziglio
11149e5d4e Remove not private function declaration
Already declared in spice-audio.h.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2023-07-02 18:12:01 +01:00
Frediano Ziglio
004ff13af1 Fix some minor versions documentation
Fix some "Since" field in function documentation.
Nobody should nowadays use versions old like these but good to
have them fixed.
Function presence was checked looking at map-file and code
presence.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2023-07-02 17:36:01 +01:00
Frediano Ziglio
7e87382b58 Split symbol file in 2 files
One file for spice-glib and another for spice-gtk.
This avoid having duplicate exports in the future.
spice_g_signal_connect_object, spice_util_get_debug,
spice_util_get_version_string, spice_util_set_debug and
spice_uuid_to_string are exported by both libraries to keep ABI
compatibility.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2023-06-26 13:53:37 +01:00
Frediano Ziglio
1511f0ad5e Do not use libtool -export-symbols option
This option is intended for libtool, not for any linker.
Check the support of --version-script option using an empty
list of symbols to catch some faulty linker supporting that
option but not allowing not existing symbols (some buggy mold
versions).

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2023-06-22 19:22:04 +01:00
Biswapriyo Nath
7471e3e5ad usb-backend: Fix compiling with i686 clang in mingw
This adds the stdcall attribute to match the function prototype which
is used with SetWindowSubclass Win32 API. Otherwise, clang 16 targeting
i686-w64-windows-gnu shows the following compiler error:

../src/usb-backend.c:269:38: error: incompatible function pointer types passing
'LRESULT (HWND, UINT, WPARAM, LPARAM, UINT_PTR, DWORD_PTR)' (aka 'long (struct HWND__ *, unsigned int, unsigned int, long, unsigned int, unsigned long)') to parameter of type
'SUBCLASSPROC' (aka 'long (*)(structHWND__ *, unsigned int, unsigned int, long, unsigned int, unsigned long) __attribute__((stdcall))') [-Wincompatible-function-pointer-types]
    if (!SetWindowSubclass(be->hWnd, subclass_proc, 0, (DWORD_PTR)be)) {
                                     ^~~~~~~~~~~~~

Acked-by: Frediano Ziglio <freddy77@gmail.com>
2023-04-21 19:11:39 +01:00
Balló György
953556c8a7 Remove dependency on gobject-introspection-1.0 2023-03-15 09:24:37 +00:00
John Citizen
218045dc42 spicy: add command line option to hide menu bar
Signed-off-by: WebOfNakedFancies <arshuni@gmx.com>
2023-02-15 18:54:59 +01:00
Marc-André Lureau
f04479c16f Release v0.42
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-01-23 14:04:11 +04:00
Marc-André Lureau
adddbb3976 meson: bump meson req to 0.56
It's from Oct 2020, and widely available on various distro or backports.

Fix related meson warnings.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-01-23 12:05:06 +04:00
Marc-André Lureau
795318c8fa meson: fix keymap-gen exec on msys
meson wraps python scripts already on win32:

"C:/msys64/mingw64/bin/meson" "--internal" "exe" "--capture" "src/vncdisplaykeymap_xorgevdev2xtkbd.h" "--" "C:/msys64/mingw64/bin/python.exe" "python" "C:/msys64/home/marca/src/spice-gtk/subprojects/keycodemapdb/tools/keymap-gen" "code-m
ap" "--lang" "glib2" "--varname" "keymap_xorgevdev2xtkbd" "../subprojects/keycodemapdb/data/keymaps.csv" "xorgevdev" "xtkbd"
--- stderr ---
C:/msys64/mingw64/bin/python.exe: can't open file 'C:\\msys64\\home\\marca\\src\\spice-gtk\\build\\python': [Errno 2] No such file or directory

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-01-23 11:55:06 +04:00
Marc-André Lureau
57733fe6ef meson: drop needless comments about unused protocols
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-01-23 11:54:16 +04:00
Marc-André Lureau
a936bec84d meson: fix some lib check warnings on win32
WARNING: find_library('libws2_32') starting in "lib" only works by accident and is not portable
Library libws2_32 found: YES
WARNING: find_library('libgdi32') starting in "lib" only works by accident and is not portable
Library libgdi32 found: YES
WARNING: find_library('libcomctl32') starting in "lib" only works by accident and is not portable
Library libcomctl32 found: YES

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-01-23 11:25:29 +04:00
Marc-André Lureau
89208ee729 meson: fix a warning
WARNING: extract_all_objects called without setting recursive

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-01-23 11:22:43 +04:00
Marc-André Lureau
245c325a85 Fix compilation on win32 when EGL is enabled
../src/spice-widget-egl.c:204:17: error: unused variable 'gdk_dpy' [-Werror=unused-variable]
  204 |     GdkDisplay *gdk_dpy = gdk_display_get_default();

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-01-23 11:08:42 +04:00
Marc-André Lureau
e8adfacbfc meson: fix compilation on win32 when egl is available
When EGL is enabled (thanks to epoxy/angle), spice-gtk fails to link
against epoxy. Link with it when EGL is enabled.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-01-23 10:52:06 +04:00
Marc-André Lureau
1cec1c6b67 meson: add an egl option
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-01-23 10:42:55 +04:00
Marc-André Lureau
a0f7d49fa4 meson: update EGL option
Adjust `#ifdef` statements to use the single define.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-01-23 10:34:20 +04:00
Marc-André Lureau
53a7a40190 Rename near and far, reserved keywords on win32
Win32 has #define for those.

Change variable names `near` and `far` to `_near` and `_far`.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-01-23 10:28:44 +04:00
msizanoen1
5e88a10dc8 spice-widget: fix hotspot position on Wayland/HiDPI
Same as a945a3c24b but for Wayland.

Fixes breakage caused by GTK behavior change in
https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/5159.
2023-01-09 15:48:16 +00:00
Frediano Ziglio
f5cc0ca4a4 Quote angular parenthesis in README.md
Otherwise they are not showed when rendered.
2022-12-13 11:50:27 +00:00
Frediano Ziglio
2ed5f940f6 usb-device-cd: Detect Apple H/W CD support better
Hardware support for Apple iOS is not available, check correctly
and not try to use it.

Signed-off-by: osy <osy@turing.llc>
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Tested-by: osy <osy@turing.llc>
2022-11-20 17:49:30 +00:00
Fabio Estevam
4dbe0da23f meson: Allow building on a Wayland-only environment
Currently, it is not possible to build spice-gtk on a Wayland-only
environment due to the x11 dependency in meson.

Since commit a7381b0864 ("Allow to build without X11 gdk backend)
it is possible to build spice-gtk without X11 GDK backend, so make
the x11 dependency in meson optional.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
2022-10-11 12:06:05 +01:00
Victor Toso
a39a3acc06 usb-backend: Fix devices not being enumerated
This patch fixes bad filtering of USB devices.

The logic was introduced for windows clients in commit b838937 but was
moved in 2e19014 and executed also by non windows clients, resulting
in this bug.

Fixes: 2e19014 "usb-redir: isolate usage of libusb and usbredirhost"
Fixes: https://gitlab.freedesktop.org/spice/spice-gtk/-/issues/157
Signed-off-by: Victor Toso <victortoso@redhat.com>
2022-10-07 13:47:47 +00:00
NorwayFun
b3b97a975b po: Add Georgian translation
Signed-off-by: NorwayFun <temuri.doghonadze@gmail.com>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
2022-09-08 08:55:38 +01:00
Joel Rangsmo
9992bdb921
spicy: Add keyboard shortcuts for copy/paste sync
This simple change adds keyboard shortcuts for manual synchronization of
copy/paste buffers. These come in handy when automatic clipboard sharing
is disabled, which may be desirable to prevent a semi-trusted server
from reading sensitive data populated by password managers and similar.

Shift+F5/F6 ain't the most comfortable shortcuts, but it sticks with the
current theme.
2022-07-06 22:17:48 +00:00
Marc-André Lureau
74e673d7c3 Release v0.41
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-07-04 14:53:04 +00:00
Frediano Ziglio
9788b24e8c ci: Make Windows test work again
Install whole wine instead of just core.
Set language to avoid warning in GLib.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2022-07-04 15:44:51 +01:00
Marc-André Lureau
2511ccc4cf gitlab-ci: comment out failing wine test
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-07-04 15:40:02 +04:00
Marc-André Lureau
7cf19eeef6 channel: use openssl 3.0 API
Fix compilation warnings when building against openssl 3.0

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-07-04 15:40:02 +04:00
Marc-André Lureau
3653d8d9e6 build-sys: build against phodav-3.0/soup-3.0 if possible
Prefer libsoup 3.0 over 2.0, when available.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-07-01 16:59:24 +04:00
Marc-André Lureau
b296ddbf4b spice-common: update to current git
Frediano Ziglio (1):
      Replace EVP_PKEY_cmp with EVP_PKEY_eq

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-07-01 16:59:24 +04:00
Eli Schwartz
b3eb04485c fix invalid use of subprojects
The keycodemapdb Meson subproject provides a program and a source input.
Since it is a subproject, Meson wants to sandbox that and requires it to
be explicitly exported. But this never happened -- instead, we manually
poked at files using the actual string path "subprojects/......"

This was always a Meson sandbox violation, but Meson 0.63.0 started
noticing it and erroring out.

Instead, do the right thing. Update the subproject to a version that has
a meson.build with actually meaningful contents -- namely, a files
variable and a found program. Then use these in order to run the needed
custom_target.

In the process, it is also necessary to correct the argument ordering
when running keymap-gen.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-06-27 10:56:45 +04:00
osy
5229a16a67 meson: move cairo dependency to GTK build only
Cairo is only used in SpiceDisplay which is part of the GTK client. If
we are building the GLib only client, it should be optional.
2022-03-06 14:48:04 +00:00
osy
fa812c8849 coroutine: add support for libucontext
libucontext is a lightweight implementation of ucontext for platforms
that do not have a built-in implementation. This allows us to use the
same code to support libucontext as ucontext.
2022-03-04 21:56:12 -08:00
Victor Toso
9f3b720e2f Release v0.40
Signed-off-by: Victor Toso <victortoso@redhat.com>
2022-02-07 14:43:23 +01:00
Iordan Iordanov
9a0cec4b2f Implemented the ability to allocate SpiceUsbDevice instances
by passing an open file descriptor in order to support the modern
Android USB device permissioning scheme.

During the process, a handle obtained by a call to
libusb_wrap_sys_device() is stored in the SpiceUsbDevice instance.

A call to libusb_open() is skipped if there is already a handle
present in the SpiceUsbDevice instance.

Finally, on Android, the option LIBUSB_OPTION_NO_DEVICE_DISCOVERY
must be set prior to the call to libusb_init() as per libusb
documentation.

Acked-by: Frediano Ziglio <freddy77@gmail.com>
2022-01-28 12:20:46 +00:00
Frediano Ziglio
d5c01a322f channel-main: Remove unused code
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2022-01-28 10:26:24 +00:00
Frediano Ziglio
3d56b0276d Update spice-common submodule
This brings in the following changes:

Frediano Ziglio (2):
      build: Correctly check for Python modules
      ci: Set WINEPATH during Windows build

This fixes https://gitlab.freedesktop.org/spice/spice-gtk/-/issues/152.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2022-01-28 09:56:01 +00:00