summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-06-06 21:40:50 +0200
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-06-06 21:40:50 +0200
commit7f249d1dde1e0c4f7023926ce96a87bb7734c57b (patch)
tree2bf46c2ea8a12f40db58ac54ef2a0fd571625eba
parent71f48c6e91419fc7161f8a75fbaebd2adc58ed77 (diff)
downloadxine-lib-7f249d1dde1e0c4f7023926ce96a87bb7734c57b.tar.gz
xine-lib-7f249d1dde1e0c4f7023926ce96a87bb7734c57b.tar.bz2
Remove aRTs output plugin.
ALSA's DMix can allow to run both xine and aRTs at the same time for Linux, and if other operating systems lacks a proper software mixing facility you can consider alternative daemons. Note: aRTs will not be present in KDE 4.
-rw-r--r--ChangeLog4
-rw-r--r--m4/audio_out.m419
-rw-r--r--m4/summary.m41
-rw-r--r--src/audio_out/Makefile.am9
-rw-r--r--src/audio_out/audio_arts_out.c418
5 files changed, 4 insertions, 447 deletions
diff --git a/ChangeLog b/ChangeLog
index 685d79a1f..c3cc1399e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -28,6 +28,10 @@ xine-lib (1.1.90) (Unreleased)
initialisation, even for audio files that nothing have to do with modplug.
* Collapse the Ogg demuxer, and the Theora, Vorbis and Speex decoders in the
same 'xiph' plugin.
+ * Remove aRTs output plugin; ALSA's DMix can allow to run both xine and aRTs
+ at the same time for Linux, and if other operating systems lacks a proper
+ software mixing facility you can consider alternative daemons. Note: aRTs
+ will not be present in KDE 4.
xine-lib (1.1.7) (unreleased)
* Support libdca (new name for libdts) by shuffling around the dts.h file.
diff --git a/m4/audio_out.m4 b/m4/audio_out.m4
index cdfe8b65d..4288c32d5 100644
--- a/m4/audio_out.m4
+++ b/m4/audio_out.m4
@@ -7,7 +7,6 @@ AC_DEFUN([XINE_AUDIO_OUT_PLUGINS], [
dnl explicitly requested to do so on other operating systems.
dnl Notes:
dnl - Alsa is Linux only
- dnl - aRts is Linux only
dnl - CoreAudio is Mac OS X only
dnl - EsounD is reported to be available on most platforms
dnl - FusionSound is Linux only, but don't enable it by default
@@ -22,7 +21,6 @@ AC_DEFUN([XINE_AUDIO_OUT_PLUGINS], [
default_enable_sunaudio=disable
default_with_alsa=without
- default_with_arts=without
default_with_esound=with
default_with_fusionsound=without
default_with_jack=without
@@ -47,7 +45,6 @@ AC_DEFUN([XINE_AUDIO_OUT_PLUGINS], [
;;
linux*)
default_with_alsa=with
- default_with_arts=with
default_with_jack=with
default_with_pulseaudio=with
;;
@@ -81,22 +78,6 @@ AC_DEFUN([XINE_AUDIO_OUT_PLUGINS], [
AM_CONDITIONAL([ENABLE_ALSA], [test x"$have_alsa" = x"yes"])
- dnl aRts support
- AC_ARG_WITH([arts],
- [AS_HELP_STRING([--with-arts], [Build with aRts audio output support])],
- [test x"$withval" != x"no" && with_arts="yes"],
- [test $default_with_arts = without && with_arts="no"])
- if test x"$with_arts" != x"no"; then
- ACX_PACKAGE_CHECK([ARTS], [0.9.5], [artsc-config], [have_arts=yes], [have_arts=no])
- if test x"$with_arts" = x"yes" && test x"$have_arts" != x"yes"; then
- AC_MSG_ERROR([aRts support requested, but aRts not found])
- elif test x"$have_arts" = x"yes"; then
- AC_DEFINE([HAVE_ARTS], 1, [Define this if you have aRts (libartsc) installed])
- fi
- fi
- AM_CONDITIONAL([ENABLE_ARTS], [test x"$have_arts" = x"yes"])
-
-
dnl CoreAudio for Mac OS X
AC_ARG_ENABLE([coreaudio],
[AS_HELP_STRING([--enable-coreaudio], [Enable support for Mac OS X CoreAudio])],
diff --git a/m4/summary.m4 b/m4/summary.m4
index 792c5d319..19c8ff479 100644
--- a/m4/summary.m4
+++ b/m4/summary.m4
@@ -274,7 +274,6 @@ AC_DEFUN([XINE_LIB_SUMMARY], [
dnl Audio plugins
echo " * audio driver plugins:"
test x"$have_alsa" = x"yes" && echo " - alsa (ALSA - Advanced Linux Sound Architecture)"
- test x"$have_arts" = x"yes" && echo " - arts (aRts - KDE soundserver)"
test x"$have_coreaudio" = x"yes" && echo " - CoreAudio (Mac OS X audio driver)"
test x"$have_directx" = x"yes" && echo " - directx (DirectX audio driver)"
test x"$have_esound" = x"yes" && echo " - esd (Enlightened Sound Daemon)"
diff --git a/src/audio_out/Makefile.am b/src/audio_out/Makefile.am
index 8759b123f..cb3eb79d3 100644
--- a/src/audio_out/Makefile.am
+++ b/src/audio_out/Makefile.am
@@ -32,10 +32,6 @@ endif
#irixal_module = xineplug_ao_out_irixal.la
#endif
-if ENABLE_ARTS
-arts_module = xineplug_ao_out_arts.la
-endif
-
if ENABLE_DIRECTX
directx_module = xineplug_ao_out_directx.la
directx2_module = xineplug_ao_out_directx2.la
@@ -63,7 +59,6 @@ xineplug_LTLIBRARIES = \
$(oss_module) \
$(alsa_module) \
$(sun_module) \
- $(arts_module) \
$(esd_module) \
$(directx_module) \
$(coreaudio_module) \
@@ -96,10 +91,6 @@ xineplug_ao_out_sun_la_LIBADD = $(XINE_LIB)
#xineplug_ao_out_irixal_la_LIBADD = $(IRIXAL_LIBS)
#xineplug_ao_out_irixal_la_CFLAGS = $(AM_CFLAGS) $(IRIXAL_CFLAGS)
-xineplug_ao_out_arts_la_SOURCES = audio_arts_out.c
-xineplug_ao_out_arts_la_LIBADD = $(ARTS_LIBS) $(XINE_LIB)
-xineplug_ao_out_arts_la_CFLAGS = $(AM_CFLAGS) $(ARTS_CFLAGS)
-
xineplug_ao_out_directx_la_SOURCES = audio_directx_out.c
xineplug_ao_out_directx_la_LIBADD = $(DIRECTX_AUDIO_LIBS) $(XINE_LIB)
xineplug_ao_out_directx_la_CPPFLAGS = $(AM_CPPFLAGS) $(DIRECTX_CPPFLAGS)
diff --git a/src/audio_out/audio_arts_out.c b/src/audio_out/audio_arts_out.c
deleted file mode 100644
index f38575aff..000000000
--- a/src/audio_out/audio_arts_out.c
+++ /dev/null
@@ -1,418 +0,0 @@
-/*
- * Copyright (C) 2000-2003 the xine project
- *
- * This file is part of xine, a free video player.
- *
- * xine is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * xine is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- *
- * $Id: audio_arts_out.c,v 1.32 2006/07/16 16:18:09 dsalt Exp $
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <math.h>
-#include <unistd.h>
-#include <inttypes.h>
-#include <artsc.h>
-
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "audio_out.h"
-#include "bswap.h"
-
-#define AO_OUT_ARTS_IFACE_VERSION 8
-
-#define AUDIO_NUM_FRAGMENTS 15
-#define AUDIO_FRAGMENT_SIZE 8192
-
-#define GAP_TOLERANCE AO_MAX_GAP
-
-typedef struct arts_driver_s {
-
- ao_driver_t ao_driver;
-
- xine_t *xine;
-
- arts_stream_t audio_stream;
- int capabilities;
- int mode;
-
- int32_t sample_rate;
- uint32_t num_channels;
- uint32_t bits_per_sample;
- uint32_t bytes_per_frame;
-
- uint32_t latency;
-
- struct {
- int volume;
- int mute;
- int vol_scale;
- int v_mixer;
- } mixer;
-
-} arts_driver_t;
-
-typedef struct {
- audio_driver_class_t driver_class;
-
- xine_t *xine;
- int inited;
-} arts_class_t;
-
-/*
- * Software stereo volume control.....
- * Igor Mokrushin <igor@avtomir.ru>
- */
-static void ao_arts_volume(void *buffer, int length, int volume) {
- int v;
- short *data = (short *)buffer;
-
- while (length--) {
- v=(int) ((*(data) * volume) / 100);
- *(data)=(v>32767) ? 32767 : ((v<-32768) ? -32768 : v);
- *(data)=LE_16(data);
- data++;
- }
-}
-/* End volume control */
-
-/*
- * open the audio device for writing to
- */
-static int ao_arts_open(ao_driver_t *this_gen,
- uint32_t bits, uint32_t rate, int mode)
-{
- arts_driver_t *this = (arts_driver_t *) this_gen;
-
- xprintf (this->xine, XINE_VERBOSITY_DEBUG,
- "audio_arts_out: ao_open bits=%d rate=%d, mode=%d\n", bits, rate, mode);
-
- if ( (mode & this->capabilities) == 0 ) {
- xprintf (this->xine, XINE_VERBOSITY_DEBUG, "audio_arts_out: unsupported mode %08x\n", mode);
- return 0;
- }
-
- if (this->audio_stream) {
-
- if ( (mode == this->mode) && (rate == this->sample_rate) )
- return this->sample_rate;
-
- sleep(2); /* arts might segfault if we are still playing */
- arts_close_stream(this->audio_stream);
- }
-
- this->mode = mode;
- this->sample_rate = rate;
- this->bits_per_sample = bits;
-
- switch (mode) {
- case AO_CAP_MODE_MONO:
- this->num_channels = 1;
- break;
- case AO_CAP_MODE_STEREO:
- this->num_channels = 2;
- break;
- }
-
- this->bytes_per_frame=(this->bits_per_sample*this->num_channels)/8;
-
- xprintf (this->xine, XINE_VERBOSITY_DEBUG, "audio_arts_out: %d channels output\n", this->num_channels);
-
- this->audio_stream=arts_play_stream(this->sample_rate, bits, this->num_channels, "xine");
-
- this->latency = arts_stream_get (this->audio_stream, ARTS_P_TOTAL_LATENCY);
-
- /* try to keep latency low, if we don't do this we might end
- with very high latencies for low quality sound and audio_out will
- try to fill gaps every time...(values in ms) */
- if( this->latency > 800 )
- {
- this->latency = 800 - arts_stream_get (this->audio_stream, ARTS_P_SERVER_LATENCY);
- if( this->latency < 100 )
- this->latency = 100;
- arts_stream_set( this->audio_stream, ARTS_P_BUFFER_TIME, this->latency );
- this->latency = arts_stream_get (this->audio_stream, ARTS_P_TOTAL_LATENCY);
- }
-
- xprintf (this->xine, XINE_VERBOSITY_DEBUG, "audio_arts_out : latency %d ms\n", this->latency);
-
- return this->sample_rate;
-}
-
-
-static int ao_arts_num_channels(ao_driver_t *this_gen)
-{
- arts_driver_t *this = (arts_driver_t *) this_gen;
- return this->num_channels;
-}
-
-static int ao_arts_bytes_per_frame(ao_driver_t *this_gen)
-{
- arts_driver_t *this = (arts_driver_t *) this_gen;
- return this->bytes_per_frame;
-}
-
-static int ao_arts_get_gap_tolerance (ao_driver_t *this_gen)
-{
- return GAP_TOLERANCE;
-}
-
-static int ao_arts_write(ao_driver_t *this_gen, int16_t *data,
- uint32_t num_frames)
-{
- arts_driver_t *this = (arts_driver_t *) this_gen;
- int size = num_frames * this->bytes_per_frame;
-
- ao_arts_volume(data, num_frames * this->num_channels, this->mixer.vol_scale );
- arts_write(this->audio_stream, data, size );
-
- return 1;
-}
-
-
-static int ao_arts_delay (ao_driver_t *this_gen)
-{
- arts_driver_t *this = (arts_driver_t *) this_gen;
-
- /* Just convert latency (ms) to frame units.
- please note that there is no function in aRts C API to
- get the current buffer utilization. This is, at best,
- a very roughly aproximation.
- */
-
- return this->latency * this->sample_rate / 1000;
-}
-
-static void ao_arts_close(ao_driver_t *this_gen)
-{
- arts_driver_t *this = (arts_driver_t *) this_gen;
-
- if (this->audio_stream) {
- sleep(2); /* arts might segfault if we are still playing */
- arts_close_stream(this->audio_stream);
- this->audio_stream = NULL;
- }
-}
-
-static uint32_t ao_arts_get_capabilities (ao_driver_t *this_gen) {
- arts_driver_t *this = (arts_driver_t *) this_gen;
- return this->capabilities;
-}
-
-static void ao_arts_exit(ao_driver_t *this_gen)
-{
- arts_driver_t *this = (arts_driver_t *) this_gen;
-
- ao_arts_close(this_gen);
- /* FIXME: arts_free() freezes on BSD, so don't use it there */
-#if !defined(__OpenBSD__) && !defined (__FreeBSD__) && !defined(__NetBSD__)
- arts_free();
-#endif
-
- free (this);
-}
-
-static int ao_arts_get_property (ao_driver_t *this_gen, int property) {
-
- arts_driver_t *this = (arts_driver_t *) this_gen;
-
- switch(property) {
- case AO_PROP_PCM_VOL:
- case AO_PROP_MIXER_VOL:
- if(!this->mixer.mute)
- this->mixer.volume = this->mixer.vol_scale;
- return this->mixer.volume;
- break;
- case AO_PROP_MUTE_VOL:
- return this->mixer.mute;
- break;
- }
- return 0;
-}
-
-static int ao_arts_set_property (ao_driver_t *this_gen, int property, int value) {
-
- arts_driver_t *this = (arts_driver_t *) this_gen;
- int mute = (value) ? 1 : 0;
-
- switch(property) {
- case AO_PROP_PCM_VOL:
- case AO_PROP_MIXER_VOL:
- if(!this->mixer.mute)
- this->mixer.volume = value;
- this->mixer.vol_scale = this->mixer.volume;
- return this->mixer.volume;
- break;
- case AO_PROP_MUTE_VOL:
- if(mute) {
- this->mixer.v_mixer = this->mixer.volume;
- this->mixer.volume = 0;
- this->mixer.vol_scale = this->mixer.volume;
- } else {
- this->mixer.volume = this->mixer.v_mixer;
- this->mixer.vol_scale = this->mixer.volume;
- }
- this->mixer.mute = mute;
- return value;
- break;
- }
-
- return ~value;
-}
-
-static int ao_arts_ctrl(ao_driver_t *this_gen, int cmd, ...) {
- /*arts_driver_t *this = (arts_driver_t *) this_gen;*/
-
- switch (cmd) {
-
- case AO_CTRL_PLAY_PAUSE:
- break;
-
- case AO_CTRL_PLAY_RESUME:
- break;
-
- case AO_CTRL_FLUSH_BUFFERS:
- break;
- }
-
- return 0;
-}
-
-static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *data) {
- arts_class_t *class = (arts_class_t *) class_gen;
- arts_driver_t *this;
- int rc;
-
- lprintf ("audio_arts_out: open_plugin called\n");
-
- this = (arts_driver_t *) xine_xmalloc (sizeof (arts_driver_t));
- if (!this)
- return NULL;
-
- this->xine = class->xine;
-
- if (class->inited == 0) {
- rc = arts_init();
- class->inited++;
- } else {
- xprintf (this->xine, XINE_VERBOSITY_LOG, "audio_arts_out: not trying to initialise a second time\n");
- free(this);
- return NULL;
- }
-
- if (rc < 0) {
- xprintf (this->xine, XINE_VERBOSITY_DEBUG,"audio_arts_out: arts_init failed: %s\n", arts_error_text(rc));
- free(this);
- return NULL;
- }
-
- /*
- * set volume control
- */
- this->mixer.mute = 0;
- this->mixer.vol_scale = 60;
- this->mixer.v_mixer = 0;
- /*
- * set capabilities
- */
- this->capabilities = 0;
- xprintf (this->xine, XINE_VERBOSITY_DEBUG, "audio_arts_out : supported modes are ");
- this->capabilities |= AO_CAP_MODE_MONO | AO_CAP_MIXER_VOL | AO_CAP_PCM_VOL | AO_CAP_MUTE_VOL;
- xprintf (this->xine, XINE_VERBOSITY_DEBUG, "mono ");
- this->capabilities |= AO_CAP_MODE_STEREO | AO_CAP_MIXER_VOL | AO_CAP_PCM_VOL | AO_CAP_MUTE_VOL;
- xprintf (this->xine, XINE_VERBOSITY_DEBUG, "stereo ");
-
- this->sample_rate = 0;
- this->audio_stream = NULL;
-
- this->ao_driver.get_capabilities = ao_arts_get_capabilities;
- this->ao_driver.get_property = ao_arts_get_property;
- this->ao_driver.set_property = ao_arts_set_property;
- this->ao_driver.open = ao_arts_open;
- this->ao_driver.num_channels = ao_arts_num_channels;
- this->ao_driver.bytes_per_frame = ao_arts_bytes_per_frame;
- this->ao_driver.delay = ao_arts_delay;
- this->ao_driver.write = ao_arts_write;
- this->ao_driver.close = ao_arts_close;
- this->ao_driver.exit = ao_arts_exit;
- this->ao_driver.get_gap_tolerance = ao_arts_get_gap_tolerance;
- this->ao_driver.control = ao_arts_ctrl;
-
- return &this->ao_driver;
-}
-
-/*
- * class functions
- */
-
-static char* get_identifier (audio_driver_class_t *this_gen) {
- return "arts";
-}
-
-static char* get_description (audio_driver_class_t *this_gen) {
- return _("xine audio output plugin using kde artsd");
-}
-
-static void dispose_class (audio_driver_class_t *this_gen) {
-
- arts_class_t *this = (arts_class_t *) this_gen;
-
- free (this);
-}
-
-static void *init_class (xine_t *xine, void *data) {
-
- arts_class_t *this;
-
- lprintf ("audio_arts_out: init class\n");
-
- this = (arts_class_t *) xine_xmalloc (sizeof (arts_class_t));
- if (!this)
- return NULL;
-
- this->inited = 0;
-
- this->driver_class.open_plugin = open_plugin;
- this->driver_class.get_identifier = get_identifier;
- this->driver_class.get_description = get_description;
- this->driver_class.dispose = dispose_class;
-
- this->xine = xine;
-
- return this;
-}
-
-static ao_info_t ao_info_arts = {
- 5
-};
-
-/*
- * exported plugin catalog entry
- */
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_AUDIO_OUT, AO_OUT_ARTS_IFACE_VERSION, "arts", XINE_VERSION_CODE, &ao_info_arts, init_class },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
-