summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Knoblich <stkn@gentoo.org>2004-11-30 22:59:27 +0000
committerStefan Knoblich <stkn@gentoo.org>2004-11-30 22:59:27 +0000
commitd85c5b0f02557184f40b8720addede37627061be (patch)
tree3deabd4eed9fba1bd0ff6100b3a063f0cc95cd42 /dev-libs/pwlib
parentupdate WANT_AUTOCONF syntax #71411 (Manifest recommit) (diff)
downloadgentoo-2-d85c5b0f02557184f40b8720addede37627061be.tar.gz
gentoo-2-d85c5b0f02557184f40b8720addede37627061be.tar.bz2
gentoo-2-d85c5b0f02557184f40b8720addede37627061be.zip
backported patch from pwlib cvs, makes it possible to use gnomemeeting w/ alsa+dmix, closes #68553
Diffstat (limited to 'dev-libs/pwlib')
-rw-r--r--dev-libs/pwlib/ChangeLog9
-rw-r--r--dev-libs/pwlib/files/digest-pwlib-1.6.6-r11
-rw-r--r--dev-libs/pwlib/files/pwlib-1.6.6-alsa_dmix.diff259
-rw-r--r--dev-libs/pwlib/pwlib-1.6.6-r1.ebuild155
4 files changed, 423 insertions, 1 deletions
diff --git a/dev-libs/pwlib/ChangeLog b/dev-libs/pwlib/ChangeLog
index c318dc42fefc..bdfdd9f7f444 100644
--- a/dev-libs/pwlib/ChangeLog
+++ b/dev-libs/pwlib/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for dev-libs/pwlib
# Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-libs/pwlib/ChangeLog,v 1.65 2004/11/09 10:32:13 kloeri Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/pwlib/ChangeLog,v 1.66 2004/11/30 22:59:27 stkn Exp $
+
+*pwlib-1.6.6-r1 (30 Nov 2004)
+
+ 30 Nov 2004; <stkn@gentoo.org> +files/pwlib-1.6.6-alsa_dmix.diff,
+ +pwlib-1.6.6-r1.ebuild:
+ backported patch makes it possible to use gnomemeeting (and other apps)
+ to use alsa+dmix for sound output, thx to Benoit Chesneau <bchesneau@gmail.com>
09 Nov 2004; Bryan Østergaard <kloeri@gentoo.org> pwlib-1.6.6.ebuild:
~alpha keyword.
diff --git a/dev-libs/pwlib/files/digest-pwlib-1.6.6-r1 b/dev-libs/pwlib/files/digest-pwlib-1.6.6-r1
new file mode 100644
index 000000000000..82c17312183f
--- /dev/null
+++ b/dev-libs/pwlib/files/digest-pwlib-1.6.6-r1
@@ -0,0 +1 @@
+MD5 c3ae07b03cd48d57cd9d6ec346182ed4 pwlib-v1_6_6-src.tar.gz 1583087
diff --git a/dev-libs/pwlib/files/pwlib-1.6.6-alsa_dmix.diff b/dev-libs/pwlib/files/pwlib-1.6.6-alsa_dmix.diff
new file mode 100644
index 000000000000..2d1ded99770d
--- /dev/null
+++ b/dev-libs/pwlib/files/pwlib-1.6.6-alsa_dmix.diff
@@ -0,0 +1,259 @@
+diff -ru pwlib-orig/plugins/sound_alsa/sound_alsa.cxx pwlib/plugins/sound_alsa/sound_alsa.cxx
+--- pwlib-orig/plugins/sound_alsa/sound_alsa.cxx 2004-03-13 13:36:14.000000000 +0100
++++ pwlib/plugins/sound_alsa/sound_alsa.cxx 2004-10-21 18:33:38.562610536 +0200
+@@ -28,6 +28,21 @@
+ * Contributor(s): /
+ *
+ * $Log: sound_alsa.cxx,v $
++ * Revision 1.21 2004/10/18 11:43:39 dsandras
++ * Use Capture instead of Mic when changing the volume. Use the correct mixer when using the Default device.
++ *
++ * Revision 1.20 2004/10/14 19:30:16 dsandras
++ * Removed DMIX and DSNOOP plugins and added support for DEFAULT as it is the correcti way to do things.
++ *
++ * Revision 1.19 2004/08/30 21:09:41 dsandras
++ * Added DSNOOP plugin support.
++ *
++ * Revision 1.18 2004/05/14 10:15:26 dominance
++ * Fixes direct opening of sound output devices. The list of devices does no longer return NULL in that case. Patch provided by Julien Puydt <julien.puydt@laposte.net>.
++ *
++ * Revision 1.17 2004/04/03 10:33:45 dsandras
++ * Use PStringToOrdinal to store the detected devices, that fixes problems if there is a discontinuity in the succession of soundcard ID's. For example the user has card ID 1 and 3, but not 2.
++ *
+ * Revision 1.16 2004/03/13 12:36:14 dsandras
+ * Added support for DMIX plugin output.
+ *
+@@ -81,8 +96,8 @@
+ PCREATE_SOUND_PLUGIN(ALSA, PSoundChannelALSA)
+
+
+-static PStringArray playback_devices;
+-static PStringArray capture_devices;
++static PStringToOrdinal playback_devices;
++static PStringToOrdinal capture_devices;
+
+ ///////////////////////////////////////////////////////////////////////////////
+
+@@ -119,8 +134,9 @@
+ }
+
+
+-PStringArray PSoundChannelALSA::GetDeviceNames (Directions dir)
++void PSoundChannelALSA::UpdateDictionary (Directions dir)
+ {
++
+ int card = -1, dev = -1;
+
+ snd_ctl_t *handle = NULL;
+@@ -134,12 +150,12 @@
+ if (dir == Recorder) {
+
+ stream = SND_PCM_STREAM_CAPTURE;
+- capture_devices = PStringArray ();
++ capture_devices = PStringToOrdinal ();
+ }
+ else {
+
+ stream = SND_PCM_STREAM_PLAYBACK;
+- playback_devices = PStringArray ();
++ playback_devices = PStringToOrdinal ();
+ }
+
+ snd_ctl_card_info_alloca (&info);
+@@ -148,7 +164,7 @@
+ /* No sound card found */
+ if (snd_card_next (&card) < 0 || card < 0) {
+
+- return PStringArray ();
++ return;
+ }
+
+
+@@ -176,13 +192,11 @@
+ snd_card_get_name (card, &name);
+ if (dir == Recorder) {
+
+- if (capture_devices.GetStringsIndex (name) == P_MAX_INDEX)
+- capture_devices.AppendString (name);
++ capture_devices.SetAt (name, card);
+ }
+ else {
+
+- if (playback_devices.GetStringsIndex (name) == P_MAX_INDEX)
+- playback_devices.AppendString (name);
++ playback_devices.SetAt (name, card);
+ }
+
+ free (name);
+@@ -193,17 +207,27 @@
+ snd_ctl_close(handle);
+ snd_card_next (&card);
+ }
++}
+
+-
+- if (dir == Recorder)
+- return capture_devices;
+- else {
++PStringArray PSoundChannelALSA::GetDeviceNames (Directions dir)
++{
++ PStringArray devices;
++ PStringToOrdinal devices_dict;
+
+- if (playback_devices.GetSize () > 0)
+- playback_devices += "DMIX Plugin";
++ if (dir == Recorder)
++ devices_dict = capture_devices;
++ else
++ devices_dict = playback_devices;
++
++ UpdateDictionary (dir);
++
++ if (devices_dict.GetSize () > 0)
++ devices += "Default";
++
++ for (PINDEX j = 0 ; j < devices_dict.GetSize () ; j++)
++ devices += devices_dict.GetKeyAt (j);
+
+- return playback_devices;
+- }
++ return devices;
+ }
+
+
+@@ -223,7 +247,7 @@
+ unsigned _bitsPerSample)
+ {
+ PString real_device_name;
+- PINDEX i = 0;
++ POrdinalKey *i = NULL;
+ snd_pcm_stream_t stream;
+
+ Close();
+@@ -236,21 +260,31 @@
+ stream = SND_PCM_STREAM_PLAYBACK;
+
+ /* Open in NONBLOCK mode */
+- if (_dir != Recorder && _device == "DMIX Plugin") {
++ if (_device == "Default") {
+
+- real_device_name = "plug:dmix";
++ real_device_name = "default";
++ card_nr = -2;
+ }
+- else if ((i = (_dir == Recorder) ? capture_devices.GetStringsIndex (_device) : playback_devices.GetStringsIndex (_device)) != P_MAX_INDEX) {
++ else {
++
++ if ((_dir == Recorder && capture_devices.IsEmpty ())
++ || (_dir == Player && playback_devices.IsEmpty ()))
++ UpdateDictionary (_dir);
++
++ i = (_dir == Recorder) ? capture_devices.GetAt (_device) : playback_devices.GetAt (_device);
+
+- real_device_name = "plughw:" + PString (i);
+- card_nr = i;
++ if (i) {
++
++ real_device_name = "plughw:" + PString (*i);
++ card_nr = *i;
++ }
++ else {
++
++ PTRACE (1, "ALSA\tDevice not found");
++ return FALSE;
++ }
+ }
+- else {
+
+- PTRACE (1, "ALSA\tDevice unavailable");
+- return FALSE;
+- }
+-
+ if (snd_pcm_open (&os_handle, real_device_name, stream, SND_PCM_NONBLOCK) < 0) {
+
+ PTRACE (1, "ALSA\tOpen Failed");
+@@ -735,7 +769,7 @@
+ snd_mixer_elem_t *elem;
+ snd_mixer_selem_id_t *sid;
+
+- const char *play_mix_name = (direction == Player) ? "PCM": "Mic";
++ const char *play_mix_name = (direction == Player) ? "PCM": "Capture";
+ PString card_name;
+
+ long pmin = 0, pmax = 0;
+@@ -744,7 +778,10 @@
+ if (!os_handle)
+ return FALSE;
+
+- card_name = "hw:" + PString (card_nr);
++ if (card_nr == -2)
++ card_name = "default";
++ else
++ card_name = "hw:" + PString (card_nr);
+
+ //allocate simple id
+ snd_mixer_selem_id_alloca (&sid);
+@@ -796,23 +833,39 @@
+ return FALSE;
+ }
+
+- snd_mixer_selem_get_playback_volume_range (elem, &pmin, &pmax);
+
+ if (set) {
+-
+- vol = (set_vol * (pmax?pmax:31)) / 100;
+- snd_mixer_selem_set_playback_volume (elem,
+- SND_MIXER_SCHN_FRONT_LEFT, vol);
+- snd_mixer_selem_set_playback_volume (elem,
+- SND_MIXER_SCHN_FRONT_RIGHT, vol);
+
++ if (direction == Player) {
++
++ snd_mixer_selem_get_playback_volume_range (elem, &pmin, &pmax);
++ vol = (set_vol * (pmax?pmax:31)) / 100;
++ snd_mixer_selem_set_playback_volume_all (elem, vol);
++ }
++ else {
++
++ snd_mixer_selem_get_capture_volume_range (elem, &pmin, &pmax);
++ vol = (set_vol * (pmax?pmax:31)) / 100;
++ snd_mixer_selem_set_capture_volume_all (elem, vol);
++ }
+ PTRACE (4, "Set volume to " << vol);
+ }
+ else {
+
+- snd_mixer_selem_get_playback_volume (elem,
+- SND_MIXER_SCHN_FRONT_LEFT, &vol);
++ if (direction == Player) {
++
++ snd_mixer_selem_get_playback_volume_range (elem, &pmin, &pmax);
++ snd_mixer_selem_get_playback_volume (elem, SND_MIXER_SCHN_FRONT_LEFT,
++ &vol);
++ }
++ else {
++
++ snd_mixer_selem_get_capture_volume_range (elem, &pmin, &pmax);
++ snd_mixer_selem_get_capture_volume (elem, SND_MIXER_SCHN_FRONT_LEFT,
++ &vol);
++ }
+ get_vol = (vol * 100) / (pmax?pmax:31);
++
+ PTRACE (4, "Got volume " << vol);
+ }
+
+Only in pwlib/plugins/sound_alsa: .sound_alsa.cxx-patch.swp
+diff -ru pwlib-orig/plugins/sound_alsa/sound_alsa.h pwlib/plugins/sound_alsa/sound_alsa.h
+--- pwlib-orig/plugins/sound_alsa/sound_alsa.h 2003-12-28 16:10:35.000000000 +0100
++++ pwlib/plugins/sound_alsa/sound_alsa.h 2004-10-21 18:35:51.559391952 +0200
+@@ -89,7 +89,8 @@
+ BOOL IsOpen() const;
+
+ private:
+-
++
++ static void UpdateDictionary(PSoundChannel::Directions);
+ BOOL Volume (BOOL, unsigned, unsigned &);
+ PSoundChannel::Directions direction;
+ PString device;
+
diff --git a/dev-libs/pwlib/pwlib-1.6.6-r1.ebuild b/dev-libs/pwlib/pwlib-1.6.6-r1.ebuild
new file mode 100644
index 000000000000..fe3e597777e6
--- /dev/null
+++ b/dev-libs/pwlib/pwlib-1.6.6-r1.ebuild
@@ -0,0 +1,155 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/pwlib/pwlib-1.6.6-r1.ebuild,v 1.1 2004/11/30 22:59:27 stkn Exp $
+
+inherit eutils
+
+IUSE="ssl sdl ieee1394 alsa esd"
+
+MY_P="${PN}-v${PV//./_}"
+DESCRIPTION="Portable Multiplatform Class Libraries for OpenH323"
+HOMEPAGE="http://www.openh323.org/"
+SRC_URI="mirror://sourceforge/openh323/${MY_P}-src.tar.gz"
+
+LICENSE="MPL-1.1"
+SLOT="0"
+KEYWORDS="~x86 ~ppc ~amd64 ~sparc ~alpha"
+
+DEPEND=">=sys-devel/bison-1.28
+ >=sys-devel/flex-2.5.4a
+ dev-libs/expat
+ >=sys-apps/sed-4
+ net-nds/openldap
+ sdl? ( media-libs/libsdl )
+ ssl? ( dev-libs/openssl )
+ alsa? ( media-libs/alsa-lib )
+ ieee1394? ( media-libs/libdv
+ sys-libs/libavc1394
+ sys-libs/libraw1394
+ media-plugins/libdc1394 )
+ esd? ( media-sound/esound )"
+
+MAKEOPTS="${MAKEOPTS} -j1"
+S=${WORKDIR}/${PN}
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}/make
+
+ # filter out -O3 and -mcpu embedded compiler flags
+ sed -i \
+ -e "s:-mcpu=\$(CPUTYPE)::" \
+ -e "s:-O3 -DNDEBUG:-DNDEBUG:" \
+ unix.mak
+
+ # small fix for firewire dc (camera) plugin
+ cd ${S}
+ epatch ${FILESDIR}/${P}-ieee1394dc-fix.diff
+
+ # dmix patch for alsa support (#68553)
+ epatch ${FILESDIR}/${P}-alsa_dmix.diff
+}
+
+src_compile() {
+ local plugins
+ local myconf
+
+ if use ssl; then
+ export OPENSSLFLAG=1
+ export OPENSSLDIR="/usr"
+ export OPENSSLLIBS="-lssl -lcrypt"
+ fi
+
+ ## gnomemeeting-1.00 requires pwlib to be built w/ IPV6 support
+ ## (even if itself is built without...)
+ #use ipv6 \
+ # && myconf="${myconf} --enable-ipv6" \
+ # || myconf="${myconf} --disable-ipv6"
+ myconf="${myconf} --enable-ipv6"
+
+ # plugins, oss and v4l are default
+ plugins="oss v4l"
+
+ use ieee1394 \
+ && plugins="${plugins} avc dc"
+
+ use alsa \
+ && plugins="${plugins} alsa"
+
+ if use esd; then
+ # fixes bug #45059
+ export ESDDIR=/usr
+ fi
+
+ # merge plugin options (safe way if default = "")
+ plugins="`echo ${plugins} | sed -e "y: :,:"`"
+
+ econf ${myconf} \
+ --enable-plugins \
+ --with-plugins=${plugins} || die "configure failed"
+
+ # Horrible hack to strip out -L/usr/lib to allow upgrades
+ # problem is it adds -L/usr/lib before -L${S} when SSL is
+ # enabled. Same thing for -I/usr/include.
+ sed -i -e "s:^\(LDFLAGS.*\)-L/usr/lib:\1:" \
+ -e "s:^\(STDCCFLAGS.*\)-I/usr/include:\1:" \
+ ${S}/make/ptbuildopts.mak
+ sed -i -e "s:^\(LDFLAGS[\s]*=.*\) -L/usr/lib:\1:" \
+ -e "s:^\(LDFLAGS[\s]*=.*\) -I/usr/include:\1:" \
+ -e "s:^\(CCFLAGS[\s]*=.*\) -I/usr/include:\1:" \
+ ${S}/make/ptlib-config
+
+ # remove -fno-rtti, this breaks various things *grr*
+ sed -i -e "s:-fno-rtti::" \
+ make/ptbuildopts.mak
+ sed -i -e "s:-fno-rtti::" \
+ make/ptlib-config
+
+ emake opt || die "make failed"
+ emake PWLIBDIR=${S} -C plugins opt || die "make plugins failed"
+}
+
+src_install() {
+ # make these because the makefile isn't smart enough
+ dodir /usr/bin /usr/lib /usr/share /usr/include
+ make PREFIX=${D}/usr install || die "install failed"
+
+ # these are for compiling openh323
+ # NOTE: symlinks don't work when upgrading
+ # FIXME: probably should fix this with ptlib-config
+ dodir /usr/share/pwlib/include
+ cp -r ${D}/usr/include/* ${D}/usr/share/pwlib/include
+
+ dodir /usr/share/pwlib/lib
+ for x in ${D}/usr/lib/*; do
+ dosym /usr/lib/`basename ${x}` /usr/share/pwlib/lib/`basename ${x}`
+ done
+
+ # remove CVS dirs
+ find ${D} -name CVS -type d | xargs rm -rf
+
+ # fix symlink
+ # only amd64 needs special handling, afaiks
+ rm ${D}/usr/lib/libpt.so
+ if [ ${ARCH} = "amd64" ] ; then
+ dosym /usr/lib/libpt_linux_x86_64_r.so.${PV} /usr/lib/libpt.so
+ else
+ dosym /usr/lib/libpt_linux_${ARCH}_r.so.${PV} /usr/lib/libpt.so
+ fi
+
+ # strip ${S} stuff
+ dosed "s:^PWLIBDIR.*:PWLIBDIR=/usr/share/pwlib:" /usr/bin/ptlib-config
+ dosed "s:^PWLIBDIR.*:PWLIBDIR=/usr/share/pwlib:" /usr/share/pwlib/make/ptbuildopts.mak
+
+ # dodgy configure/makefiles forget to expand this
+ dosed 's:${exec_prefix}:/usr:' /usr/bin/ptlib-config
+
+ # satisfy ptlib.mak's weird definition (should check if true for future versions)
+ cp ${D}/usr/bin/ptlib-config ${D}/usr/share/pwlib/make/ptlib-config
+
+ # copy version.h
+ insinto /usr/share/pwlib
+ doins version.h
+
+ dodoc ReadMe.txt History.txt
+}