Permalink
Browse files

spice-client is deprecated, remote-viewer from virt-viewer

is replacement.
  • Loading branch information...
1 parent 56bfe0a commit 8efd38ee9bf2c384544613628ae34e4cfa61c348 @jirib committed Nov 6, 2012
View
53 x11/spice-client/Makefile
@@ -1,53 +0,0 @@
-# $OpenBSD$
-
-COMMENT= client side implementation of the SPICE protocol
-
-DISTNAME= spice-0.12.0
-CATEGORIES= x11 net
-
-HOMEPAGE= http://www.spice-space.org
-
-# LGPLv2.1
-PERMIT_PACKAGE_CDROM= Yes
-PERMIT_PACKAGE_FTP= Yes
-PERMIT_DISTFILES_CDROM= Yes
-PERMIT_DISTFILES_FTP= Yes
-
-MASTER_SITES= ${HOMEPAGE}/download/releases/
-EXTRACT_SUFX= .tar.bz2
-
-MODULES = lang/python
-
-BUILD_DEPENDS= devel/spice-protocol \
- devel/py-parsing \
- audio/celt051 \
- security/cyrus-sasl2 \
- graphics/jpeg \
- devel/glib2
-
-RUN_DEPENDS= devel/spice-protocol \
- audio/celt051 \
- security/cyrus-sasl2 \
- graphics/jpeg \
- devel/glib2
-
-USE_GMAKE= Yes
-USE_LIBTOOL= Yes
-
-CONFIGURE_STYLE=gnu
-CONFIGURE_ARGS= ${CONFIGURE_SHARED} \
- --enable-client \
- --disable-celt051 \
- --disable-smartcard
-
-CONFIGURE_ENV+= CPPFLAGS="-I${LOCALBASE}/include" \
- LDFLAGS="-L${LOCALBASE}/lib"
-
-MAKE_ENV = CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include" LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib"
-
-do-build:
- @cd ${WRKSRC}/client && \
- env -i ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} \
- -f ${MAKE_FILE} ${ALL_TARGET}
-
-.include <bsd.port.mk>
View
55 x11/spice-client/TODO
@@ -1,55 +0,0 @@
-* make configure happy
-
-./configure[17314]: SPICE_NONPKGCONFIG_LIBS+= -pthread -lm : not found
-checking for posix yield function... sched_yield
-checking for PIXMAN... yes
-./configure[17922]: SPICE_REQUIRES+= pixman-1 >= 0.17.7: not found
-checking for CELT051... yes
-./configure[18018]: SPICE_REQUIRES+= celt051 >= 0.5.1.1: not found
-checking for pyparsing python module... found
-checking for SSL... yes
-./configure[18222]: SPICE_REQUIRES+= openssl: not found
-./configure[18330]: SPICE_NONPKGCONFIG_LIBS+= : not found
-checking for XRANDR... yes
-checking for XFIXES... yes
-checking for MISC_X... yes
-checking for XRANDR12... yes
-checking for XINERAMA... yes
-./configure[18802]: SPICE_REQUIRES+= xinerama: not found
-
-* audio..., it needs porting to sndio as this uses alsa by default
-
-/usr/include/g++/istream:631: warning: redundant redeclaration of 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::ignore(std::streamsize, typename _Traits::int_type) [with _CharT = wchar_t, _Traits = std::char_traits<wchar_t>]' in same scope [-Wredundant-decls]
-/usr/include/g++/istream:447: warning: previous declaration of 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::ignore(std::streamsize, typename _Traits::int_type) [with _CharT = wchar_t, _Traits = std::char_traits<wchar_t>]' [-Wredundant-decls]
-In file included from x11/platform.cpp:60:
-x11/record.h:48: error: ISO C++ forbids declaration of 'snd_pcm_t' with no type
-x11/record.h:48: error: expected ';' before '*' token
-x11/record.h:49: error: ISO C++ forbids declaration of 'snd_pcm_hw_params_t' with no type
-x11/record.h:49: error: expected ';' before '*' token
-x11/record.h:50: error: ISO C++ forbids declaration of 'snd_pcm_sw_params_t' with no type
-x11/record.h:50: error: expected ';' before '*' token
-In file included from x11/platform.cpp:61:
-x11/playback.h:41: error: ISO C++ forbids declaration of 'snd_pcm_t' with no type
-x11/playback.h:41: error: expected ';' before '*' token
-x11/playback.h:42: error: ISO C++ forbids declaration of 'snd_pcm_hw_params_t' with no type
-x11/playback.h:42: error: expected ';' before '*' token
-x11/playback.h:43: error: ISO C++ forbids declaration of 'snd_pcm_sw_params_t' with no type
-x11/playback.h:43: error: expected ';' before '*' token
-x11/platform.cpp: In static member function 'static uint64_t Platform::get_thread_id()':
-x11/platform.cpp:585: error: 'SYS_gettid' was not declared in this scope
-x11/platform.cpp: In static member function 'static void Platform::set_thread_priority(void*, Platform::ThreadPriority)':
-x11/platform.cpp:647: error: 'SYS_gettid' was not declared in this scope
-x11/platform.cpp: In member function 'SpicePoint MultyMonScreen::get_trans_top_left()':
-x11/platform.cpp:1467: error: 'MAXINT' was not declared in this scope
-x11/platform.cpp: In member function 'SpicePoint MultyMonScreen::get_trans_bottom_right()':
-x11/platform.cpp:1481: error: 'MININT' was not declared in this scope
-x11/platform.cpp: In function 'void ensure_clipboard_data_space(uint32_t)':
-x11/platform.cpp:2542: error: 'assert' was not declared in this scope
-x11/platform.cpp: In function 'int get_selection(XEvent&, Atom, Atom, int, unsigned char**, bool)':
-x11/platform.cpp:2700: error: 'assert' was not declared in this scope
-x11/platform.cpp: In function 'void root_win_proc(XEvent&)':
-x11/platform.cpp:2942: error: 'assert' was not declared in this scope
-gmake: *** [x11/platform.o] Error 1
-*** Error 2 in /data/01/cvs/OpenBSD/ports/mystuff/x11/spice-client (Makefile:51 'do-build')
-*** Error 1 in /data/01/cvs/OpenBSD/ports/mystuff/x11/spice-client (/data/01/cvs/OpenBSD/ports/infrastructure/mk/bsd.port.mk:2525 '/data/01/pobj/spice-0.12.0/.build_done')
-*** Error 1 in /data/01/cvs/OpenBSD/ports/mystuff/x11/spice-client (/data/01/cvs/OpenBSD/ports/infrastructure/mk/bsd.port.mk:2251 'build')
View
2 x11/spice-client/distinfo
@@ -1,2 +0,0 @@
-SHA256 (spice-0.12.0.tar.bz2) = atfO+FJ+0CdcMF5vmcR4h5dsog5l7vFkoQQeQ741t5Y=
-SIZE (spice-0.12.0.tar.bz2) = 1486425
View
45 x11/spice-client/patches/patch-client_audio_channels_h
@@ -1,45 +0,0 @@
-$OpenBSD$
---- client/audio_channels.h.orig Wed Aug 22 18:37:03 2012
-+++ client/audio_channels.h Mon Oct 22 21:24:29 2012
-@@ -18,7 +18,9 @@
- #ifndef _H_AUDIO_CHANNELS
- #define _H_AUDIO_CHANNELS
-
-+#if HAVE_CELT051
- #include <celt051/celt.h>
-+#endif
-
- #include "red_channel.h"
- #include "debug.h"
-@@ -45,7 +47,9 @@ class PlaybackChannel: public RedChannel { (private)
- void handle_start(RedPeer::InMessage* message);
- void handle_stop(RedPeer::InMessage* message);
- void handle_raw_data(RedPeer::InMessage* message);
-+#if HAVE_CELT051
- void handle_celt_data(RedPeer::InMessage* message);
-+#endif
- void null_handler(RedPeer::InMessage* message);
- void disable();
-
-@@ -57,8 +61,10 @@ class PlaybackChannel: public RedChannel { (private)
- WavePlaybackAbstract* _wave_player;
- uint32_t _mode;
- uint32_t _frame_bytes;
-+#if HAVE_CELT051
- CELTMode *_celt_mode;
- CELTDecoder *_celt_decoder;
-+#endif
- bool _playing;
- uint32_t _frame_count;
- };
-@@ -96,8 +102,10 @@ class RecordChannel: public RedChannel, private Platfo
- Mutex _messages_lock;
- std::list<RecordSamplesMessage *> _messages;
- int _mode;
-+#if HAVE_CELT051
- CELTMode *_celt_mode;
- CELTEncoder *_celt_encoder;
-+#endif
- uint32_t _frame_bytes;
-
- static int data_mode;
View
110 x11/spice-client/patches/patch-client_playback_channel_cpp
@@ -1,110 +0,0 @@
-$OpenBSD$
---- client/playback_channel.cpp.orig Wed Aug 22 08:09:01 2012
-+++ client/playback_channel.cpp Mon Oct 22 21:24:29 2012
-@@ -151,8 +151,10 @@ PlaybackChannel::PlaybackChannel(RedClient& client, ui
- Platform::PRIORITY_HIGH)
- , _wave_player (NULL)
- , _mode (SPICE_AUDIO_DATA_MODE_INVALID)
-+#if HAVE_CELT051
- , _celt_mode (NULL)
- , _celt_decoder (NULL)
-+#endif
- , _playing (false)
- {
- #ifdef WAVE_CAPTURE
-@@ -169,7 +171,9 @@ PlaybackChannel::PlaybackChannel(RedClient& client, ui
-
- handler->set_handler(SPICE_MSG_PLAYBACK_MODE, &PlaybackChannel::handle_mode);
-
-+#if HAVE_CELT051
- set_capability(SPICE_PLAYBACK_CAP_CELT_0_5_1);
-+#endif
- }
-
- void PlaybackChannel::clear()
-@@ -182,6 +186,7 @@ void PlaybackChannel::clear()
- }
- _mode = SPICE_AUDIO_DATA_MODE_INVALID;
-
-+#if HAVE_CELT051
- if (_celt_decoder) {
- celt051_decoder_destroy(_celt_decoder);
- _celt_decoder = NULL;
-@@ -191,6 +196,7 @@ void PlaybackChannel::clear()
- celt051_mode_destroy(_celt_mode);
- _celt_mode = NULL;
- }
-+#endif
- }
-
- void PlaybackChannel::on_disconnect()
-@@ -214,8 +220,10 @@ void PlaybackChannel::set_data_handler()
-
- if (_mode == SPICE_AUDIO_DATA_MODE_RAW) {
- handler->set_handler(SPICE_MSG_PLAYBACK_DATA, &PlaybackChannel::handle_raw_data);
-+#if HAVE_CELT051
- } else if (_mode == SPICE_AUDIO_DATA_MODE_CELT_0_5_1) {
- handler->set_handler(SPICE_MSG_PLAYBACK_DATA, &PlaybackChannel::handle_celt_data);
-+#endif
- } else {
- THROW("invalid mode");
- }
-@@ -224,8 +232,11 @@ void PlaybackChannel::set_data_handler()
- void PlaybackChannel::handle_mode(RedPeer::InMessage* message)
- {
- SpiceMsgPlaybackMode* playbacke_mode = (SpiceMsgPlaybackMode*)message->data();
-- if (playbacke_mode->mode != SPICE_AUDIO_DATA_MODE_RAW &&
-- playbacke_mode->mode != SPICE_AUDIO_DATA_MODE_CELT_0_5_1) {
-+ if (playbacke_mode->mode != SPICE_AUDIO_DATA_MODE_RAW
-+#if HAVE_CELT051
-+ && playbacke_mode->mode != SPICE_AUDIO_DATA_MODE_CELT_0_5_1
-+#endif
-+ ) {
- THROW("invalid mode");
- }
-
-@@ -265,9 +276,6 @@ void PlaybackChannel::handle_start(RedPeer::InMessage*
- start_wave();
- #endif
- if (!_wave_player) {
-- // for now support only one setting
-- int celt_mode_err;
--
- if (start->format != SPICE_AUDIO_FMT_S16) {
- THROW("unexpected format");
- }
-@@ -284,6 +292,10 @@ void PlaybackChannel::handle_start(RedPeer::InMessage*
- return;
- }
-
-+#if HAVE_CELT051
-+ // for now support only one setting
-+ int celt_mode_err;
-+
- if (!(_celt_mode = celt051_mode_create(start->frequency, start->channels,
- frame_size, &celt_mode_err))) {
- THROW("create celt mode failed %d", celt_mode_err);
-@@ -292,6 +304,7 @@ void PlaybackChannel::handle_start(RedPeer::InMessage*
- if (!(_celt_decoder = celt051_decoder_create(_celt_mode))) {
- THROW("create celt decoder");
- }
-+#endif
- }
- _playing = true;
- _frame_count = 0;
-@@ -333,6 +346,7 @@ void PlaybackChannel::handle_raw_data(RedPeer::InMessa
- _wave_player->write(data);
- }
-
-+#if HAVE_CELT051
- void PlaybackChannel::handle_celt_data(RedPeer::InMessage* message)
- {
- SpiceMsgPlaybackPacket* packet = (SpiceMsgPlaybackPacket*)message->data();
-@@ -352,6 +366,7 @@ void PlaybackChannel::handle_celt_data(RedPeer::InMess
- }
- _wave_player->write((uint8_t *)pcm);
- }
-+#endif
-
- class PlaybackFactory: public ChannelFactory {
- public:
View
93 x11/spice-client/patches/patch-client_record_channel_cpp
@@ -1,93 +0,0 @@
-$OpenBSD$
---- client/record_channel.cpp.orig Wed Aug 22 08:09:01 2012
-+++ client/record_channel.cpp Mon Oct 22 21:24:29 2012
-@@ -72,8 +72,10 @@ RecordChannel::RecordChannel(RedClient& client, uint32
- : RedChannel(client, SPICE_CHANNEL_RECORD, id, new RecordHandler(*this))
- , _wave_recorder (NULL)
- , _mode (SPICE_AUDIO_DATA_MODE_INVALID)
-+#if HAVE_CELT051
- , _celt_mode (NULL)
- , _celt_encoder (NULL)
-+#endif
- {
- for (int i = 0; i < NUM_SAMPLES_MESSAGES; i++) {
- _messages.push_front(new RecordSamplesMessage(*this));
-@@ -142,7 +144,11 @@ void RecordChannel::handle_start(RedPeer::InMessage* m
-
- handler->set_handler(SPICE_MSG_RECORD_START, NULL);
- handler->set_handler(SPICE_MSG_RECORD_STOP, &RecordChannel::handle_stop);
-+#if HAVE_CELT051
- ASSERT(!_wave_recorder && !_celt_mode && !_celt_encoder);
-+#else
-+ ASSERT(!_wave_recorder);
-+#endif
-
- // for now support only one setting
- if (start->format != SPICE_AUDIO_FMT_S16) {
-@@ -160,8 +166,9 @@ void RecordChannel::handle_start(RedPeer::InMessage* m
- }
-
- int frame_size = 256;
-- int celt_mode_err;
- _frame_bytes = frame_size * bits_per_sample * start->channels / 8;
-+#if HAVE_CELT051
-+ int celt_mode_err;
- if (!(_celt_mode = celt051_mode_create(start->frequency, start->channels, frame_size,
- &celt_mode_err))) {
- THROW("create celt mode failed %d", celt_mode_err);
-@@ -170,6 +177,7 @@ void RecordChannel::handle_start(RedPeer::InMessage* m
- if (!(_celt_encoder = celt051_encoder_create(_celt_mode))) {
- THROW("create celt encoder failed");
- }
-+#endif
-
- send_start_mark();
- _wave_recorder->start();
-@@ -182,6 +190,7 @@ void RecordChannel::clear()
- delete _wave_recorder;
- _wave_recorder = NULL;
- }
-+#if HAVE_CELT051
- if (_celt_encoder) {
- celt051_encoder_destroy(_celt_encoder);
- _celt_encoder = NULL;
-@@ -190,6 +199,7 @@ void RecordChannel::clear()
- celt051_mode_destroy(_celt_mode);
- _celt_mode = NULL;
- }
-+#endif
- }
-
- void RecordChannel::handle_stop(RedPeer::InMessage* message)
-@@ -200,7 +210,9 @@ void RecordChannel::handle_stop(RedPeer::InMessage* me
- if (!_wave_recorder) {
- return;
- }
-+#if HAVE_CELT051
- ASSERT(_celt_mode && _celt_encoder);
-+#endif
- clear();
- }
-
-@@ -254,8 +266,9 @@ void RecordChannel::push_frame(uint8_t *frame)
- DBG(0, "blocked");
- return;
- }
-- uint8_t celt_buf[CELT_COMPRESSED_FRAME_BYTES];
- int n;
-+#if HAVE_CELT051
-+ uint8_t celt_buf[CELT_COMPRESSED_FRAME_BYTES];
-
- if (_mode == SPICE_AUDIO_DATA_MODE_CELT_0_5_1) {
- n = celt051_encode(_celt_encoder, (celt_int16_t *)frame, NULL, celt_buf,
-@@ -264,7 +277,9 @@ void RecordChannel::push_frame(uint8_t *frame)
- THROW("celt encode failed");
- }
- frame = celt_buf;
-- } else {
-+ } else
-+#endif
-+ {
- n = _frame_bytes;
- }
- RedPeer::OutMessage& peer_message = message->peer_message();
View
33 x11/spice-client/patches/patch-configure_ac
@@ -1,33 +0,0 @@
-$OpenBSD$
---- configure.ac.orig Fri Sep 14 23:45:28 2012
-+++ configure.ac Mon Oct 22 21:24:29 2012
-@@ -146,6 +146,9 @@ AM_CONDITIONAL(SUPPORT_SMARTCARD, test "x$enable_smart
- if test "x$enable_smartcard" = "xyes"; then
- AC_DEFINE([USE_SMARTCARD], [1], [Define if supporting smartcard proxying])
- fi
-+AC_ARG_ENABLE(celt051,
-+[ --disable-celt051 Disable celt051 audio codec (enabled by default)],,
-+[enable_celt051="yes"])
-
- AC_ARG_ENABLE(client,
- [ --enable-client Enable spice client],,
-@@ -241,11 +244,14 @@ AC_SUBST(PIXMAN_CFLAGS)
- AC_SUBST(PIXMAN_LIBS)
- SPICE_REQUIRES+=" pixman-1 >= 0.17.7"
-
--PKG_CHECK_MODULES(CELT051, celt051 >= 0.5.1.1)
--AC_SUBST(CELT051_CFLAGS)
--AC_SUBST(CELT051_LIBS)
--AC_SUBST(CELT051_LIBDIR)
--SPICE_REQUIRES+=" celt051 >= 0.5.1.1"
-+if test "x$enable_celt051" = "xyes"; then
-+ PKG_CHECK_MODULES(CELT051, celt051 >= 0.5.1.1)
-+ SPICE_REQUIRES+=" celt051 >= 0.5.1.1"
-+ AC_DEFINE([HAVE_CELT051], 1, [Define if we have celt051 codec])
-+ AC_SUBST(CELT051_CFLAGS)
-+ AC_SUBST(CELT051_LIBS)
-+ AC_SUBST(CELT051_LIBDIR)
-+fi
-
- if test ! -e client/generated_marshallers.cpp; then
- AC_MSG_CHECKING([for pyparsing python module])
View
279 x11/spice-client/patches/patch-server_snd_worker_c
@@ -1,279 +0,0 @@
-$OpenBSD$
---- server/snd_worker.c.orig Sun Sep 2 19:32:51 2012
-+++ server/snd_worker.c Mon Oct 22 21:24:29 2012
-@@ -25,7 +25,9 @@
- #include <sys/socket.h>
- #include <netinet/ip.h>
- #include <netinet/tcp.h>
-+#if HAVE_CELT051
- #include <celt051/celt.h>
-+#endif
-
- #include "common/marshaller.h"
- #include "common/generated_server_marshallers.h"
-@@ -135,12 +137,14 @@ typedef struct PlaybackChannel {
- AudioFrame *free_frames;
- AudioFrame *in_progress;
- AudioFrame *pending_frame;
-+ uint32_t mode;
-+#if HAVE_CELT051
- CELTMode *celt_mode;
- CELTEncoder *celt_encoder;
-- uint32_t mode;
- struct {
- uint8_t celt_buf[CELT_COMPRESSED_FRAME_BYTES];
- } send_data;
-+#endif
- } PlaybackChannel;
-
- struct SndWorker {
-@@ -176,13 +180,21 @@ typedef struct RecordChannel {
- uint32_t mode;
- uint32_t mode_time;
- uint32_t start_time;
-+#if HAVE_CELT051
- CELTDecoder *celt_decoder;
- CELTMode *celt_mode;
- uint32_t celt_buf[FRAME_SIZE];
-+#endif
- } RecordChannel;
-
- static SndWorker *workers;
--static uint32_t playback_compression = SPICE_AUDIO_DATA_MODE_CELT_0_5_1;
-+static uint32_t playback_compression =
-+#if HAVE_CELT051
-+ SPICE_AUDIO_DATA_MODE_CELT_0_5_1
-+#else
-+ SPICE_AUDIO_DATA_MODE_RAW
-+#endif
-+ ;
-
- static void snd_receive(void* data);
-
-@@ -316,6 +328,7 @@ static int snd_record_handle_write(RecordChannel *reco
- packet = (SpiceMsgcRecordPacket *)message;
- size = packet->data_size;
-
-+#if HAVE_CELT051
- if (record_channel->mode == SPICE_AUDIO_DATA_MODE_CELT_0_5_1) {
- int celt_err = celt051_decode(record_channel->celt_decoder, packet->data, size,
- (celt_int16_t *)record_channel->celt_buf);
-@@ -325,7 +338,9 @@ static int snd_record_handle_write(RecordChannel *reco
- }
- data = record_channel->celt_buf;
- size = FRAME_SIZE;
-- } else if (record_channel->mode == SPICE_AUDIO_DATA_MODE_RAW) {
-+ } else
-+#endif
-+ if (record_channel->mode == SPICE_AUDIO_DATA_MODE_RAW) {
- data = (uint32_t *)packet->data;
- size = size >> 2;
- size = MIN(size, RECORD_SAMPLES_SIZE);
-@@ -380,12 +395,14 @@ static int snd_record_handle_message(SndChannel *chann
- SpiceMsgcRecordMode *mode = (SpiceMsgcRecordMode *)message;
- record_channel->mode = mode->mode;
- record_channel->mode_time = mode->time;
-- if (record_channel->mode != SPICE_AUDIO_DATA_MODE_CELT_0_5_1 &&
-- record_channel->mode != SPICE_AUDIO_DATA_MODE_RAW) {
-+ if (record_channel->mode != SPICE_AUDIO_DATA_MODE_RAW
-+#if HAVE_CELT051
-+ && record_channel->mode != SPICE_AUDIO_DATA_MODE_CELT_0_5_1
-+#endif
-+ )
- spice_printerr("unsupported mode");
- }
- break;
-- }
- case SPICE_MSGC_RECORD_START_MARK: {
- SpiceMsgcRecordStartMark *mark = (SpiceMsgcRecordStartMark *)message;
- record_channel->start_time = mark->time;
-@@ -737,6 +754,7 @@ static int snd_playback_send_write(PlaybackChannel *pl
-
- spice_marshall_msg_playback_data(channel->send_data.marshaller, &msg);
-
-+#if HAVE_CELT051
- if (playback_channel->mode == SPICE_AUDIO_DATA_MODE_CELT_0_5_1) {
- int n = celt051_encode(playback_channel->celt_encoder, (celt_int16_t *)frame->samples, NULL,
- playback_channel->send_data.celt_buf, CELT_COMPRESSED_FRAME_BYTES);
-@@ -747,7 +765,9 @@ static int snd_playback_send_write(PlaybackChannel *pl
- }
- spice_marshaller_add_ref(channel->send_data.marshaller,
- playback_channel->send_data.celt_buf, n);
-- } else {
-+ } else
-+#endif
-+ {
- spice_marshaller_add_ref(channel->send_data.marshaller,
- (uint8_t *)frame->samples, sizeof(frame->samples));
- }
-@@ -1116,8 +1136,10 @@ static void snd_playback_cleanup(SndChannel *channel)
- reds_enable_mm_timer();
- }
-
-+#if HAVE_CELT051
- celt051_encoder_destroy(playback_channel->celt_encoder);
- celt051_mode_destroy(playback_channel->celt_mode);
-+#endif
- }
-
- static void snd_set_playback_peer(RedChannel *channel, RedClient *client, RedsStream *stream,
-@@ -1127,13 +1149,13 @@ static void snd_set_playback_peer(RedChannel *channel,
- SndWorker *worker = channel->data;
- PlaybackChannel *playback_channel;
- SpicePlaybackState *st = SPICE_CONTAINEROF(worker, SpicePlaybackState, worker);
-- CELTEncoder *celt_encoder;
-- CELTMode *celt_mode;
-- int celt_error;
-- RedChannelClient *rcc;
-
- snd_disconnect_channel(worker->connection);
-
-+#if HAVE_CELT051
-+ CELTEncoder *celt_encoder;
-+ CELTMode *celt_mode;
-+ int celt_error;
- if (!(celt_mode = celt051_mode_create(SPICE_INTERFACE_PLAYBACK_FREQ,
- SPICE_INTERFACE_PLAYBACK_CHAN,
- FRAME_SIZE, &celt_error))) {
-@@ -1145,6 +1167,7 @@ static void snd_set_playback_peer(RedChannel *channel,
- spice_printerr("create celt encoder failed");
- goto error_1;
- }
-+#endif
-
- if (!(playback_channel = (PlaybackChannel *)__new_channel(worker,
- sizeof(*playback_channel),
-@@ -1161,16 +1184,20 @@ static void snd_set_playback_peer(RedChannel *channel,
- goto error_2;
- }
- worker->connection = &playback_channel->base;
-- rcc = playback_channel->base.channel_client;
- snd_playback_free_frame(playback_channel, &playback_channel->frames[0]);
- snd_playback_free_frame(playback_channel, &playback_channel->frames[1]);
- snd_playback_free_frame(playback_channel, &playback_channel->frames[2]);
-
-+#if HAVE_CELT051
- playback_channel->celt_mode = celt_mode;
- playback_channel->celt_encoder = celt_encoder;
-- playback_channel->mode = red_channel_client_test_remote_cap(rcc,
-- SPICE_PLAYBACK_CAP_CELT_0_5_1) ?
-+ playback_channel->mode =
-+ red_channel_client_test_remote_cap(playback_channel->base.channel_client,
-+ SPICE_PLAYBACK_CAP_CELT_0_5_1) ?
- playback_compression : SPICE_AUDIO_DATA_MODE_RAW;
-+#else
-+ playback_channel->mode = SPICE_AUDIO_DATA_MODE_RAW;
-+#endif
-
- on_new_playback_channel(worker);
- if (worker->active) {
-@@ -1180,10 +1207,13 @@ static void snd_set_playback_peer(RedChannel *channel,
- return;
-
- error_2:
-+#if HAVE_CELT051
- celt051_encoder_destroy(celt_encoder);
-
- error_1:
- celt051_mode_destroy(celt_mode);
-+#endif
-+ return;
- }
-
- static void snd_record_migrate_channel_client(RedChannelClient *rcc)
-@@ -1323,10 +1353,12 @@ static void on_new_record_channel(SndWorker *worker)
-
- static void snd_record_cleanup(SndChannel *channel)
- {
-+#if HAVE_CELT051
- RecordChannel *record_channel = SPICE_CONTAINEROF(channel, RecordChannel, base);
-
- celt051_decoder_destroy(record_channel->celt_decoder);
- celt051_mode_destroy(record_channel->celt_mode);
-+#endif
- }
-
- static void snd_set_record_peer(RedChannel *channel, RedClient *client, RedsStream *stream,
-@@ -1336,12 +1368,13 @@ static void snd_set_record_peer(RedChannel *channel, R
- SndWorker *worker = channel->data;
- RecordChannel *record_channel;
- SpiceRecordState *st = SPICE_CONTAINEROF(worker, SpiceRecordState, worker);
-- CELTDecoder *celt_decoder;
-- CELTMode *celt_mode;
-- int celt_error;
-
- snd_disconnect_channel(worker->connection);
-
-+#if HAVE_CELT051
-+ CELTDecoder *celt_decoder;
-+ CELTMode *celt_mode;
-+ int celt_error;
- if (!(celt_mode = celt051_mode_create(SPICE_INTERFACE_RECORD_FREQ,
- SPICE_INTERFACE_RECORD_CHAN,
- FRAME_SIZE, &celt_error))) {
-@@ -1353,6 +1386,7 @@ static void snd_set_record_peer(RedChannel *channel, R
- spice_printerr("create celt decoder failed");
- goto error_1;
- }
-+#endif
-
- if (!(record_channel = (RecordChannel *)__new_channel(worker,
- sizeof(*record_channel),
-@@ -1371,8 +1405,10 @@ static void snd_set_record_peer(RedChannel *channel, R
-
- worker->connection = &record_channel->base;
-
-+#if HAVE_CELT051
- record_channel->celt_mode = celt_mode;
- record_channel->celt_decoder = celt_decoder;
-+#endif
-
- on_new_record_channel(worker);
- if (worker->active) {
-@@ -1382,10 +1418,13 @@ static void snd_set_record_peer(RedChannel *channel, R
- return;
-
- error_2:
-+#if HAVE_CELT051
- celt051_decoder_destroy(celt_decoder);
-
- error_1:
- celt051_mode_destroy(celt_mode);
-+#endif
-+ return;
- }
-
- static void snd_playback_migrate_channel_client(RedChannelClient *rcc)
-@@ -1442,7 +1481,9 @@ void snd_attach_playback(SpicePlaybackInstance *sin)
- client_cbs.migrate = snd_playback_migrate_channel_client;
- red_channel_register_client_cbs(channel, &client_cbs);
- red_channel_set_data(channel, playback_worker);
-+#if HAVE_CELT051
- red_channel_set_cap(channel, SPICE_PLAYBACK_CAP_CELT_0_5_1);
-+#endif
- red_channel_set_cap(channel, SPICE_PLAYBACK_CAP_VOLUME);
-
- playback_worker->base_channel = channel;
-@@ -1469,7 +1510,9 @@ void snd_attach_record(SpiceRecordInstance *sin)
- client_cbs.migrate = snd_record_migrate_channel_client;
- red_channel_register_client_cbs(channel, &client_cbs);
- red_channel_set_data(channel, record_worker);
-+#if HAVE_CELT051
- red_channel_set_cap(channel, SPICE_RECORD_CAP_CELT_0_5_1);
-+#endif
- red_channel_set_cap(channel, SPICE_RECORD_CAP_VOLUME);
-
- record_worker->base_channel = channel;
-@@ -1516,7 +1559,11 @@ void snd_set_playback_compression(int on)
- {
- SndWorker *now = workers;
-
-- playback_compression = on ? SPICE_AUDIO_DATA_MODE_CELT_0_5_1 : SPICE_AUDIO_DATA_MODE_RAW;
-+ playback_compression =
-+#if HAVE_CELT051
-+ on ? SPICE_AUDIO_DATA_MODE_CELT_0_5_1 :
-+#endif
-+ SPICE_AUDIO_DATA_MODE_RAW;
- for (; now; now = now->next) {
- if (now->base_channel->type == SPICE_CHANNEL_PLAYBACK && now->connection) {
- SndChannel* sndchannel = now->connection;

0 comments on commit 8efd38e

Please sign in to comment.