server: Add some comments to the sound structures.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Francois Gouget <fgouget@xxxxxxxxxxxxxxx>
---

More are probably needed but at least those would have helped me when I 
started looking at this code. (As would renaming SndWorker to SndState 
and making it clearer it's a base class.)

 server/sound.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/server/sound.c b/server/sound.c
index 03d88eb..1cc4cfa 100644
--- a/server/sound.c
+++ b/server/sound.c
@@ -79,6 +79,7 @@ typedef void (*snd_channel_cleanup_channel_proc)(SndChannel *channel);
 
 typedef struct SndWorker SndWorker;
 
+/* Connects an audio channel to a Spice client */
 struct SndChannel {
     RedsStream *stream;
     SndWorker *worker;
@@ -131,18 +132,20 @@ struct PlaybackChannel {
     SndChannel base;
     AudioFrame frames[3];
     AudioFrame *free_frames;
-    AudioFrame *in_progress;
-    AudioFrame *pending_frame;
+    AudioFrame *in_progress;   /* Frame being sent to the client */
+    AudioFrame *pending_frame; /* Next frame to send to the client */
     uint32_t mode;
     uint32_t latency;
     SndCodec codec;
     uint8_t  encode_buf[SND_CODEC_MAX_COMPRESSED_BYTES];
 };
 
+/* Base class for SpicePlaybackState and SpiceRecordState */
 struct SndWorker {
     RedChannel *base_channel;
-    SndChannel *connection;
-    SndWorker *next;
+    SndChannel *connection; /* Only one client is supported */
+    SndWorker *next; /* For the global SndWorker list */
+
     int active;
 };
 
@@ -178,6 +181,7 @@ typedef struct RecordChannel {
     uint8_t  decode_buf[SND_CODEC_MAX_FRAME_BYTES];
 } RecordChannel;
 
+/* A list of all Spice{Playback,Record}State objects */
 static SndWorker *workers;
 static uint32_t playback_compression = TRUE;
 
-- 
2.7.0
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]