[Spice-devel] [PATCH spice-server 04/18] sound: Rename some objects
Frediano Ziglio
fziglio at redhat.com
Wed Nov 23 18:07:18 UTC 2016
SndChannel -> SndChannelClient
SndWorker -> SndChannel
This patch and following one will base SndChannel on RedChannel and
SndChannelClient on RedChannelClient.
Start doing some mechanical rename to prepare the ground.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
server/sound.c | 174 ++++++++++++++++++++++++++++-----------------------------
1 file changed, 87 insertions(+), 87 deletions(-)
diff --git a/server/sound.c b/server/sound.c
index 4dd2ea3..73af3c9 100644
--- a/server/sound.c
+++ b/server/sound.c
@@ -73,18 +73,18 @@ enum PlaybackCommand {
#define SND_PLAYBACK_PCM_MASK (1 << SND_PLAYBACK_PCM)
#define SND_PLAYBACK_LATENCY_MASK ( 1 << SND_PLAYBACK_LATENCY)
-typedef struct SndChannel SndChannel;
+typedef struct SndChannelClient SndChannelClient;
typedef void (*snd_channel_send_messages_proc)(void *in_channel);
-typedef int (*snd_channel_handle_message_proc)(SndChannel *channel, size_t size, uint32_t type, void *message);
-typedef void (*snd_channel_on_message_done_proc)(SndChannel *channel);
-typedef void (*snd_channel_cleanup_channel_proc)(SndChannel *channel);
+typedef int (*snd_channel_handle_message_proc)(SndChannelClient *channel, size_t size, uint32_t type, void *message);
+typedef void (*snd_channel_on_message_done_proc)(SndChannelClient *channel);
+typedef void (*snd_channel_cleanup_channel_proc)(SndChannelClient *channel);
-typedef struct SndWorker SndWorker;
+typedef struct SndChannel SndChannel;
/* Connects an audio channel to a Spice client */
-struct SndChannel {
+struct SndChannelClient {
RedsStream *stream;
- SndWorker *worker;
+ SndChannel *worker;
spice_parse_channel_func_t parser;
int refs;
@@ -127,7 +127,7 @@ struct AudioFrame {
};
struct PlaybackChannel {
- SndChannel base;
+ SndChannelClient base;
AudioFrame frames[3];
AudioFrame *free_frames;
AudioFrame *in_progress; /* Frame being sent to the client */
@@ -145,10 +145,10 @@ typedef struct SpiceVolumeState {
} SpiceVolumeState;
/* Base class for SpicePlaybackState and SpiceRecordState */
-struct SndWorker {
+struct SndChannel {
RedChannel *base_channel;
- SndChannel *connection; /* Only one client is supported */
- SndWorker *next; /* For the global SndWorker list */
+ SndChannelClient *connection; /* Only one client is supported */
+ SndChannel *next; /* For the global SndChannel list */
int active;
SpiceVolumeState volume;
@@ -156,15 +156,15 @@ struct SndWorker {
};
struct SpicePlaybackState {
- struct SndWorker worker;
+ struct SndChannel worker;
};
struct SpiceRecordState {
- struct SndWorker worker;
+ struct SndChannel worker;
};
typedef struct RecordChannel {
- SndChannel base;
+ SndChannelClient base;
uint32_t samples[RECORD_SAMPLES_SIZE];
uint32_t write_pos;
uint32_t read_pos;
@@ -176,37 +176,37 @@ typedef struct RecordChannel {
} RecordChannel;
/* A list of all Spice{Playback,Record}State objects */
-static SndWorker *workers;
+static SndChannel *workers;
-static void snd_receive(SndChannel *channel);
-static void snd_playback_start(SndWorker *worker);
-static void snd_record_start(SndWorker *worker);
+static void snd_receive(SndChannelClient *channel);
+static void snd_playback_start(SndChannel *worker);
+static void snd_record_start(SndChannel *worker);
-static SndChannel *snd_channel_ref(SndChannel *channel)
+static SndChannelClient *snd_channel_ref(SndChannelClient *channel)
{
channel->refs++;
return channel;
}
-static SndChannel *snd_channel_unref(SndChannel *channel)
+static SndChannelClient *snd_channel_unref(SndChannelClient *channel)
{
if (!--channel->refs) {
- spice_printerr("SndChannel=%p freed", channel);
+ spice_printerr("SndChannelClient=%p freed", channel);
free(channel);
return NULL;
}
return channel;
}
-static RedsState* snd_channel_get_server(SndChannel *channel)
+static RedsState* snd_channel_get_server(SndChannelClient *channel)
{
g_return_val_if_fail(channel != NULL, NULL);
return red_channel_get_server(channel->worker->base_channel);
}
-static void snd_disconnect_channel(SndChannel *channel)
+static void snd_disconnect_channel(SndChannelClient *channel)
{
- SndWorker *worker;
+ SndChannel *worker;
RedsState *reds;
RedChannel *red_channel;
uint32_t type;
@@ -218,7 +218,7 @@ static void snd_disconnect_channel(SndChannel *channel)
red_channel = red_channel_client_get_channel(channel->channel_client);
reds = snd_channel_get_server(channel);
g_object_get(red_channel, "channel-type", &type, NULL);
- spice_debug("SndChannel=%p rcc=%p type=%d",
+ spice_debug("SndChannelClient=%p rcc=%p type=%d",
channel, channel->channel_client, type);
worker = channel->worker;
channel->cleanup(channel);
@@ -240,7 +240,7 @@ static void snd_playback_free_frame(PlaybackChannel *playback_channel, AudioFram
playback_channel->free_frames = frame;
}
-static void snd_playback_on_message_done(SndChannel *channel)
+static void snd_playback_on_message_done(SndChannelClient *channel)
{
PlaybackChannel *playback_channel = (PlaybackChannel *)channel;
if (playback_channel->in_progress) {
@@ -252,11 +252,11 @@ static void snd_playback_on_message_done(SndChannel *channel)
}
}
-static void snd_record_on_message_done(SndChannel *channel)
+static void snd_record_on_message_done(SndChannelClient *channel)
{
}
-static int snd_send_data(SndChannel *channel)
+static int snd_send_data(SndChannelClient *channel)
{
uint32_t n;
@@ -356,7 +356,7 @@ static int snd_record_handle_write(RecordChannel *record_channel, size_t size, v
return TRUE;
}
-static int snd_playback_handle_message(SndChannel *channel, size_t size, uint32_t type, void *message)
+static int snd_playback_handle_message(SndChannelClient *channel, size_t size, uint32_t type, void *message)
{
if (!channel) {
return FALSE;
@@ -372,7 +372,7 @@ static int snd_playback_handle_message(SndChannel *channel, size_t size, uint32_
return TRUE;
}
-static int snd_record_handle_message(SndChannel *channel, size_t size, uint32_t type, void *message)
+static int snd_record_handle_message(SndChannelClient *channel, size_t size, uint32_t type, void *message)
{
RecordChannel *record_channel = (RecordChannel *)channel;
@@ -384,7 +384,7 @@ static int snd_record_handle_message(SndChannel *channel, size_t size, uint32_t
return snd_record_handle_write((RecordChannel *)channel, size, message);
case SPICE_MSGC_RECORD_MODE: {
SpiceMsgcRecordMode *mode = (SpiceMsgcRecordMode *)message;
- SndWorker *worker = channel->worker;
+ SndChannel *worker = channel->worker;
record_channel->mode_time = mode->time;
if (mode->mode != SPICE_AUDIO_DATA_MODE_RAW) {
if (snd_codec_is_capable(mode->mode, worker->frequency)) {
@@ -420,7 +420,7 @@ static int snd_record_handle_message(SndChannel *channel, size_t size, uint32_t
return TRUE;
}
-static void snd_receive(SndChannel *channel)
+static void snd_receive(SndChannelClient *channel)
{
SpiceDataHeaderOpaque *header;
@@ -502,7 +502,7 @@ static void snd_receive(SndChannel *channel)
static void snd_event(int fd, int event, void *data)
{
- SndChannel *channel = data;
+ SndChannelClient *channel = data;
if (event & SPICE_WATCH_EVENT_READ) {
snd_receive(channel);
@@ -512,7 +512,7 @@ static void snd_event(int fd, int event, void *data)
}
}
-static inline int snd_reset_send_data(SndChannel *channel, uint16_t verb)
+static inline int snd_reset_send_data(SndChannelClient *channel, uint16_t verb)
{
SpiceDataHeaderOpaque *header;
@@ -538,7 +538,7 @@ static inline int snd_reset_send_data(SndChannel *channel, uint16_t verb)
return TRUE;
}
-static int snd_begin_send_message(SndChannel *channel)
+static int snd_begin_send_message(SndChannelClient *channel)
{
SpiceDataHeaderOpaque *header = &channel->channel_client->priv->send_data.header;
@@ -548,7 +548,7 @@ static int snd_begin_send_message(SndChannel *channel)
return snd_send_data(channel);
}
-static int snd_channel_send_migrate(SndChannel *channel)
+static int snd_channel_send_migrate(SndChannelClient *channel)
{
SpiceMsgMigrate migrate;
@@ -567,7 +567,7 @@ static int snd_playback_send_migrate(PlaybackChannel *channel)
return snd_channel_send_migrate(&channel->base);
}
-static int snd_send_volume(SndChannel *channel, uint32_t cap, int msg)
+static int snd_send_volume(SndChannelClient *channel, uint32_t cap, int msg)
{
SpiceMsgAudioVolume *vol;
uint8_t c;
@@ -597,7 +597,7 @@ static int snd_playback_send_volume(PlaybackChannel *playback_channel)
SPICE_MSG_PLAYBACK_VOLUME);
}
-static int snd_send_mute(SndChannel *channel, uint32_t cap, int msg)
+static int snd_send_mute(SndChannelClient *channel, uint32_t cap, int msg)
{
SpiceMsgAudioMute mute;
SpiceVolumeState *st = &channel->worker->volume;
@@ -623,7 +623,7 @@ static int snd_playback_send_mute(PlaybackChannel *playback_channel)
static int snd_playback_send_latency(PlaybackChannel *playback_channel)
{
- SndChannel *channel = &playback_channel->base;
+ SndChannelClient *channel = &playback_channel->base;
SpiceMsgPlaybackLatency latency_msg;
spice_debug("latency %u", playback_channel->latency);
@@ -637,7 +637,7 @@ static int snd_playback_send_latency(PlaybackChannel *playback_channel)
}
static int snd_playback_send_start(PlaybackChannel *playback_channel)
{
- SndChannel *channel = (SndChannel *)playback_channel;
+ SndChannelClient *channel = (SndChannelClient *)playback_channel;
SpiceMsgPlaybackStart start;
if (!snd_reset_send_data(channel, SPICE_MSG_PLAYBACK_START)) {
@@ -656,7 +656,7 @@ static int snd_playback_send_start(PlaybackChannel *playback_channel)
static int snd_playback_send_stop(PlaybackChannel *playback_channel)
{
- SndChannel *channel = (SndChannel *)playback_channel;
+ SndChannelClient *channel = (SndChannelClient *)playback_channel;
if (!snd_reset_send_data(channel, SPICE_MSG_PLAYBACK_STOP)) {
return FALSE;
@@ -667,7 +667,7 @@ static int snd_playback_send_stop(PlaybackChannel *playback_channel)
static int snd_playback_send_ctl(PlaybackChannel *playback_channel)
{
- SndChannel *channel = (SndChannel *)playback_channel;
+ SndChannelClient *channel = (SndChannelClient *)playback_channel;
if ((channel->client_active = channel->active)) {
return snd_playback_send_start(playback_channel);
@@ -678,7 +678,7 @@ static int snd_playback_send_ctl(PlaybackChannel *playback_channel)
static int snd_record_send_start(RecordChannel *record_channel)
{
- SndChannel *channel = (SndChannel *)record_channel;
+ SndChannelClient *channel = (SndChannelClient *)record_channel;
SpiceMsgRecordStart start;
if (!snd_reset_send_data(channel, SPICE_MSG_RECORD_START)) {
@@ -696,7 +696,7 @@ static int snd_record_send_start(RecordChannel *record_channel)
static int snd_record_send_stop(RecordChannel *record_channel)
{
- SndChannel *channel = (SndChannel *)record_channel;
+ SndChannelClient *channel = (SndChannelClient *)record_channel;
if (!snd_reset_send_data(channel, SPICE_MSG_RECORD_STOP)) {
return FALSE;
@@ -707,7 +707,7 @@ static int snd_record_send_stop(RecordChannel *record_channel)
static int snd_record_send_ctl(RecordChannel *record_channel)
{
- SndChannel *channel = (SndChannel *)record_channel;
+ SndChannelClient *channel = (SndChannelClient *)record_channel;
if ((channel->client_active = channel->active)) {
return snd_record_send_start(record_channel);
@@ -739,7 +739,7 @@ static int snd_record_send_migrate(RecordChannel *record_channel)
static int snd_playback_send_write(PlaybackChannel *playback_channel)
{
- SndChannel *channel = (SndChannel *)playback_channel;
+ SndChannelClient *channel = (SndChannelClient *)playback_channel;
AudioFrame *frame;
SpiceMsgPlaybackPacket msg;
@@ -774,7 +774,7 @@ static int snd_playback_send_write(PlaybackChannel *playback_channel)
static int playback_send_mode(PlaybackChannel *playback_channel)
{
- SndChannel *channel = (SndChannel *)playback_channel;
+ SndChannelClient *channel = (SndChannelClient *)playback_channel;
SpiceMsgPlaybackMode mode;
if (!snd_reset_send_data(channel, SPICE_MSG_PLAYBACK_MODE)) {
@@ -790,7 +790,7 @@ static int playback_send_mode(PlaybackChannel *playback_channel)
static void snd_playback_send(void* data)
{
PlaybackChannel *playback_channel = (PlaybackChannel*)data;
- SndChannel *channel = (SndChannel*)playback_channel;
+ SndChannelClient *channel = (SndChannelClient*)playback_channel;
if (!playback_channel || !snd_send_data(data)) {
return;
@@ -844,7 +844,7 @@ static void snd_playback_send(void* data)
static void snd_record_send(void* data)
{
RecordChannel *record_channel = (RecordChannel*)data;
- SndChannel *channel = (SndChannel*)record_channel;
+ SndChannelClient *channel = (SndChannelClient*)record_channel;
if (!record_channel || !snd_send_data(data)) {
return;
@@ -873,7 +873,7 @@ static void snd_record_send(void* data)
}
}
-static SndChannel *__new_channel(SndWorker *worker, int size, uint32_t channel_id,
+static SndChannelClient *__new_channel(SndChannel *worker, int size, uint32_t channel_id,
RedClient *client,
RedsStream *stream,
int migrate,
@@ -884,7 +884,7 @@ static SndChannel *__new_channel(SndWorker *worker, int size, uint32_t channel_i
uint32_t *common_caps, int num_common_caps,
uint32_t *caps, int num_caps)
{
- SndChannel *channel;
+ SndChannelClient *channel;
int delay_val;
int flags;
#ifdef SO_PRIORITY
@@ -970,12 +970,12 @@ error1:
static void snd_disconnect_channel_client(RedChannelClient *rcc)
{
- SndWorker *worker;
+ SndChannel *worker;
RedChannel *channel = red_channel_client_get_channel(rcc);
uint32_t type;
spice_assert(channel);
- worker = (SndWorker *)g_object_get_data(G_OBJECT(channel), "sound-worker");
+ worker = (SndChannel *)g_object_get_data(G_OBJECT(channel), "sound-worker");
spice_assert(worker);
g_object_get(channel, "channel-type", &type, NULL);
@@ -986,7 +986,7 @@ static void snd_disconnect_channel_client(RedChannelClient *rcc)
}
}
-static void snd_set_command(SndChannel *channel, uint32_t command)
+static void snd_set_command(SndChannelClient *channel, uint32_t command)
{
if (!channel) {
return;
@@ -999,7 +999,7 @@ SPICE_GNUC_VISIBLE void spice_server_playback_set_volume(SpicePlaybackInstance *
uint16_t *volume)
{
SpiceVolumeState *st = &sin->st->worker.volume;
- SndChannel *channel = sin->st->worker.connection;
+ SndChannelClient *channel = sin->st->worker.connection;
PlaybackChannel *playback_channel = SPICE_CONTAINEROF(channel, PlaybackChannel, base);
st->volume_nchannels = nchannels;
@@ -1015,7 +1015,7 @@ SPICE_GNUC_VISIBLE void spice_server_playback_set_volume(SpicePlaybackInstance *
SPICE_GNUC_VISIBLE void spice_server_playback_set_mute(SpicePlaybackInstance *sin, uint8_t mute)
{
SpiceVolumeState *st = &sin->st->worker.volume;
- SndChannel *channel = sin->st->worker.connection;
+ SndChannelClient *channel = sin->st->worker.connection;
PlaybackChannel *playback_channel = SPICE_CONTAINEROF(channel, PlaybackChannel, base);
st->mute = mute;
@@ -1026,9 +1026,9 @@ SPICE_GNUC_VISIBLE void spice_server_playback_set_mute(SpicePlaybackInstance *si
snd_playback_send_mute(playback_channel);
}
-static void snd_playback_start(SndWorker *worker)
+static void snd_playback_start(SndChannel *worker)
{
- SndChannel *channel = worker->connection;
+ SndChannelClient *channel = worker->connection;
worker->active = 1;
if (!channel)
@@ -1051,7 +1051,7 @@ SPICE_GNUC_VISIBLE void spice_server_playback_start(SpicePlaybackInstance *sin)
SPICE_GNUC_VISIBLE void spice_server_playback_stop(SpicePlaybackInstance *sin)
{
- SndChannel *channel = sin->st->worker.connection;
+ SndChannelClient *channel = sin->st->worker.connection;
PlaybackChannel *playback_channel = SPICE_CONTAINEROF(channel, PlaybackChannel, base);
sin->st->worker.active = 0;
@@ -1079,7 +1079,7 @@ SPICE_GNUC_VISIBLE void spice_server_playback_stop(SpicePlaybackInstance *sin)
SPICE_GNUC_VISIBLE void spice_server_playback_get_buffer(SpicePlaybackInstance *sin,
uint32_t **frame, uint32_t *num_samples)
{
- SndChannel *channel = sin->st->worker.connection;
+ SndChannelClient *channel = sin->st->worker.connection;
PlaybackChannel *playback_channel = SPICE_CONTAINEROF(channel, PlaybackChannel, base);
if (!channel || !playback_channel->free_frames) {
@@ -1122,7 +1122,7 @@ SPICE_GNUC_VISIBLE void spice_server_playback_put_samples(SpicePlaybackInstance
void snd_set_playback_latency(RedClient *client, uint32_t latency)
{
- SndWorker *now = workers;
+ SndChannel *now = workers;
for (; now; now = now->next) {
uint32_t type;
@@ -1159,7 +1159,7 @@ static int snd_desired_audio_mode(int playback_compression, int frequency,
return SPICE_AUDIO_DATA_MODE_RAW;
}
-static void on_new_playback_channel(SndWorker *worker, SndChannel *snd_channel)
+static void on_new_playback_channel(SndChannel *worker, SndChannelClient *snd_channel)
{
RedsState *reds = red_channel_get_server(worker->base_channel);
@@ -1178,7 +1178,7 @@ static void on_new_playback_channel(SndWorker *worker, SndChannel *snd_channel)
}
}
-static void snd_playback_cleanup(SndChannel *channel)
+static void snd_playback_cleanup(SndChannelClient *channel)
{
PlaybackChannel *playback_channel = SPICE_CONTAINEROF(channel, PlaybackChannel, base);
@@ -1193,7 +1193,7 @@ static void snd_set_playback_peer(RedChannel *channel, RedClient *client, RedsSt
int migration, int num_common_caps, uint32_t *common_caps,
int num_caps, uint32_t *caps)
{
- SndWorker *worker = g_object_get_data(G_OBJECT(channel), "sound-worker");
+ SndChannel *worker = g_object_get_data(G_OBJECT(channel), "sound-worker");
PlaybackChannel *playback_channel;
snd_disconnect_channel(worker->connection);
@@ -1246,12 +1246,12 @@ static void snd_set_playback_peer(RedChannel *channel, RedClient *client, RedsSt
static void snd_record_migrate_channel_client(RedChannelClient *rcc)
{
- SndWorker *worker;
+ SndChannel *worker;
RedChannel *channel = red_channel_client_get_channel(rcc);
spice_debug(NULL);
spice_assert(channel);
- worker = (SndWorker *)g_object_get_data(G_OBJECT(channel), "sound-worker");
+ worker = (SndChannel *)g_object_get_data(G_OBJECT(channel), "sound-worker");
spice_assert(worker);
if (worker->connection) {
@@ -1266,7 +1266,7 @@ SPICE_GNUC_VISIBLE void spice_server_record_set_volume(SpiceRecordInstance *sin,
uint16_t *volume)
{
SpiceVolumeState *st = &sin->st->worker.volume;
- SndChannel *channel = sin->st->worker.connection;
+ SndChannelClient *channel = sin->st->worker.connection;
RecordChannel *record_channel = SPICE_CONTAINEROF(channel, RecordChannel, base);
st->volume_nchannels = nchannels;
@@ -1282,7 +1282,7 @@ SPICE_GNUC_VISIBLE void spice_server_record_set_volume(SpiceRecordInstance *sin,
SPICE_GNUC_VISIBLE void spice_server_record_set_mute(SpiceRecordInstance *sin, uint8_t mute)
{
SpiceVolumeState *st = &sin->st->worker.volume;
- SndChannel *channel = sin->st->worker.connection;
+ SndChannelClient *channel = sin->st->worker.connection;
RecordChannel *record_channel = SPICE_CONTAINEROF(channel, RecordChannel, base);
st->mute = mute;
@@ -1293,9 +1293,9 @@ SPICE_GNUC_VISIBLE void spice_server_record_set_mute(SpiceRecordInstance *sin, u
snd_record_send_mute(record_channel);
}
-static void snd_record_start(SndWorker *worker)
+static void snd_record_start(SndChannel *worker)
{
- SndChannel *channel = worker->connection;
+ SndChannelClient *channel = worker->connection;
RecordChannel *record_channel = SPICE_CONTAINEROF(channel, RecordChannel, base);
worker->active = 1;
@@ -1320,7 +1320,7 @@ SPICE_GNUC_VISIBLE void spice_server_record_start(SpiceRecordInstance *sin)
SPICE_GNUC_VISIBLE void spice_server_record_stop(SpiceRecordInstance *sin)
{
- SndChannel *channel = sin->st->worker.connection;
+ SndChannelClient *channel = sin->st->worker.connection;
RecordChannel *record_channel = SPICE_CONTAINEROF(channel, RecordChannel, base);
sin->st->worker.active = 0;
@@ -1339,7 +1339,7 @@ SPICE_GNUC_VISIBLE void spice_server_record_stop(SpiceRecordInstance *sin)
SPICE_GNUC_VISIBLE uint32_t spice_server_record_get_samples(SpiceRecordInstance *sin,
uint32_t *samples, uint32_t bufsize)
{
- SndChannel *channel = sin->st->worker.connection;
+ SndChannelClient *channel = sin->st->worker.connection;
RecordChannel *record_channel = SPICE_CONTAINEROF(channel, RecordChannel, base);
uint32_t read_pos;
uint32_t now;
@@ -1356,7 +1356,7 @@ SPICE_GNUC_VISIBLE uint32_t spice_server_record_get_samples(SpiceRecordInstance
len = MIN(record_channel->write_pos - record_channel->read_pos, bufsize);
if (len < bufsize) {
- SndWorker *worker = record_channel->base.worker;
+ SndChannel *worker = record_channel->base.worker;
snd_receive(&record_channel->base);
if (!worker->connection) {
return 0;
@@ -1374,7 +1374,7 @@ SPICE_GNUC_VISIBLE uint32_t spice_server_record_get_samples(SpiceRecordInstance
return len;
}
-static uint32_t snd_get_best_rate(SndChannel *channel, uint32_t cap_opus)
+static uint32_t snd_get_best_rate(SndChannelClient *channel, uint32_t cap_opus)
{
int client_can_opus = TRUE;
if (channel) {
@@ -1387,7 +1387,7 @@ static uint32_t snd_get_best_rate(SndChannel *channel, uint32_t cap_opus)
return SND_CODEC_CELT_PLAYBACK_FREQ;
}
-static void snd_set_rate(SndWorker *worker, uint32_t frequency, uint32_t cap_opus)
+static void snd_set_rate(SndChannel *worker, uint32_t frequency, uint32_t cap_opus)
{
RedChannel *channel = worker->base_channel;
worker->frequency = frequency;
@@ -1416,7 +1416,7 @@ SPICE_GNUC_VISIBLE void spice_server_set_record_rate(SpiceRecordInstance *sin, u
snd_set_rate(&sin->st->worker, frequency, SPICE_RECORD_CAP_OPUS);
}
-static void on_new_record_channel(SndWorker *worker, SndChannel *snd_channel)
+static void on_new_record_channel(SndChannel *worker, SndChannelClient *snd_channel)
{
spice_assert(snd_channel);
@@ -1429,7 +1429,7 @@ static void on_new_record_channel(SndWorker *worker, SndChannel *snd_channel)
}
}
-static void snd_record_cleanup(SndChannel *channel)
+static void snd_record_cleanup(SndChannelClient *channel)
{
RecordChannel *record_channel = SPICE_CONTAINEROF(channel, RecordChannel, base);
snd_codec_destroy(&record_channel->codec);
@@ -1439,7 +1439,7 @@ static void snd_set_record_peer(RedChannel *channel, RedClient *client, RedsStre
int migration, int num_common_caps, uint32_t *common_caps,
int num_caps, uint32_t *caps)
{
- SndWorker *worker = g_object_get_data(G_OBJECT(channel), "sound-worker");
+ SndChannel *worker = g_object_get_data(G_OBJECT(channel), "sound-worker");
RecordChannel *record_channel;
snd_disconnect_channel(worker->connection);
@@ -1470,11 +1470,11 @@ static void snd_set_record_peer(RedChannel *channel, RedClient *client, RedsStre
static void snd_playback_migrate_channel_client(RedChannelClient *rcc)
{
- SndWorker *worker;
+ SndChannel *worker;
RedChannel *channel = red_channel_client_get_channel(rcc);
spice_assert(channel);
- worker = (SndWorker *)g_object_get_data(G_OBJECT(channel), "sound-worker");
+ worker = (SndChannel *)g_object_get_data(G_OBJECT(channel), "sound-worker");
spice_assert(worker);
spice_debug(NULL);
@@ -1485,15 +1485,15 @@ static void snd_playback_migrate_channel_client(RedChannelClient *rcc)
}
}
-static void add_worker(SndWorker *worker)
+static void add_worker(SndChannel *worker)
{
worker->next = workers;
workers = worker;
}
-static void remove_worker(SndWorker *worker)
+static void remove_worker(SndChannel *worker)
{
- SndWorker **now = &workers;
+ SndChannel **now = &workers;
while (*now) {
if (*now == worker) {
*now = worker->next;
@@ -1506,7 +1506,7 @@ static void remove_worker(SndWorker *worker)
void snd_attach_playback(RedsState *reds, SpicePlaybackInstance *sin)
{
- SndWorker *playback_worker;
+ SndChannel *playback_worker;
RedChannel *channel;
ClientCbs client_cbs = { NULL, };
@@ -1535,7 +1535,7 @@ void snd_attach_playback(RedsState *reds, SpicePlaybackInstance *sin)
void snd_attach_record(RedsState *reds, SpiceRecordInstance *sin)
{
- SndWorker *record_worker;
+ SndChannel *record_worker;
RedChannel *channel;
ClientCbs client_cbs = { NULL, };
@@ -1560,7 +1560,7 @@ void snd_attach_record(RedsState *reds, SpiceRecordInstance *sin)
reds_register_channel(reds, channel);
}
-static void snd_detach_common(SndWorker *worker)
+static void snd_detach_common(SndChannel *worker)
{
if (!worker) {
return;
@@ -1588,7 +1588,7 @@ void snd_detach_record(SpiceRecordInstance *sin)
void snd_set_playback_compression(int on)
{
- SndWorker *now = workers;
+ SndChannel *now = workers;
for (; now; now = now->next) {
uint32_t type;
--
2.7.4
More information about the Spice-devel
mailing list