Frediano Ziglio
b6aa5798b7
red-parse-qxl: Use a base reference class for RedDrawable
...
Don't code manually reference counting for this structure
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2021-08-04 13:01:12 +01:00
Rosen Penev
115260e4e5
Manual algorithm changes
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
2021-05-31 08:08:26 +01:00
Rosen Penev
5f8d49efaa
clang-tidy: remove pointless move
...
Found with performance-move-const-arg
Allows better optimization as the compiler does not have to deal with an
rvalue reference. Especially in C++17 where std::move can prevent copy
elision.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
2021-04-14 13:07:40 +01:00
Rosen Penev
8af176b15e
clang-tidy: use nullptr
...
Found with modernize-use-nullptr
NULL in C++ is 0 whereas it is a void pointer in C. Avoids implicit
conversions.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
2021-04-12 06:50:05 +01:00
Rosen Penev
944dc8662e
clang-tidy: use auto
...
Found with modernize-use-auto
auto is shorter and can sometimes disambiguate pointer constness.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-04-11 07:44:42 +01:00
Frediano Ziglio
10749220dd
Encapsulate more pipe item initialisation in constructors
...
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-13 19:48:27 +01:00
Frediano Ziglio
20408491fa
video-stream: Move some structure definition to use more RedPipeItemNum
...
Users of structures needs enumeration definitions too.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-13 19:48:25 +01:00
Frediano Ziglio
dd9b78fd78
Use smart pointers for RedPipeItem
...
Reduces usage of manual reference counting.
Avoids usage of new and use instead red::make_shared to both
create and own pipe items.
Use move semantic to reduce useless copies.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-13 19:48:08 +01:00
Frediano Ziglio
22fc6a48e6
red-channel-client: Change GQueue into a std::list
...
Starts using smart pointers in the queue.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-13 19:48:06 +01:00
Frediano Ziglio
93405ae3c6
Automatically release some pipe item resources
...
Now that items are managed by constructors/destructors avoid some
manual releases.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-13 19:47:59 +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
d5a0e9d0ef
video-stream: Remove only assigned "fps" field
...
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <ulublin@redhat.com>
2020-07-02 21:11:47 +01:00
Frediano Ziglio
364a1fde82
video-stream: Better check for value from environment
...
Do not allow negative values from "SPICE_BIT_RATE".
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-06-25 09:42:54 +01:00
Frediano Ziglio
ab7486a9e8
main-channel-client: Automatically convert
...
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-05-01 06:58:09 +01:00
Frediano Ziglio
cc86a7fb53
red-client: Automatically convert functions to methods
...
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-05-01 06:58:09 +01:00
Frediano Ziglio
f4aefa728e
Remove GObject from Dispatcher hierarchy
...
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-05-01 06:58:09 +01:00
Frediano Ziglio
552c26b0a8
Move all red_channel_* functions in header as methods
...
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-05-01 06:58:09 +01:00
Frediano Ziglio
874e745088
Move all red_channel_client_* functions in header as methods
...
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-05-01 06:58:09 +01:00
Frediano Ziglio
08fab74cd7
Avoid useless downcast to RedChannelClient or RedChannel
...
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-05-01 06:58:08 +01:00
Frediano Ziglio
3720e5a686
Remove RED_CHANNEL where possible
...
Used Coccinelle:
@@
expression E;
@@
-RED_CHANNEL(E)
+E
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-05-01 06:58:08 +01:00
Frediano Ziglio
e204677a43
Remove RED_CHANNEL_CLIENT where possible
...
Used Coccinelle:
@@
expression E;
@@
-RED_CHANNEL_CLIENT(E)
+E
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-05-01 06:58:08 +01:00
Frediano Ziglio
e6e6ded681
Use C++ IS-A relationship for RedChannelClient and RedChannel
...
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-05-01 06:58:08 +01:00