initial import
This commit is contained in:
360
ptlib/MPL-1.0.txt
Normal file
360
ptlib/MPL-1.0.txt
Normal file
@@ -0,0 +1,360 @@
|
||||
MOZILLA PUBLIC LICENSE
|
||||
Version 1.0
|
||||
|
||||
----------------
|
||||
|
||||
1. Definitions.
|
||||
|
||||
1.1. ``Contributor'' means each entity that creates or contributes to
|
||||
the creation of Modifications.
|
||||
|
||||
1.2. ``Contributor Version'' means the combination of the Original
|
||||
Code, prior Modifications used by a Contributor, and the Modifications
|
||||
made by that particular Contributor.
|
||||
|
||||
1.3. ``Covered Code'' means the Original Code or Modifications or the
|
||||
combination of the Original Code and Modifications, in each case
|
||||
including portions thereof.
|
||||
|
||||
1.4. ``Electronic Distribution Mechanism'' means a mechanism generally
|
||||
accepted in the software development community for the electronic
|
||||
transfer of data.
|
||||
|
||||
1.5. ``Executable'' means Covered Code in any form other than Source
|
||||
Code.
|
||||
|
||||
1.6. ``Initial Developer'' means the individual or entity identified as
|
||||
the Initial Developer in the Source Code notice required by Exhibit A.
|
||||
|
||||
1.7. ``Larger Work'' means a work which combines Covered Code or
|
||||
portions thereof with code not governed by the terms of this License.
|
||||
|
||||
1.8. ``License'' means this document.
|
||||
|
||||
1.9. ``Modifications'' means any addition to or deletion from the
|
||||
substance or structure of either the Original Code or any previous
|
||||
Modifications. When Covered Code is released as a series of files, a
|
||||
Modification is:
|
||||
|
||||
A. Any addition to or deletion from the contents of a file
|
||||
containing Original Code or previous Modifications.
|
||||
|
||||
B. Any new file that contains any part of the Original Code or
|
||||
previous Modifications.
|
||||
|
||||
1.10. ``Original Code'' means Source Code of computer software code
|
||||
which is described in the Source Code notice required by Exhibit A as
|
||||
Original Code, and which, at the time of its release under this License
|
||||
is not already Covered Code governed by this License.
|
||||
|
||||
1.11. ``Source Code'' means the preferred form of the Covered Code for
|
||||
making modifications to it, including all modules it contains, plus any
|
||||
associated interface definition files, scripts used to control
|
||||
compilation and installation of an Executable, or a list of source code
|
||||
differential comparisons against either the Original Code or another
|
||||
well known, available Covered Code of the Contributor's choice. The
|
||||
Source Code can be in a compressed or archival form, provided the
|
||||
appropriate decompression or de-archiving software is widely available
|
||||
for no charge.
|
||||
|
||||
1.12. ``You'' means an individual or a legal entity exercising rights
|
||||
under, and complying with all of the terms of, this License or a future
|
||||
version of this License issued under Section 6.1. For legal entities,
|
||||
``You'' includes any entity which controls, is controlled by, or is
|
||||
under common control with You. For purposes of this definition,
|
||||
``control'' means (a) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (b) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares or beneficial ownership of such entity.
|
||||
|
||||
2. Source Code License.
|
||||
|
||||
2.1. The Initial Developer Grant.
|
||||
The Initial Developer hereby grants You a world-wide, royalty-free,
|
||||
non-exclusive license, subject to third party intellectual property
|
||||
claims:
|
||||
|
||||
(a) to use, reproduce, modify, display, perform, sublicense and
|
||||
distribute the Original Code (or portions thereof) with or without
|
||||
Modifications, or as part of a Larger Work; and
|
||||
|
||||
(b) under patents now or hereafter owned or controlled by Initial
|
||||
Developer, to make, have made, use and sell (``Utilize'') the
|
||||
Original Code (or portions thereof), but solely to the extent that
|
||||
any such patent is reasonably necessary to enable You to Utilize
|
||||
the Original Code (or portions thereof) and not to any greater
|
||||
extent that may be necessary to Utilize further Modifications or
|
||||
combinations.
|
||||
|
||||
2.2. Contributor Grant.
|
||||
Each Contributor hereby grants You a world-wide, royalty-free,
|
||||
non-exclusive license, subject to third party intellectual property
|
||||
claims:
|
||||
|
||||
(a) to use, reproduce, modify, display, perform, sublicense and
|
||||
distribute the Modifications created by such Contributor (or
|
||||
portions thereof) either on an unmodified basis, with other
|
||||
Modifications, as Covered Code or as part of a Larger Work; and
|
||||
|
||||
(b) under patents now or hereafter owned or controlled by
|
||||
Contributor, to Utilize the Contributor Version (or portions
|
||||
thereof), but solely to the extent that any such patent is
|
||||
reasonably necessary to enable You to Utilize the Contributor
|
||||
Version (or portions thereof), and not to any greater extent that
|
||||
may be necessary to Utilize further Modifications or combinations.
|
||||
|
||||
3. Distribution Obligations.
|
||||
|
||||
3.1. Application of License.
|
||||
The Modifications which You create or to which You contribute are
|
||||
governed by the terms of this License, including without limitation
|
||||
Section 2.2. The Source Code version of Covered Code may be distributed
|
||||
only under the terms of this License or a future version of this
|
||||
License released under Section 6.1, and You must include a copy of this
|
||||
License with every copy of the Source Code You distribute. You may not
|
||||
offer or impose any terms on any Source Code version that alters or
|
||||
restricts the applicable version of this License or the recipients'
|
||||
rights hereunder. However, You may include an additional document
|
||||
offering the additional rights described in Section 3.5.
|
||||
|
||||
3.2. Availability of Source Code.
|
||||
Any Modification which You create or to which You contribute must be
|
||||
made available in Source Code form under the terms of this License
|
||||
either on the same media as an Executable version or via an accepted
|
||||
Electronic Distribution Mechanism to anyone to whom you made an
|
||||
Executable version available; and if made available via Electronic
|
||||
Distribution Mechanism, must remain available for at least twelve (12)
|
||||
months after the date it initially became available, or at least six
|
||||
(6) months after a subsequent version of that particular Modification
|
||||
has been made available to such recipients. You are responsible for
|
||||
ensuring that the Source Code version remains available even if the
|
||||
Electronic Distribution Mechanism is maintained by a third party.
|
||||
|
||||
3.3. Description of Modifications.
|
||||
You must cause all Covered Code to which you contribute to contain a
|
||||
file documenting the changes You made to create that Covered Code and
|
||||
the date of any change. You must include a prominent statement that the
|
||||
Modification is derived, directly or indirectly, from Original Code
|
||||
provided by the Initial Developer and including the name of the Initial
|
||||
Developer in (a) the Source Code, and (b) in any notice in an
|
||||
Executable version or related documentation in which You describe the
|
||||
origin or ownership of the Covered Code.
|
||||
|
||||
3.4. Intellectual Property Matters
|
||||
|
||||
(a) Third Party Claims.
|
||||
If You have knowledge that a party claims an intellectual property
|
||||
right in particular functionality or code (or its utilization
|
||||
under this License), you must include a text file with the source
|
||||
code distribution titled ``LEGAL'' which describes the claim and
|
||||
the party making the claim in sufficient detail that a recipient
|
||||
will know whom to contact. If you obtain such knowledge after You
|
||||
make Your Modification available as described in Section 3.2, You
|
||||
shall promptly modify the LEGAL file in all copies You make
|
||||
available thereafter and shall take other steps (such as notifying
|
||||
appropriate mailing lists or newsgroups) reasonably calculated to
|
||||
inform those who received the Covered Code that new knowledge has
|
||||
been obtained.
|
||||
|
||||
(b) Contributor APIs.
|
||||
If Your Modification is an application programming interface and
|
||||
You own or control patents which are reasonably necessary to
|
||||
implement that API, you must also include this information in the
|
||||
LEGAL file.
|
||||
|
||||
3.5. Required Notices.
|
||||
You must duplicate the notice in Exhibit A in each file of the Source
|
||||
Code, and this License in any documentation for the Source Code, where
|
||||
You describe recipients' rights relating to Covered Code. If You
|
||||
created one or more Modification(s), You may add your name as a
|
||||
Contributor to the notice described in Exhibit A. If it is not possible
|
||||
to put such notice in a particular Source Code file due to its
|
||||
structure, then you must include such notice in a location (such as a
|
||||
relevant directory file) where a user would be likely to look for such
|
||||
a notice. You may choose to offer, and to charge a fee for, warranty,
|
||||
support, indemnity or liability obligations to one or more recipients
|
||||
of Covered Code. However, You may do so only on Your own behalf, and
|
||||
not on behalf of the Initial Developer or any Contributor. You must
|
||||
make it absolutely clear than any such warranty, support, indemnity or
|
||||
liability obligation is offered by You alone, and You hereby agree to
|
||||
indemnify the Initial Developer and every Contributor for any liability
|
||||
incurred by the Initial Developer or such Contributor as a result of
|
||||
warranty, support, indemnity or liability terms You offer.
|
||||
|
||||
3.6. Distribution of Executable Versions.
|
||||
You may distribute Covered Code in Executable form only if the
|
||||
requirements of Section 3.1-3.5 have been met for that Covered Code,
|
||||
and if You include a notice stating that the Source Code version of the
|
||||
Covered Code is available under the terms of this License, including a
|
||||
description of how and where You have fulfilled the obligations of
|
||||
Section 3.2. The notice must be conspicuously included in any notice in
|
||||
an Executable version, related documentation or collateral in which You
|
||||
describe recipients' rights relating to the Covered Code. You may
|
||||
distribute the Executable version of Covered Code under a license of
|
||||
Your choice, which may contain terms different from this License,
|
||||
provided that You are in compliance with the terms of this License and
|
||||
that the license for the Executable version does not attempt to limit
|
||||
or alter the recipient's rights in the Source Code version from the
|
||||
rights set forth in this License. If You distribute the Executable
|
||||
version under a different license You must make it absolutely clear
|
||||
that any terms which differ from this License are offered by You alone,
|
||||
not by the Initial Developer or any Contributor. You hereby agree to
|
||||
indemnify the Initial Developer and every Contributor for any liability
|
||||
incurred by the Initial Developer or such Contributor as a result of
|
||||
any such terms You offer.
|
||||
|
||||
3.7. Larger Works.
|
||||
You may create a Larger Work by combining Covered Code with other code
|
||||
not governed by the terms of this License and distribute the Larger
|
||||
Work as a single product. In such a case, You must make sure the
|
||||
requirements of this License are fulfilled for the Covered Code.
|
||||
|
||||
4. Inability to Comply Due to Statute or Regulation.
|
||||
|
||||
If it is impossible for You to comply with any of the terms of this
|
||||
License with respect to some or all of the Covered Code due to statute
|
||||
or regulation then You must: (a) comply with the terms of this License
|
||||
to the maximum extent possible; and (b) describe the limitations and
|
||||
the code they affect. Such description must be included in the LEGAL
|
||||
file described in Section 3.4 and must be included with all
|
||||
distributions of the Source Code. Except to the extent prohibited by
|
||||
statute or regulation, such description must be sufficiently detailed
|
||||
for a recipient of ordinary skill to be able to understand it.
|
||||
|
||||
5. Application of this License.
|
||||
|
||||
This License applies to code to which the Initial Developer has
|
||||
attached the notice in Exhibit A, and to related Covered Code.
|
||||
|
||||
6. Versions of the License.
|
||||
|
||||
6.1. New Versions.
|
||||
Netscape Communications Corporation (``Netscape'') may publish revised
|
||||
and/or new versions of the License from time to time. Each version will
|
||||
be given a distinguishing version number.
|
||||
|
||||
6.2. Effect of New Versions.
|
||||
Once Covered Code has been published under a particular version of the
|
||||
License, You may always continue to use it under the terms of that
|
||||
version. You may also choose to use such Covered Code under the terms
|
||||
of any subsequent version of the License published by Netscape. No one
|
||||
other than Netscape has the right to modify the terms applicable to
|
||||
Covered Code created under this License.
|
||||
|
||||
6.3. Derivative Works.
|
||||
If you create or use a modified version of this License (which you may
|
||||
only do in order to apply it to code which is not already Covered Code
|
||||
governed by this License), you must (a) rename Your license so that the
|
||||
phrases ``Mozilla'', ``MOZILLAPL'', ``MOZPL'', ``Netscape'', ``NPL'' or
|
||||
any confusingly similar phrase do not appear anywhere in your license
|
||||
and (b) otherwise make it clear that your version of the license
|
||||
contains terms which differ from the Mozilla Public License and
|
||||
Netscape Public License. (Filling in the name of the Initial Developer,
|
||||
Original Code or Contributor in the notice described in Exhibit A shall
|
||||
not of themselves be deemed to be modifications of this License.)
|
||||
|
||||
7. DISCLAIMER OF WARRANTY.
|
||||
|
||||
COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN ``AS IS'' BASIS,
|
||||
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
|
||||
WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
|
||||
DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
|
||||
THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
|
||||
IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
|
||||
YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
|
||||
COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
|
||||
OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
|
||||
ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
|
||||
|
||||
8. TERMINATION.
|
||||
|
||||
This License and the rights granted hereunder will terminate
|
||||
automatically if You fail to comply with terms herein and fail to cure
|
||||
such breach within 30 days of becoming aware of the breach. All
|
||||
sublicenses to the Covered Code which are properly granted shall
|
||||
survive any termination of this License. Provisions which, by their
|
||||
nature, must remain in effect beyond the termination of this License
|
||||
shall survive.
|
||||
|
||||
9. LIMITATION OF LIABILITY.
|
||||
|
||||
UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
|
||||
(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE INITIAL
|
||||
DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
|
||||
OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO YOU OR ANY OTHER
|
||||
PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
|
||||
OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF
|
||||
GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND
|
||||
ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE
|
||||
BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
|
||||
LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
|
||||
RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
|
||||
PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
|
||||
EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THAT
|
||||
EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
|
||||
|
||||
10. U.S. GOVERNMENT END USERS.
|
||||
|
||||
The Covered Code is a ``commercial item,'' as that term is defined in
|
||||
48 C.F.R. 2.101 (Oct. 1995), consisting of ``commercial computer
|
||||
software'' and ``commercial computer software documentation,'' as such
|
||||
terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
|
||||
C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
|
||||
all U.S. Government End Users acquire Covered Code with only those
|
||||
rights set forth herein.
|
||||
|
||||
11. MISCELLANEOUS.
|
||||
|
||||
This License represents the complete agreement concerning subject
|
||||
matter hereof. If any provision of this License is held to be
|
||||
unenforceable, such provision shall be reformed only to the extent
|
||||
necessary to make it enforceable. This License shall be governed by
|
||||
California law provisions (except to the extent applicable law, if any,
|
||||
provides otherwise), excluding its conflict-of-law provisions. With
|
||||
respect to disputes in which at least one party is a citizen of, or an
|
||||
entity chartered or registered to do business in, the United States of
|
||||
America: (a) unless otherwise agreed in writing, all disputes relating
|
||||
to this License (excepting any dispute relating to intellectual
|
||||
property rights) shall be subject to final and binding arbitration,
|
||||
with the losing party paying all costs of arbitration; (b) any
|
||||
arbitration relating to this Agreement shall be held in Santa Clara
|
||||
County, California, under the auspices of JAMS/EndDispute; and (c) any
|
||||
litigation relating to this Agreement shall be subject to the
|
||||
jurisdiction of the Federal Courts of the Northern District of
|
||||
California, with venue lying in Santa Clara County, California, with
|
||||
the losing party responsible for costs, including without limitation,
|
||||
court costs and reasonable attorneys fees and expenses. The application
|
||||
of the United Nations Convention on Contracts for the International
|
||||
Sale of Goods is expressly excluded. Any law or regulation which
|
||||
provides that the language of a contract shall be construed against the
|
||||
drafter shall not apply to this License.
|
||||
|
||||
12. RESPONSIBILITY FOR CLAIMS.
|
||||
|
||||
Except in cases where another Contributor has failed to comply with
|
||||
Section 3.4, You are responsible for damages arising, directly or
|
||||
indirectly, out of Your utilization of rights under this License, based
|
||||
on the number of copies of Covered Code you made available, the
|
||||
revenues you received from utilizing such rights, and other relevant
|
||||
factors. You agree to work with affected parties to distribute
|
||||
responsibility on an equitable basis.
|
||||
|
||||
EXHIBIT A.
|
||||
|
||||
``The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.0 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS"
|
||||
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
||||
License for the specific language governing rights and limitations
|
||||
under the License.
|
||||
|
||||
The Original Code is ______________________________________.
|
||||
|
||||
The Initial Developer of the Original Code is ________________________.
|
||||
Portions created by ______________________ are Copyright (C) ______
|
||||
_______________________. All Rights Reserved.
|
||||
|
||||
Contributor(s): ______________________________________.''
|
||||
72
ptlib/PKGBUILD
Normal file
72
ptlib/PKGBUILD
Normal file
@@ -0,0 +1,72 @@
|
||||
# Maintainer: Jesus E. <heckyel@riseup.net>
|
||||
|
||||
pkgname=ptlib
|
||||
pkgver=2.10.11
|
||||
_debver=2.10.11~dfsg
|
||||
_debrel=2.1
|
||||
pkgrel=6.hyperbola3
|
||||
pkgdesc="Portable Windows Library, with libsndio recommendation and with libsndio and LibreSSL support"
|
||||
arch=('i686' 'x86_64')
|
||||
url="http://www.opalvoip.org"
|
||||
license=('MPL-1.0')
|
||||
depends=('sdl' 'libsndio' 'v4l-utils' 'libldap')
|
||||
makedepends=('quilt')
|
||||
optdepends=('sndio: audio and MIDI server')
|
||||
replaces=('pwlib')
|
||||
conflicts=('pwlib')
|
||||
source=(https://downloads.sourceforge.net/opalvoip/ptlib-$pkgver.tar.bz2
|
||||
https://deb.debian.org/debian/pool/main/p/ptlib/ptlib_$_debver-$_debrel.debian.tar.xz
|
||||
ptlib-2.10.11-bison_fixes-2.patch
|
||||
patch-src_ptclib_pssl_cxx.patch
|
||||
sndio.patch
|
||||
MPL-1.0.txt)
|
||||
sha512sums=('ac8af8962330abf11986ccb863be0990c2e78ae611666d17c68068b72c4a5ea523ba74c55566284c3549e2346e407ccfffb5cc509fbf6ef19f1eb51dcb8b5f15'
|
||||
'b0eec5a458e4b4e464e7864c3c22a54c92b5640855c8881bf7a7a031780df15a8f7cdd3c4f3a0799ed7daaa12abbc6c3c384486537cd46e8c24dde629f53dd5e'
|
||||
'd02ee95f98082ab6a6f317d4e78b5a2dd7de2d5491aa55dad1ccbb0d93542744b48ccfdf7b4702dc8fd76848da2f43f189f530fc511eec20198b83bd413dd0d0'
|
||||
'b2db3cac3678cd030cc345693f9b93e23b6c4ad7399dbb188dd721859c287b8e2e3af04ddcd3628352c90d676eaa0b2c310f8f8569e1b74df4ea36af4b70596b'
|
||||
'e5a9e62ddb6e81f0b6ff34e32df90dc0ac182378190fa615cf515836773b6f63d9c33d020cf7700a28238090aea45a266ffddf881f425746ffe872575cf6ef7c'
|
||||
'ff62561d65d0b269b9a289f964a73099cc4456cb25927fc19734b0896735054a5023b6b44d4ddda17ece0a1f42050581f66ba0b9afaffa52538ec143bc908cf7')
|
||||
|
||||
prepare() {
|
||||
cd $pkgname-$pkgver
|
||||
if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
|
||||
# Debian patches
|
||||
export QUILT_PATCHES=debian/patches
|
||||
export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
|
||||
export QUILT_DIFF_ARGS='--no-timestamps'
|
||||
|
||||
mv "$srcdir"/debian .
|
||||
|
||||
# Doesn't apply and seems unimportant
|
||||
rm -v debian/patches/bison-fix || true
|
||||
rm -v debian/patches/gcc-5_support || true
|
||||
rm -v debian/patches/hurd-fix || true
|
||||
rm -v debian/patches/no-sslv3 || true
|
||||
rm -v debian/patches/ppc64el-arm64-mips64.diff || true
|
||||
|
||||
quilt push -av
|
||||
fi
|
||||
patch -Np1 -i ../ptlib-2.10.11-bison_fixes-2.patch
|
||||
patch -Np0 -i ../patch-src_ptclib_pssl_cxx.patch
|
||||
patch -Np1 -i ../sndio.patch
|
||||
}
|
||||
|
||||
build() {
|
||||
cd $pkgname-$pkgver
|
||||
./configure --prefix=/usr --libdir=/usr/lib \
|
||||
--sysconfdir=/etc --localstatedir=/var \
|
||||
--enable-opal --enable-plugins \
|
||||
--enable-oss --enable-v4l2 \
|
||||
--disable-avc --enable-sdl \
|
||||
--enable-ipv6 --enable-v4l \
|
||||
--disable-dc --disable-odbc \
|
||||
--enable-expat --enable-httpforms \
|
||||
--disable-pulse --enable-sndio
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd $pkgname-$pkgver
|
||||
make DESTDIR="${pkgdir}" install
|
||||
install -Dm644 $srcdir/MPL-1.0.txt $pkgdir/usr/share/licenses/$pkgname/MPL-1.0.txt
|
||||
}
|
||||
26
ptlib/patch-src_ptclib_pssl_cxx.patch
Normal file
26
ptlib/patch-src_ptclib_pssl_cxx.patch
Normal file
@@ -0,0 +1,26 @@
|
||||
$OpenBSD: patch-src_ptclib_pssl_cxx,v 1.4 2018/05/30 00:23:12 tb Exp $
|
||||
Index: src/ptclib/pssl.cxx
|
||||
--- src/ptclib/pssl.cxx.orig
|
||||
+++ src/ptclib/pssl.cxx
|
||||
@@ -145,7 +145,7 @@ PFACTORY_CREATE_SINGLETON(PProcessStartupFactory, PSSL
|
||||
class PSSL_BIO
|
||||
{
|
||||
public:
|
||||
- PSSL_BIO(BIO_METHOD *method = BIO_s_file_internal())
|
||||
+ PSSL_BIO(const BIO_METHOD *method = BIO_s_file_internal())
|
||||
{ bio = BIO_new(method); }
|
||||
|
||||
~PSSL_BIO()
|
||||
@@ -1189,9 +1189,12 @@ void PSSLContext::Construct(Method method, const void
|
||||
SSL_METHOD * meth;
|
||||
|
||||
switch (method) {
|
||||
+#ifndef OPENSSL_NO_SSL3
|
||||
+/* fall through to SSLv23_method if unsupported */
|
||||
case SSLv3:
|
||||
meth = SSLv3_method();
|
||||
break;
|
||||
+#endif
|
||||
case TLSv1:
|
||||
meth = TLSv1_method();
|
||||
break;
|
||||
2951
ptlib/ptlib-2.10.11-bison_fixes-2.patch
Normal file
2951
ptlib/ptlib-2.10.11-bison_fixes-2.patch
Normal file
File diff suppressed because it is too large
Load Diff
926
ptlib/sndio.patch
Normal file
926
ptlib/sndio.patch
Normal file
@@ -0,0 +1,926 @@
|
||||
diff --git a/configure b/configure
|
||||
index 4c68d59..a872544 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -852,6 +852,7 @@ enable_dc
|
||||
enable_vfw
|
||||
enable_alsa
|
||||
enable_oss
|
||||
+enable_sndio
|
||||
enable_pulse
|
||||
enable_memcheck
|
||||
enable_odbc
|
||||
@@ -1548,6 +1549,7 @@ Optional Features:
|
||||
--enable-vfw enable video for windows capture
|
||||
--enable-alsa enable ALSA audio support
|
||||
--enable-oss enable OSS audio support
|
||||
+ --enable-sndio enable SNDIO audio support
|
||||
--enable-pulse enable PULSE audio support
|
||||
--enable-memcheck enable leak testing code (off by default)
|
||||
--disable-odbc disable ODBC support
|
||||
@@ -10253,6 +10255,11 @@ if test "${enable_oss+set}" = set; then :
|
||||
enableval=$enable_oss; enable_oss=$enableval
|
||||
fi
|
||||
|
||||
+ # Check whether --enable-sndio was given.
|
||||
+if test "${enable_sndio+set}" = set; then :
|
||||
+ enableval=$enable_sndio; enable_sndio=$enableval
|
||||
+fi
|
||||
+
|
||||
# Check whether --enable-pulse was given.
|
||||
if test "${enable_pulse+set}" = set; then :
|
||||
enableval=$enable_pulse; enable_pulse=$enableval
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 74d5921..222021e 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -1623,6 +1623,7 @@ if test "x${HAS_AUDIO}" = "x1" ; then
|
||||
dnl these are needed to pass through to the plugin configure program
|
||||
AC_ARG_ENABLE(alsa, [ --enable-alsa enable ALSA audio support],enable_alsa=$enableval)
|
||||
AC_ARG_ENABLE(oss, [ --enable-oss enable OSS audio support],enable_oss=$enableval)
|
||||
+ AC_ARG_ENABLE(sndio, [ --enable-sndio enable SNDIO audio support],enable_sndio=$enableval)
|
||||
AC_ARG_ENABLE(pulse, [ --enable-pulse enable PULSE audio support],enable_pulse=$enableval)
|
||||
fi
|
||||
|
||||
diff --git a/plugins/Makefile.in b/plugins/Makefile.in
|
||||
index d613f36..c679671 100644
|
||||
--- a/plugins/Makefile.in
|
||||
+++ b/plugins/Makefile.in
|
||||
@@ -51,6 +51,16 @@ DEFAULT_SOUND = sound_esd
|
||||
endif
|
||||
endif
|
||||
|
||||
+###################################SNDIO
|
||||
+HAS_SNDIO = @HAS_SNDIO@
|
||||
+
|
||||
+ifeq (1,$(HAS_SNDIO))
|
||||
+SUBDIRS += sound_sndio
|
||||
+ifeq (,$(DEFAULT_SOUND))
|
||||
+DEFAULT_SOUND = sound_sndio
|
||||
+endif
|
||||
+endif
|
||||
+
|
||||
#################################SundAudio
|
||||
HAS_SUNAUDIO = @HAS_SUNAUDIO@
|
||||
|
||||
diff --git a/plugins/configure b/plugins/configure
|
||||
index da4858b..c47a09d 100644
|
||||
--- a/plugins/configure
|
||||
+++ b/plugins/configure
|
||||
@@ -648,6 +648,7 @@ HAS_V4L
|
||||
HAS_AUDIOSHM
|
||||
HAS_SUNAUDIO
|
||||
HAS_PULSE
|
||||
+HAS_SNDIO
|
||||
HAS_OSS
|
||||
HAS_ESD
|
||||
HAS_ALSA
|
||||
@@ -723,6 +724,7 @@ enable_audio
|
||||
enable_alsa
|
||||
enable_esd
|
||||
enable_oss
|
||||
+enable_sndio
|
||||
enable_pulse
|
||||
enable_sunaudio
|
||||
enable_shmaudio
|
||||
@@ -1374,6 +1376,7 @@ disable plugin support]
|
||||
--enable-alsa enable ALSA audio support
|
||||
--enable-esd enable ESD audio support
|
||||
--enable-oss enable OSS audio support
|
||||
+ --enable-sndio enable sndio audio support
|
||||
--enable-pulse enable Pulse audio support
|
||||
--enable-sunaudio enable Sun audio support
|
||||
--enable-shmaudio enable shm audio support
|
||||
@@ -4425,6 +4428,161 @@ $as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
+# Check whether --enable-sndio was given.
|
||||
+if test "${enable_sndio+set}" = set; then
|
||||
+ enableval=$enable_sndio;
|
||||
+else
|
||||
+ enable_sndio=yes
|
||||
+fi
|
||||
+
|
||||
+
|
||||
+if test "${enable_sndio}z" = "yesz" ; then
|
||||
+ if test "${ac_cv_header_sndio_h+set}" = set; then
|
||||
+ { $as_echo "$as_me:$LINENO: checking for sndio.h" >&5
|
||||
+$as_echo_n "checking for sndio.h... " >&6; }
|
||||
+if test "${ac_cv_header_sndio_h+set}" = set; then
|
||||
+ $as_echo_n "(cached) " >&6
|
||||
+fi
|
||||
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sndio_h" >&5
|
||||
+$as_echo "$ac_cv_header_sndio_h" >&6; }
|
||||
+else
|
||||
+ # Is the header compilable?
|
||||
+{ $as_echo "$as_me:$LINENO: checking sndio.h usability" >&5
|
||||
+$as_echo_n "checking sndio.h usability... " >&6; }
|
||||
+cat >conftest.$ac_ext <<_ACEOF
|
||||
+/* confdefs.h. */
|
||||
+_ACEOF
|
||||
+cat confdefs.h >>conftest.$ac_ext
|
||||
+cat >>conftest.$ac_ext <<_ACEOF
|
||||
+/* end confdefs.h. */
|
||||
+$ac_includes_default
|
||||
+#include <sndio.h>
|
||||
+_ACEOF
|
||||
+rm -f conftest.$ac_objext
|
||||
+if { (ac_try="$ac_compile"
|
||||
+case "(($ac_try" in
|
||||
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
+ *) ac_try_echo=$ac_try;;
|
||||
+esac
|
||||
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
|
||||
+$as_echo "$ac_try_echo") >&5
|
||||
+ (eval "$ac_compile") 2>conftest.er1
|
||||
+ ac_status=$?
|
||||
+ grep -v '^ *+' conftest.er1 >conftest.err
|
||||
+ rm -f conftest.er1
|
||||
+ cat conftest.err >&5
|
||||
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
+ (exit $ac_status); } && {
|
||||
+ test -z "$ac_c_werror_flag" ||
|
||||
+ test ! -s conftest.err
|
||||
+ } && test -s conftest.$ac_objext; then
|
||||
+ ac_header_compiler=yes
|
||||
+else
|
||||
+ $as_echo "$as_me: failed program was:" >&5
|
||||
+sed 's/^/| /' conftest.$ac_ext >&5
|
||||
+
|
||||
+ ac_header_compiler=no
|
||||
+fi
|
||||
+
|
||||
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
|
||||
+$as_echo "$ac_header_compiler" >&6; }
|
||||
+
|
||||
+# Is the header present?
|
||||
+{ $as_echo "$as_me:$LINENO: checking sndio.h presence" >&5
|
||||
+$as_echo_n "checking sndio.h presence... " >&6; }
|
||||
+cat >conftest.$ac_ext <<_ACEOF
|
||||
+/* confdefs.h. */
|
||||
+_ACEOF
|
||||
+cat confdefs.h >>conftest.$ac_ext
|
||||
+cat >>conftest.$ac_ext <<_ACEOF
|
||||
+/* end confdefs.h. */
|
||||
+#include <sndio.h>
|
||||
+_ACEOF
|
||||
+if { (ac_try="$ac_cpp conftest.$ac_ext"
|
||||
+case "(($ac_try" in
|
||||
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
+ *) ac_try_echo=$ac_try;;
|
||||
+esac
|
||||
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
|
||||
+$as_echo "$ac_try_echo") >&5
|
||||
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
|
||||
+ ac_status=$?
|
||||
+ grep -v '^ *+' conftest.er1 >conftest.err
|
||||
+ rm -f conftest.er1
|
||||
+ cat conftest.err >&5
|
||||
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
+ (exit $ac_status); } >/dev/null && {
|
||||
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
|
||||
+ test ! -s conftest.err
|
||||
+ }; then
|
||||
+ ac_header_preproc=yes
|
||||
+else
|
||||
+ $as_echo "$as_me: failed program was:" >&5
|
||||
+sed 's/^/| /' conftest.$ac_ext >&5
|
||||
+
|
||||
+ ac_header_preproc=no
|
||||
+fi
|
||||
+
|
||||
+rm -f conftest.err conftest.$ac_ext
|
||||
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
|
||||
+$as_echo "$ac_header_preproc" >&6; }
|
||||
+
|
||||
+# So? What about this header?
|
||||
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
|
||||
+ yes:no: )
|
||||
+ { $as_echo "$as_me:$LINENO: WARNING: sndio.h: accepted by the compiler, rejected by the preprocessor!" >&5
|
||||
+$as_echo "$as_me: WARNING: sndio.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
|
||||
+ { $as_echo "$as_me:$LINENO: WARNING: sndio.h: proceeding with the compiler's result" >&5
|
||||
+$as_echo "$as_me: WARNING: sndio.h: proceeding with the compiler's result" >&2;}
|
||||
+ ac_header_preproc=yes
|
||||
+ ;;
|
||||
+ no:yes:* )
|
||||
+ { $as_echo "$as_me:$LINENO: WARNING: sndio.h: present but cannot be compiled" >&5
|
||||
+$as_echo "$as_me: WARNING: sndio.h: present but cannot be compiled" >&2;}
|
||||
+ { $as_echo "$as_me:$LINENO: WARNING: sndio.h: check for missing prerequisite headers?" >&5
|
||||
+$as_echo "$as_me: WARNING: sndio.h: check for missing prerequisite headers?" >&2;}
|
||||
+ { $as_echo "$as_me:$LINENO: WARNING: sndio.h: see the Autoconf documentation" >&5
|
||||
+$as_echo "$as_me: WARNING: sndio.h: see the Autoconf documentation" >&2;}
|
||||
+ { $as_echo "$as_me:$LINENO: WARNING: sndio.h: section \"Present But Cannot Be Compiled\"" >&5
|
||||
+$as_echo "$as_me: WARNING: sndio.h: section \"Present But Cannot Be Compiled\"" >&2;}
|
||||
+ { $as_echo "$as_me:$LINENO: WARNING: sndio.h: proceeding with the preprocessor's result" >&5
|
||||
+$as_echo "$as_me: WARNING: sndio.h: proceeding with the preprocessor's result" >&2;}
|
||||
+ { $as_echo "$as_me:$LINENO: WARNING: sndio.h: in the future, the compiler will take precedence" >&5
|
||||
+$as_echo "$as_me: WARNING: sndio.h: in the future, the compiler will take precedence" >&2;}
|
||||
+
|
||||
+ ;;
|
||||
+esac
|
||||
+{ $as_echo "$as_me:$LINENO: checking for sndio.h" >&5
|
||||
+$as_echo_n "checking for sndio.h... " >&6; }
|
||||
+if test "${ac_cv_header_sndio_h+set}" = set; then
|
||||
+ $as_echo_n "(cached) " >&6
|
||||
+else
|
||||
+ ac_cv_header_sndio_h=$ac_header_preproc
|
||||
+fi
|
||||
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sndio_h" >&5
|
||||
+$as_echo "$ac_cv_header_sndio_h" >&6; }
|
||||
+
|
||||
+fi
|
||||
+if test "x$ac_cv_header_sndio_h" = x""yes; then
|
||||
+ SNDCARDHDR=1
|
||||
+fi
|
||||
+
|
||||
+
|
||||
+ { $as_echo "$as_me:$LINENO: checking for sndio sound support" >&5
|
||||
+$as_echo_n "checking for sndio sound support... " >&6; }
|
||||
+ if test "${SNDCARDHDR}z" != "z"; then
|
||||
+ HAS_SNDIO=1
|
||||
+
|
||||
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
|
||||
+$as_echo "yes" >&6; }
|
||||
+ else
|
||||
+ { $as_echo "$as_me:$LINENO: result: no" >&5
|
||||
+$as_echo "no" >&6; }
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
+
|
||||
# Check whether --enable-pulse was given.
|
||||
if test "${enable_pulse+set}" = set; then
|
||||
enableval=$enable_pulse;
|
||||
diff --git a/plugins/configure.in b/plugins/configure.in
|
||||
index 47a16bf..681043c 100644
|
||||
--- a/plugins/configure.in
|
||||
+++ b/plugins/configure.in
|
||||
@@ -107,6 +107,23 @@ if test "${enable_pulse}z" = "yesz" ; then
|
||||
fi
|
||||
|
||||
dnl #########################################################################
|
||||
+dnl check for sndio sound support
|
||||
+dnl ########################################################################
|
||||
+
|
||||
+AC_ARG_ENABLE(sndio, [ --enable-sndio enable sndio audio support],,enable_sndio=no)
|
||||
+
|
||||
+if test "${enable_sndio}z" = "yesz" ; then
|
||||
+ AC_CHECK_HEADER(sndio.h, SNDCARDHDR=1)
|
||||
+ AC_MSG_CHECKING(for sndio sound support)
|
||||
+ if test "${SNDCARDHDR}z" != "z"; then
|
||||
+ AC_SUBST(HAS_SNDIO, 1)
|
||||
+ AC_MSG_RESULT(yes)
|
||||
+ else
|
||||
+ AC_MSG_RESULT(no)
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
+dnl #########################################################################
|
||||
dnl check for sunaudio sound support
|
||||
dnl ########################################################################
|
||||
|
||||
diff --git b/plugins/sound_sndio/Makefile b/plugins/sound_sndio/Makefile
|
||||
new file mode 100644
|
||||
index 0000000..fd15500
|
||||
--- /dev/null
|
||||
+++ b/plugins/sound_sndio/Makefile
|
||||
@@ -0,0 +1,7 @@
|
||||
+
|
||||
+PLUGIN_NAME = sndio
|
||||
+PLUGIN_FAMILY = device/sound
|
||||
+PLUGIN_LIBS = -lsndio
|
||||
+PLUGIN_SOURCES = sound_sndio.cxx
|
||||
+
|
||||
+include ../../make/plugins.mak
|
||||
diff --git b/plugins/sound_sndio/sound_sndio.cxx b/plugins/sound_sndio/sound_sndio.cxx
|
||||
new file mode 100644
|
||||
index 0000000..a581033
|
||||
--- /dev/null
|
||||
+++ b/plugins/sound_sndio/sound_sndio.cxx
|
||||
@@ -0,0 +1,534 @@
|
||||
+/*
|
||||
+ * sound_sndio.cxx
|
||||
+ *
|
||||
+ * Sound driver implementation.
|
||||
+ *
|
||||
+ * Portable Windows Library
|
||||
+ *
|
||||
+ * Copyright (c) 1993-1998 Equivalence Pty. Ltd.
|
||||
+ *
|
||||
+ * The contents of this file are subject to the Mozilla Public License
|
||||
+ * Version 1.0 (the "License"); you may not use this file except in
|
||||
+ * compliance with the License. You may obtain a copy of the License at
|
||||
+ * http://www.mozilla.org/MPL/
|
||||
+ *
|
||||
+ * Software distributed under the License is distributed on an "AS IS"
|
||||
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
+ * the License for the specific language governing rights and limitations
|
||||
+ * under the License.
|
||||
+ *
|
||||
+ * The Original Code is Portable Windows Library.
|
||||
+ *
|
||||
+ * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
|
||||
+ *
|
||||
+ * Portions are Copyright (C) 1993 Free Software Foundation, Inc.
|
||||
+ * All Rights Reserved.
|
||||
+ *
|
||||
+ * $Log: sound_sndio.cxx,v $
|
||||
+ * Revision 1.2 2010/05/11 07:23:23 espie
|
||||
+ * make it compile on gcc4, by making the relevant patch dependent on
|
||||
+ * compiler version.
|
||||
+ * also removes lvalue cast, that's not ansi.
|
||||
+ *
|
||||
+ * Revision 1.1.1.1 2010/03/23 21:10:17 ajacoutot
|
||||
+ * Import ptlib-2.6.5
|
||||
+ *
|
||||
+ * PTLib is a moderately large C++ class library that originated many years
|
||||
+ * ago as a method to produce applications that run on both Microsoft
|
||||
+ * Windows and Unix X-Windows systems. It also was to have a Macintosh port
|
||||
+ * as well, but this never eventuated. In those days it was called the
|
||||
+ * PWLib the Portable Windows Library.
|
||||
+ *
|
||||
+ * Since then, the availability of multi-platform GUI toolkits such as KDE
|
||||
+ * and wxWindows, and the development of the OpenH323 and OPAL projects as
|
||||
+ * primary user of the library, has emphasised the focus on networking, I/O
|
||||
+ * portability, multi-threading and protocol portability. Mostly, the
|
||||
+ * library is used to create high performance and highly portable
|
||||
+ * network-centric applications. So all the GUI abstractions ahave been
|
||||
+ * dropped and it was renamed the Portable Tools Library that you see
|
||||
+ * today.
|
||||
+ *
|
||||
+ * Revision 1.3 2009/06/01 22:19:23 ajacoutot
|
||||
+ * - aucat.sock is no more
|
||||
+ *
|
||||
+ * spotted by robert@ on ekiga
|
||||
+ *
|
||||
+ * Revision 1.2 2009/01/19 09:42:21 ajacoutot
|
||||
+ * - s/SNDIO/SNDIO for consistency
|
||||
+ * discussed with naddy@
|
||||
+ *
|
||||
+ * "sure" jakemsr@
|
||||
+ *
|
||||
+ * Revision 1.1 2009/01/17 12:30:08 jakemsr
|
||||
+ * - add sndio backend
|
||||
+ * - remove OSS and esd support
|
||||
+ * ok ajacoutot@ (MAINTAINER)
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#pragma implementation "sound_sndio.h"
|
||||
+
|
||||
+#include "sound_sndio.h"
|
||||
+
|
||||
+#include <sys/poll.h>
|
||||
+
|
||||
+PCREATE_SOUND_PLUGIN(SNDIO, PSoundChannelSNDIO);
|
||||
+
|
||||
+PSoundChannelSNDIO::PSoundChannelSNDIO()
|
||||
+{
|
||||
+ PSoundChannelSNDIO::Construct();
|
||||
+}
|
||||
+
|
||||
+
|
||||
+PSoundChannelSNDIO::PSoundChannelSNDIO(const PString & device,
|
||||
+ Directions dir,
|
||||
+ unsigned numChannels,
|
||||
+ unsigned sampleRate,
|
||||
+ unsigned bitsPerSample)
|
||||
+{
|
||||
+ Construct();
|
||||
+ Open(device, dir, numChannels, sampleRate, bitsPerSample);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+void PSoundChannelSNDIO::Construct()
|
||||
+{
|
||||
+ os_handle = -1;
|
||||
+ hdl = NULL;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+PSoundChannelSNDIO::~PSoundChannelSNDIO()
|
||||
+{
|
||||
+ Close();
|
||||
+}
|
||||
+
|
||||
+
|
||||
+PStringArray PSoundChannelSNDIO::GetDeviceNames(Directions)
|
||||
+{
|
||||
+ static const char * const devices[] = {
|
||||
+ "default",
|
||||
+ "/dev/audio0",
|
||||
+ "/dev/audio1",
|
||||
+ "/dev/audio2"
|
||||
+ };
|
||||
+
|
||||
+ return PStringArray(PARRAYSIZE(devices), devices);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+PString PSoundChannelSNDIO::GetDefaultDevice(Directions dir)
|
||||
+{
|
||||
+ return "default";
|
||||
+}
|
||||
+
|
||||
+PBoolean PSoundChannelSNDIO::Open(const PString & device,
|
||||
+ Directions dir,
|
||||
+ unsigned numChannels,
|
||||
+ unsigned sampleRate,
|
||||
+ unsigned bitsPerSample)
|
||||
+{
|
||||
+ uint mode;
|
||||
+ char sio_device[32];
|
||||
+
|
||||
+ Close();
|
||||
+
|
||||
+ if (dir == Recorder)
|
||||
+ mode = SIO_REC;
|
||||
+ else
|
||||
+ mode = SIO_PLAY;
|
||||
+
|
||||
+ snprintf(sio_device, 32, "%s", (const char *)device);
|
||||
+
|
||||
+ if (strncmp(sio_device, "default", 7) == 0)
|
||||
+ hdl = sio_open(NULL, mode, 0);
|
||||
+ else
|
||||
+ hdl = sio_open(sio_device, mode, 0);
|
||||
+
|
||||
+ if (hdl == NULL) {
|
||||
+ printf("sio_open failed\n");
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ mDirection = dir;
|
||||
+ mDevice = device;
|
||||
+ mSampleRate = sampleRate;
|
||||
+ mNumChannels = numChannels;
|
||||
+ mBitsPerSample = bitsPerSample;
|
||||
+ mBytesPerFrame = (bitsPerSample / 8) * numChannels;
|
||||
+
|
||||
+ isInitialised = FALSE;
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+PBoolean PSoundChannelSNDIO::Setup()
|
||||
+{
|
||||
+ if (!hdl) {
|
||||
+ PTRACE(6, "SNDIO\tSkipping setup of " << mDevice << " as not open");
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ if (isInitialised) {
|
||||
+ PTRACE(6, "SNDIO\tSkipping setup of " << mDevice << " as instance already initialised");
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+
|
||||
+ PTRACE(6, "SNDIO\tInitialising " << mDevice);
|
||||
+
|
||||
+ sio_initpar(&par);
|
||||
+
|
||||
+ int framesPerFrag = mFragSize / mBytesPerFrame;
|
||||
+ par.bufsz = mFragCount * framesPerFrag;
|
||||
+ par.round = framesPerFrag;
|
||||
+
|
||||
+ par.bits = mBitsPerSample;
|
||||
+ par.sig = 1;
|
||||
+#if PBYTE_ORDER == PLITTLE_ENDIAN
|
||||
+ par.le = 1;
|
||||
+#else
|
||||
+ par.le = 0;
|
||||
+#endif
|
||||
+
|
||||
+ if (mDirection == Recorder)
|
||||
+ par.rchan = mNumChannels;
|
||||
+ else
|
||||
+ par.pchan = mNumChannels;
|
||||
+
|
||||
+ par.rate = mSampleRate;
|
||||
+
|
||||
+ if (!sio_setpar(hdl, &par)) {
|
||||
+ printf("sio_setpar failed\n");
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ if (!sio_getpar(hdl, &par)) {
|
||||
+ printf("sio_getpar failed\n");
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ mFragSize = par.round * mBytesPerFrame;
|
||||
+ mFragCount = par.bufsz / par.round;
|
||||
+
|
||||
+ if (!sio_start(hdl)) {
|
||||
+ printf("sio_start failed\n");
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ isInitialised = TRUE;
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+PBoolean PSoundChannelSNDIO::Close()
|
||||
+{
|
||||
+ if (!hdl)
|
||||
+ return TRUE;
|
||||
+
|
||||
+ sio_close(hdl);
|
||||
+ hdl = NULL;
|
||||
+ return PChannel::Close();
|
||||
+}
|
||||
+
|
||||
+PBoolean PSoundChannelSNDIO::IsOpen() const
|
||||
+{
|
||||
+ return (hdl != NULL);
|
||||
+}
|
||||
+
|
||||
+PBoolean PSoundChannelSNDIO::Write(const void * buf, PINDEX len)
|
||||
+{
|
||||
+ lastWriteCount = 0;
|
||||
+
|
||||
+ if (!Setup() || !hdl)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ int did, tot = 0;
|
||||
+
|
||||
+ while (len > 0) {
|
||||
+ did = sio_write(hdl, (void *)buf, len);
|
||||
+ if (did == 0) {
|
||||
+ printf("sio_write failed\n");
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ len -= did;
|
||||
+ buf = (char*)buf + did;
|
||||
+ tot += did;
|
||||
+ }
|
||||
+ lastWriteCount += tot;
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+PBoolean PSoundChannelSNDIO::Read(void * buf, PINDEX len)
|
||||
+{
|
||||
+ lastReadCount = 0;
|
||||
+
|
||||
+ if (!Setup() || !hdl)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ int did, tot = 0;
|
||||
+
|
||||
+ while (len > 0) {
|
||||
+ did = sio_read(hdl, buf, len);
|
||||
+ if (did == 0) {
|
||||
+ printf("sio_read failed\n");
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ len -= did;
|
||||
+ buf = (char*)buf + did;
|
||||
+ tot += did;
|
||||
+ }
|
||||
+ lastReadCount += tot;
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+PBoolean PSoundChannelSNDIO::SetFormat(unsigned numChannels,
|
||||
+ unsigned sampleRate,
|
||||
+ unsigned bitsPerSample)
|
||||
+{
|
||||
+ if (!hdl)
|
||||
+ return SetErrorValues(NotOpen, EBADF);
|
||||
+
|
||||
+ PAssert((bitsPerSample == 8) || (bitsPerSample == 16), PInvalidParameter);
|
||||
+ PAssert(numChannels >= 1 && numChannels <= 2, PInvalidParameter);
|
||||
+
|
||||
+ if (isInitialised) {
|
||||
+ if ((numChannels != mNumChannels) ||
|
||||
+ (sampleRate != mSampleRate) ||
|
||||
+ (bitsPerSample != mBitsPerSample)) {
|
||||
+ PTRACE(6, "SNDIO\tTried to change read/write format without stopping");
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+
|
||||
+ mNumChannels = numChannels;
|
||||
+ mSampleRate = sampleRate;
|
||||
+ mBitsPerSample = bitsPerSample;
|
||||
+ isInitialised = FALSE;
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+unsigned PSoundChannelSNDIO::GetChannels() const
|
||||
+{
|
||||
+ return mNumChannels;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+unsigned PSoundChannelSNDIO::GetSampleRate() const
|
||||
+{
|
||||
+ return mSampleRate;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+unsigned PSoundChannelSNDIO::GetSampleSize() const
|
||||
+{
|
||||
+ return mBitsPerSample;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+PBoolean PSoundChannelSNDIO::SetBuffers(PINDEX size, PINDEX count)
|
||||
+{
|
||||
+ if (!hdl)
|
||||
+ return SetErrorValues(NotOpen, EBADF);
|
||||
+
|
||||
+ PAssert(size > 0 && count > 0 && count < 65536, PInvalidParameter);
|
||||
+
|
||||
+ if (isInitialised) {
|
||||
+ if (mFragSize != (unsigned)size || mFragCount != (unsigned)count) {
|
||||
+ PTRACE(6, "SNDIO\tTried to change buffers without stopping");
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+
|
||||
+ mFragSize = size;
|
||||
+ mFragCount = count;
|
||||
+ isInitialised = FALSE;
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+PBoolean PSoundChannelSNDIO::GetBuffers(PINDEX & size, PINDEX & count)
|
||||
+{
|
||||
+ if (!hdl)
|
||||
+ return SetErrorValues(NotOpen, EBADF);
|
||||
+
|
||||
+ count = mFragCount;
|
||||
+ size = mFragSize;
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+PBoolean PSoundChannelSNDIO::PlaySound(const PSound & sound, PBoolean wait)
|
||||
+{
|
||||
+ if (!hdl)
|
||||
+ return SetErrorValues(NotOpen, EBADF);
|
||||
+
|
||||
+ if (!Write((const BYTE *)sound, sound.GetSize()))
|
||||
+ return FALSE;
|
||||
+
|
||||
+ if (wait)
|
||||
+ return WaitForPlayCompletion();
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+PBoolean PSoundChannelSNDIO::PlayFile(const PFilePath & filename, PBoolean wait)
|
||||
+{
|
||||
+ if (!hdl)
|
||||
+ return SetErrorValues(NotOpen, EBADF);
|
||||
+
|
||||
+ PFile file(filename, PFile::ReadOnly);
|
||||
+ if (!file.IsOpen())
|
||||
+ return FALSE;
|
||||
+
|
||||
+ for (;;) {
|
||||
+ BYTE buffer[256];
|
||||
+ if (!file.Read(buffer, 256))
|
||||
+ break;
|
||||
+ PINDEX len = file.GetLastReadCount();
|
||||
+ if (len == 0)
|
||||
+ break;
|
||||
+ if (!Write(buffer, len))
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ file.Close();
|
||||
+
|
||||
+ if (wait)
|
||||
+ return WaitForPlayCompletion();
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+PBoolean PSoundChannelSNDIO::HasPlayCompleted()
|
||||
+{
|
||||
+ if (!hdl)
|
||||
+ return SetErrorValues(NotOpen, EBADF);
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+PBoolean PSoundChannelSNDIO::WaitForPlayCompletion()
|
||||
+{
|
||||
+ if (!hdl)
|
||||
+ return SetErrorValues(NotOpen, EBADF);
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+PBoolean PSoundChannelSNDIO::RecordSound(PSound & sound)
|
||||
+{
|
||||
+ if (!hdl)
|
||||
+ return SetErrorValues(NotOpen, EBADF);
|
||||
+
|
||||
+ return FALSE;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+PBoolean PSoundChannelSNDIO::RecordFile(const PFilePath & filename)
|
||||
+{
|
||||
+ if (!hdl)
|
||||
+ return SetErrorValues(NotOpen, EBADF);
|
||||
+
|
||||
+ return FALSE;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+PBoolean PSoundChannelSNDIO::StartRecording()
|
||||
+{
|
||||
+ if (!hdl)
|
||||
+ return SetErrorValues(NotOpen, EBADF);
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+PBoolean PSoundChannelSNDIO::IsRecordBufferFull()
|
||||
+{
|
||||
+ if (!hdl)
|
||||
+ return SetErrorValues(NotOpen, EBADF);
|
||||
+
|
||||
+ struct pollfd pfd;
|
||||
+ int events = POLLIN;
|
||||
+ sio_pollfd(hdl, &pfd, events);
|
||||
+ return ConvertOSError(::poll(&pfd, 1, 0));
|
||||
+}
|
||||
+
|
||||
+
|
||||
+PBoolean PSoundChannelSNDIO::AreAllRecordBuffersFull()
|
||||
+{
|
||||
+ if (!hdl)
|
||||
+ return SetErrorValues(NotOpen, EBADF);
|
||||
+
|
||||
+ struct pollfd pfd;
|
||||
+ int events = POLLIN;
|
||||
+ sio_pollfd(hdl, &pfd, events);
|
||||
+ return ConvertOSError(::poll(&pfd, 1, 0));
|
||||
+}
|
||||
+
|
||||
+
|
||||
+PBoolean PSoundChannelSNDIO::WaitForRecordBufferFull()
|
||||
+{
|
||||
+ if (!hdl)
|
||||
+ return SetErrorValues(NotOpen, EBADF);
|
||||
+
|
||||
+ // return PXSetIOBlock(PXReadBlock, readTimeout);
|
||||
+
|
||||
+ struct pollfd pfd;
|
||||
+ int events = POLLIN;
|
||||
+ sio_pollfd(hdl, &pfd, events);
|
||||
+ return ConvertOSError(::poll(&pfd, 1, 1000));
|
||||
+}
|
||||
+
|
||||
+
|
||||
+PBoolean PSoundChannelSNDIO::WaitForAllRecordBuffersFull()
|
||||
+{
|
||||
+ if (!hdl)
|
||||
+ return SetErrorValues(NotOpen, EBADF);
|
||||
+
|
||||
+ struct pollfd pfd;
|
||||
+ int events = POLLIN;
|
||||
+ sio_pollfd(hdl, &pfd, events);
|
||||
+ return ConvertOSError(::poll(&pfd, 1, 1000));
|
||||
+}
|
||||
+
|
||||
+
|
||||
+PBoolean PSoundChannelSNDIO::Abort()
|
||||
+{
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+PBoolean PSoundChannelSNDIO::SetVolume(unsigned newVal)
|
||||
+{
|
||||
+ if (!hdl)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ return FALSE;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+PBoolean PSoundChannelSNDIO::GetVolume(unsigned &devVol)
|
||||
+{
|
||||
+ if (!hdl)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ devVol = 0;
|
||||
+ return FALSE;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+
|
||||
+// End of file
|
||||
diff --git b/plugins/sound_sndio/sound_sndio.h b/plugins/sound_sndio/sound_sndio.h
|
||||
new file mode 100644
|
||||
index 0000000..6fc8325
|
||||
--- /dev/null
|
||||
+++ b/plugins/sound_sndio/sound_sndio.h
|
||||
@@ -0,0 +1,66 @@
|
||||
+
|
||||
+#include <ptlib.h>
|
||||
+#include <ptlib/sound.h>
|
||||
+#include <ptlib/socket.h>
|
||||
+
|
||||
+#include <sndio.h>
|
||||
+
|
||||
+class PSoundChannelSNDIO: public PSoundChannel
|
||||
+{
|
||||
+ public:
|
||||
+ PSoundChannelSNDIO();
|
||||
+ void Construct();
|
||||
+ PSoundChannelSNDIO(const PString &device,
|
||||
+ PSoundChannel::Directions dir,
|
||||
+ unsigned numChannels,
|
||||
+ unsigned sampleRate,
|
||||
+ unsigned bitsPerSample);
|
||||
+ ~PSoundChannelSNDIO();
|
||||
+ static PStringArray GetDeviceNames(PSoundChannel::Directions = Player);
|
||||
+ static PString GetDefaultDevice(PSoundChannel::Directions);
|
||||
+ PBoolean Open(const PString & _device,
|
||||
+ Directions _dir,
|
||||
+ unsigned _numChannels,
|
||||
+ unsigned _sampleRate,
|
||||
+ unsigned _bitsPerSample);
|
||||
+ PBoolean Setup();
|
||||
+ PBoolean Close();
|
||||
+ PBoolean IsOpen() const;
|
||||
+ PBoolean Write(const void * buf, PINDEX len);
|
||||
+ PBoolean Read(void * buf, PINDEX len);
|
||||
+ PBoolean SetFormat(unsigned numChannels,
|
||||
+ unsigned sampleRate,
|
||||
+ unsigned bitsPerSample);
|
||||
+ unsigned GetChannels() const;
|
||||
+ unsigned GetSampleRate() const;
|
||||
+ unsigned GetSampleSize() const;
|
||||
+ PBoolean SetBuffers(PINDEX size, PINDEX count);
|
||||
+ PBoolean GetBuffers(PINDEX & size, PINDEX & count);
|
||||
+ PBoolean PlaySound(const PSound & sound, PBoolean wait);
|
||||
+ PBoolean PlayFile(const PFilePath & filename, PBoolean wait);
|
||||
+ PBoolean HasPlayCompleted();
|
||||
+ PBoolean WaitForPlayCompletion();
|
||||
+ PBoolean RecordSound(PSound & sound);
|
||||
+ PBoolean RecordFile(const PFilePath & filename);
|
||||
+ PBoolean StartRecording();
|
||||
+ PBoolean IsRecordBufferFull();
|
||||
+ PBoolean AreAllRecordBuffersFull();
|
||||
+ PBoolean WaitForRecordBufferFull();
|
||||
+ PBoolean WaitForAllRecordBuffersFull();
|
||||
+ PBoolean Abort();
|
||||
+ PBoolean SetVolume(unsigned newVal);
|
||||
+ PBoolean GetVolume(unsigned &devVol);
|
||||
+
|
||||
+ protected:
|
||||
+ struct sio_hdl *hdl;
|
||||
+ struct sio_par par;
|
||||
+ unsigned mNumChannels;
|
||||
+ unsigned mSampleRate;
|
||||
+ unsigned mBitsPerSample;
|
||||
+ unsigned mFragCount;
|
||||
+ unsigned mFragSize;
|
||||
+ unsigned mBytesPerFrame;
|
||||
+ Directions mDirection;
|
||||
+ PString mDevice;
|
||||
+ PBoolean isInitialised;
|
||||
+};
|
||||
diff --git a/src/Makefile b/src/Makefile
|
||||
index 0ac1c3b..99b66c2 100644
|
||||
--- a/src/Makefile
|
||||
+++ b/src/Makefile
|
||||
@@ -151,7 +151,12 @@ endif # linux
|
||||
ifdef HAS_ALSA
|
||||
VPATH_CXX += $(PLUGIN_DIR)/sound_alsa
|
||||
SOURCES += $(PLUGIN_DIR)/sound_alsa/sound_alsa.cxx
|
||||
-endif # HAS_ALSA
|
||||
+
|
||||
+endif # HAS_SNDIO
|
||||
+ifdef HAS_SNDIO
|
||||
+VPATH_CXX += $(PLUGIN_DIR)/sound_sndio
|
||||
+SOURCES += $(PLUGIN_DIR)/sound_sndio/sound_sndio.cxx
|
||||
+endif # HAS_SNDIO
|
||||
|
||||
ifeq ($(OSTYPE),beos)
|
||||
SOURCES += $(PLATFORM_SRC_DIR)/beaudio.cxx
|
||||
Reference in New Issue
Block a user