Commit Graph

12 Commits

Author SHA1 Message Date
Rosen Penev
9462537d24 clang-tidy: fix inconsistent declarations
Found with readability-inconsistent-declaration-parameter-name

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
2021-05-09 11:19:30 +01:00
Frediano Ziglio
a30df693cf red-pipe-item: Use inheritance on RedPipeItem
This allows to:
- reuse reference counting;
- avoid having to manually call g_free to release item memory;
- assure item is initialized;
- avoids some manual casts.

It will also allows to use smart pointers.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-13 19:47:53 +01:00
Frediano Ziglio
597461e443 Add and use red::make_shared
Allow to create an object already contained in a shared pointer
to avoid having not owned objects.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-05-01 06:58:09 +01:00
Frediano Ziglio
2bf72a5ce2 stream-channel: More incapsulation for StreamChannel
Put all functions into methods.
Separate public/private part.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-05-01 06:58:09 +01:00
Frediano Ziglio
104aa6e1af Remove GObject from RedChannel
The patch seems pretty huge but mainly are mechanical steps:
- remove GObject declarations
- do not inherit from GObject
- add SPICE_CXX_GLIB_ALLOCATOR to avoid using C++ allocators
- CLASS_init and CLASS_constructor code goes into C++ constructor
- CLASS_dispose and CLASS_finalize code goes into C++ destructor
- g_object_new is replaced by new operator
- class members goes into virtual methods
- class parameters became argument to constructor
- use push-visibility.h and pop-visibility.h to limit visibility
- temporary use XXX_CAST for old GObject casts, they will
  be replaced
- g_object_get is replaced by accessors

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-05-01 06:58:09 +01:00
Frediano Ziglio
77af39d6b5 Update header style
Avoid typedef useless in C++.
Remove useless forward declarations.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-05-01 06:58:09 +01:00
Jonathon Jongsma
3165247886 Make stream-channel.h self-contained
Include protocol header file defining StreamMsgFormat which is used in a
function signature in this header.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Frediano Ziglio <fziglio@redhat.com>
2017-10-30 12:01:24 +01:00
Frediano Ziglio
a8afcfef6b stream-device: Limit sending queue from guest to server
Do not allow the guest to fill host memory.
Also having a huge queue mainly cause to have a higher video
latency.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-10-16 19:59:14 +01:00
Frediano Ziglio
82769e5dfc stream-device: Start supporting resetting device when close/open on guest
When guest close the device the host device has to be reset too.
This make easier to restart the guest device which can happen in case
of reboot, agent issues or if we want to update the agent.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-10-16 19:59:14 +01:00
Frediano Ziglio
3cf09bd5b3 stream-channel: Allows to register callback to get new stream request
The channel needs to communicate when it receive a new
stream request from the guest.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-10-16 19:59:14 +01:00
Frediano Ziglio
60104d818c stream-device: Handle streaming data from device to channel
Handle stream data from device sending to the channel.
The StreamChannel will forward the data to the clients using standard
DisplayChannel messages, and will create and destroy streams as
necessary.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-10-16 19:59:14 +01:00
Frediano Ziglio
efcb765d0a stream-channel: Write a base channel to implement the streaming
Currently only compile, not used and not much sense

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-10-16 19:59:14 +01:00