"device" field is just written, never read.
"manager" field can be retrieved using g_task_get_source_object.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
If the pointer is freed with g_object_unref the two do the
same.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
Simple automatic update of the file to sync with sources
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Francesco Giudici <fgiudici@redhat.com>
This is a common function for adding an error status message.
If an old message exists, checks if the new message is not already contained
in the old one. The new message is ignored if it is, added if it's not.
New message string should be dynamically allocated, it's always g_free-ed.
Acked-by: Frediano Ziglio <fziglio@redhat.com>
It just holds a reference to the primary surface which is being
removed and freed from the hash table. This ends up generating a
warning below in the same function before setting the new primary
surface reference.
Signed-off-by: Victor Toso <victortoso@redhat.com>
In case the drawing on the screen is scaled the scaling required to
invalidate a slightly bigger region.
This is due to the interpolation done during the resize.
So if scaling is performed invalidate also the adjacent pixels.
This fixes https://gitlab.freedesktop.org/spice/spice-gtk/issues/19.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
Migration can start with different messages and the code could take
different paths. By having a debug on which message started can help
pinpoint issues faster.
Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
Although currently not supported by the code (libusb_context in
SpiceUsbBackend is never NULL), try to support it in order to be able to
have only emulated devices if the libusb layer is failing.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
Currently we call this function when the SPICE channel is up
however this function should continue to work as in theory
the channel could avoid to handle the message and stop the flow
(for instance to implement some kind of flow limitation)
and so will need to call this function again.
This was failing in the first USB emulation implementation
causing a crash.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
Mock some usb-backend functions to be able to simulate device
attachment and detachment.
Create session and channel to pass some valid pointer anyway.
Emulate channel state correctly.
Make sure HELLO packets are sent correctly at the beginning and
no more afterwards.
Test auto-connect enabled or disabled.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
Instead of linking all object inside spice-client-glib build a library
from these object and link to each test.
This will allow to override some object file for mocking purposes.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
Just allocate and free to test for base leaks and reference
counting.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
GStreamer is already initialized using gst_init_get_option_group and
gst_init_get_option_group.
From gst_init documentation:
WARNING: This function does not work in the same way as
corresponding functions in other glib-style libraries,
such as gtk_init(). In particular, unknown command line options
cause this function to abort program execution.
This luckily is not true (program won't abort if you pass --gst-foo
for instance) but better to stick to documentation.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Snir Sheriber <ssheribe@redhat.com>
These files would end up to compile empty code, no reason
to compile and link them.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
Add implementation of emulated device to build.
Now it is possible to create emulated CD devices.
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
They are used only inside the module.
Use a macro to simplify declaration which is pretty long.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
Files added without including them in compilation.
They contain implementation of SCSI commands for logical
units of mass-storage device class and USB bulk-only
mass-storage device protocol.
Signed-off-by: Alexander Nezhinsky<anezhins@redhat.com>
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
Redirection of emulated devices requires special approach, as
usbredirhost can't be used for that (it works only with libusb
devices). For emulated devices we create instance of usbredirparser
that implements USB redirection protocol. In order to work with the
same set of protocol capabilities that usbredirhost sets up with
remote side, the parser shall: - not send its own 'hello' to the
server
- initialize the same capabilities that usbredirhost
- receive the same 'hello' response
For that we analyze 'hello' sent by USB redir parser and extract set
of capabilities from it and upon receive of 'hello' response we
provide it also to the parser. When libusb device is redirected via a
channel, instance of usbredirhost serves it. When emulated device is
redirected via a channel, instance of usbredirparser does the job.
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
This patch introduces the usage of usbredirparser in
SpiceUsbBackendChannel.
The focus of this patch is to the code path of real devices. As we
don't know beforehand if a SpiceUsbBackendChannel will be used by real
or emulated devices, an instance of usbredirparser must be initialized
with the usbredirhost's first hello message.
This is a must to the current design on supporting emulated devices.
This will be extended in the next patch to match remote's usbredirhost
capabilities and providing support to emulated devices.
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Signed-off-by: Victor Toso <victortoso@redhat.com>
At this moment, spice_usb_backend_channel_attach() is only related to
real devices and this call might happen on channel-up event that can
possibly come before usbredirhost has been created.
Signed-off-by: Victor Toso <victortoso@redhat.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
* Add documentation on spice_usb_backend_device_check_filter()
* Add guard on libusb_device
* Adds G_GNUC_INTERNAL as this is only called internally in
usb-device-manager.c
* Changed the style a bit, still under 100 char in a single line
This is a preparatory patch for extending usb-backend for emulated
devices.
Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
SpiceUsbBackendDevice deals with real and emulated devices but there
is no plans to implement emulated isochronous devices.
This patch adds check to edev (emulated device) in the guard, fix the
return value to FALSE instead of plain 0 and return early in case the
code path is around emulated devices.
This is a preparatory patch to extend emulated devices support.
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
For local USB device the USB backend returns the same device
description as spice-usb-manager did, for emulated devices it
uses the description provided by device's implementation.
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
SpiceUsbBackendDevice structure is extended to support
additional kind of device that is emulated by Spice-GTK
and not present locally (and does not have libusb_device),
such device has instead pointer to SpiceUsbEmulatedDevice
abstract structure. Specific implementation of such device
depends on its device type. Implementation module will define
constructor for specific device type.
Device structure is abstract but always starts from table of
virtual functions required to redirect such virtual device.
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
Really swap "x" and "y", not temporary copies.
The issue was introduced by 01c6343 "Use macro to swap
data in spice_session_start_migrating()".
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
Use specific type in spice_usb_backend_channel_new and
specific name instead of "user_data" field.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
Remove "_callback" suffix.
The function is called directly, no much reasons to keep that
suffix.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
1) Make one argument per line, instead of 1, 2, 1
2) Use session variable that already exists
3) Don't cast again to SpiceChannel
Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
Although spice_channel_connect() works in idle, if it returns false
it'll not emit any signal further and we would be counting a
'connected' channel that wouldn't be emitting anything.
As other callbacks take this in consideration, we should only
increment the counter if we reached spice-channel::connect_delayed()
callback.
Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
The migration process would happen in idle, so the process only fails
at a later time. No call to migrate_channel_connect() is actually
checking the return value.
Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
> 184 bytes in 1 blocks are definitely lost in loss record 12,668 of 14,231
> at 0x483880B: malloc (vg_replace_malloc.c:309)
> by 0x4A64C98: g_malloc (in /usr/lib64/libglib-2.0.so.0.6000.6)
> by 0x4A7CFB5: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.6000.6)
> by 0x4A7D5DD: g_slice_alloc0 (in /usr/lib64/libglib-2.0.so.0.6000.6)
> by 0x4D3E061: g_type_create_instance (in /usr/lib64/libgobject-2.0.so.0.6000.6)
> by 0x4D2042C: ??? (in /usr/lib64/libgobject-2.0.so.0.6000.6)
> by 0x4D21B14: g_object_new_with_properties (in /usr/lib64/libgobject-2.0.so.0.6000.6)
> by 0x4D226C0: g_object_new (in /usr/lib64/libgobject-2.0.so.0.6000.6)
> by 0x4BE0FB8: g_task_new (in /usr/lib64/libgio-2.0.so.0.6000.6)
> by 0x48EDFCB: spice_gstaudio_get_record_volume_info_async (spice-gstaudio.c:679)
> by 0x48C2A4F: spice_audio_get_record_volume_info_async (spice-audio.c:212)
> by 0x48B2F00: agent_sync_audio_record (channel-main.c:1285)
>
> 240 (184 direct, 56 indirect) bytes in 1 blocks are definitely lost in loss record 12,889 of 14,231
> at 0x483880B: malloc (vg_replace_malloc.c:309)
> by 0x4A64C98: g_malloc (in /usr/lib64/libglib-2.0.so.0.6000.6)
> by 0x4A7CFB5: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.6000.6)
> by 0x4A7D5DD: g_slice_alloc0 (in /usr/lib64/libglib-2.0.so.0.6000.6)
> by 0x4D3E061: g_type_create_instance (in /usr/lib64/libgobject-2.0.so.0.6000.6)
> by 0x4D2042C: ??? (in /usr/lib64/libgobject-2.0.so.0.6000.6)
> by 0x4D21B14: g_object_new_with_properties (in /usr/lib64/libgobject-2.0.so.0.6000.6)
> by 0x4D226C0: g_object_new (in /usr/lib64/libgobject-2.0.so.0.6000.6)
> by 0x4BE0FB8: g_task_new (in /usr/lib64/libgio-2.0.so.0.6000.6)
> by 0x48EDAF9: spice_gstaudio_get_playback_volume_info_async (spice-gstaudio.c:597)
> by 0x48C2967: spice_audio_get_playback_volume_info_async (spice-audio.c:189)
> by 0x48B2C33: agent_sync_audio_playback (channel-main.c:1229)
Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
This patch allows the MJPEG encoder to inform the spice-widget that
its video drawing area (draw-area) should be made visible on screen.
This is required to switch from GST video decoding to native MJPEG
decoding, otherwise the gst-area remained on top and the MJPEG video
stream was never shown.
Signed-off-by: Kevin Pouget <kpouget@redhat.com>
Acked-by: Snir Sheriber <ssheribe@redhat.com>
Allows to remove _SpiceUsbDevice structure.
_SpiceUsbDevice is only caching this value from SpiceUsbBackendDevice.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
The "install" argument for configure_file is available since 0.50.
However this is already "false" if "install_dir" is not provided.
Update also spice-common submodule to import a similar fix for
spice-common module. This brings in the following changes:
Frediano Ziglio (10):
gitignore: Ignore auto generated generated_messages.h file
Do not check for HAVE_CONFIG_H
build: Remove unused git-version-gen file
recorder: Update
build: Disable Celt support by default
codegen: Use has_end_attr instead of has_attr("end")
codegen: Exit with error on error generating C structures
protocol: Removed unneeded type specifications
codegen: Add a check for C structure fields
meson: Remove "install" argument from configure_file
Uri Lublin (2):
ptypes.py: remove useless condition member != None
test-marshallers.proto: ArrayMessage: make space for name
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>