[Spice-commits] 4 commits - docs/spice_threading_model.txt server/char-device.h server/reds.cpp server/video-encoder.h

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 25 15:10:42 UTC 2020


 docs/spice_threading_model.txt |    6 +++---
 server/char-device.h           |   22 +++++++++++-----------
 server/reds.cpp                |    7 ++-----
 server/video-encoder.h         |    2 +-
 4 files changed, 17 insertions(+), 20 deletions(-)

New commits:
commit 7f849777d3c26a1c75821d3b5a3ece2dea4ffb66
Author: Frediano Ziglio <freddy77 at gmail.com>
Date:   Tue Jun 23 22:30:43 2020 +0100

    docs: Update references to code in spice_threading_model.txt
    
    Signed-off-by: Frediano Ziglio <freddy77 at gmail.com>
    Acked-by: Francesco Giudici <fgiudici at redhat.com>

diff --git a/docs/spice_threading_model.txt b/docs/spice_threading_model.txt
index 861d7819..1101f5d0 100644
--- a/docs/spice_threading_model.txt
+++ b/docs/spice_threading_model.txt
@@ -35,7 +35,7 @@ One aspect to take into consideration is the event scheduling. SPICE uses some
 `SpiceCoreInterface` to handle events. As the events will be handled from a
 thread based on the core interface you have to use the correct core. Each
 channel has an associated core interface which can be retrieved using
-`red_channel_get_core_interface`. There's also a main core interface you can get
+`RedChannel::get_core_interface`. There's also a main core interface you can get
 using `reds_get_core_interface`. `reds_core_timer_*` and `reds_core_watch_*`
 functions use the main core interface.
 Even though multiple channel types run in the main thread and so could use
@@ -73,8 +73,8 @@ same RedClient are automatically disconnected.
 Who owns RedClient? RedClient is released when the MainChannelClient attached
 to it is disconnected. In this case a request is scheduled in the main thread
 (even if MainChannelClient runs on the main thread too) and
-red_client_disconnect is called which calls red_client_destroy which uses
-g_object_unref to free the object.
+reds_client_disconnect is called which calls RedClient::destroy which uses
+RedClient::unref to free the object.
 
 Where is the MainChannelClient freed? On disconnection like other channel
 clients, currently before RedClient which will have a dangling pointer.
commit ba065d1bdfab29fb9a92c2c647bcf4d21d6b7426
Author: Frediano Ziglio <freddy77 at gmail.com>
Date:   Wed Jun 24 17:18:43 2020 +0100

    char-device: Update documentation reference
    
    Signed-off-by: Frediano Ziglio <freddy77 at gmail.com>
    Acked-by: Francesco Giudici <fgiudici at redhat.com>

diff --git a/server/char-device.h b/server/char-device.h
index 54963e55..3b0866b1 100644
--- a/server/char-device.h
+++ b/server/char-device.h
@@ -36,19 +36,19 @@ struct RedCharDeviceClientOpaque;
  * How to use the api:
  * ==================
  * device attached: create new object instantiating a RedCharDevice child class
- * device detached: call g_object_unref/red_char_device_reset
+ * device detached: unreference/RedCharDevice::reset
  *
- * client connected and associated with a device: red_char_device_client_add
- * client disconnected: red_char_device_client_remove
+ * client connected and associated with a device: RedCharDevice::client_add
+ * client disconnected: RedCharDevice::client_remove
  *
  * Writing to the device
  * ---------------------
  * Write the data into RedCharDeviceWriteBuffer:
- * call red_char_device_write_buffer_get_client/red_char_device_write_buffer_get_server
+ * call RedCharDevice::write_buffer_get_client/RedCharDevice::write_buffer_get_server
  * in order to get an appropriate buffer.
- * call red_char_device_write_buffer_add in order to push the buffer to the write queue.
+ * call RedCharDevice::write_buffer_add in order to push the buffer to the write queue.
  * If you choose not to push the buffer to the device, call
- * red_char_device_write_buffer_release
+ * RedCharDevice::write_buffer_release
  *
  * reading from the device
  * -----------------------
@@ -60,13 +60,13 @@ struct RedCharDeviceClientOpaque;
  *
  * calls triggered from the device (qemu):
  * --------------------------------------
- * red_char_device_start
- * red_char_device_stop
- * red_char_device_wakeup (for reading from the device)
+ * RedCharDevice::start
+ * RedCharDevice::stop
+ * RedCharDevice::wakeup (for reading from the device)
  */
 /* refcounting is used to protect the char_dev from being deallocated in
- * case g_object_unref has been called
- * during a callback, and we might still access the char_dev afterwards.
+ * case object is unreferenced during a callback, and we might still access
+ * the char_dev afterwards.
  */
 
 
commit 3868e13bf33056b82908859a0436d1d1bb0c485d
Author: Frediano Ziglio <freddy77 at gmail.com>
Date:   Thu Jun 25 12:24:32 2020 +0100

    video-encoder: Fix parameter name
    
    Signed-off-by: Frediano Ziglio <freddy77 at gmail.com>
    Acked-by: Francesco Giudici <fgiudici at redhat.com>

diff --git a/server/video-encoder.h b/server/video-encoder.h
index 2d7bbc3d..d5bc0a68 100644
--- a/server/video-encoder.h
+++ b/server/video-encoder.h
@@ -102,7 +102,7 @@ struct VideoEncoder {
      *                 report.
      * @end_frame_delay: This indicates how long in advance the client
      *                 received the last frame before having to display it.
-     * @audio delay:   The latency of the audio playback or MAX_UINT if it
+     * @audio_delay:   The latency of the audio playback or MAX_UINT if it
      *                 is not tracked.
      */
     void (*client_stream_report)(VideoEncoder *encoder,
commit 69640d105490a76486a59a82956cb87662388860
Author: Frediano Ziglio <freddy77 at gmail.com>
Date:   Tue Jun 23 18:51:03 2020 +0100

    reds: Remove useless label and goto statements
    
    Not needed anymore.
    
    Signed-off-by: Frediano Ziglio <freddy77 at gmail.com>
    Acked-by: Francesco Giudici <fgiudici at redhat.com>

diff --git a/server/reds.cpp b/server/reds.cpp
index c3e94cb1..3a27ce2b 100644
--- a/server/reds.cpp
+++ b/server/reds.cpp
@@ -2386,11 +2386,11 @@ static RedLinkInfo *reds_init_client_connection(RedsState *reds, int socket)
     RedLinkInfo *link;
 
     if (!red_socket_set_non_blocking(socket, TRUE)) {
-       goto error;
+        return NULL;
     }
 
     if (!red_socket_set_no_delay(socket, TRUE)) {
-       goto error;
+        return NULL;
     }
 
     red_socket_set_keepalive(socket, TRUE, KEEPALIVE_TIMEOUT);
@@ -2407,9 +2407,6 @@ static RedLinkInfo *reds_init_client_connection(RedsState *reds, int socket)
     openssl_init(link);
 
     return link;
-
-error:
-    return NULL;
 }
 
 


More information about the Spice-commits mailing list