Import celt07-0.7.1.

The CELT codec is an experimental audio codec for use in low-delay
speech and audio communication. It's meant to close the gap between
Vorbis and Speex for applications where both high quality audio and
low delay are desired.

This package contains the celt 0.7 API.

A requirement for the upcoming audio/mumble port.
This commit is contained in:
dcoppa 2013-10-01 10:09:50 +00:00
parent 539eeef333
commit d25c9c8168
9 changed files with 201 additions and 0 deletions

36
audio/celt07/Makefile Normal file
View File

@ -0,0 +1,36 @@
# $OpenBSD: Makefile,v 1.1.1.1 2013/10/01 10:09:50 dcoppa Exp $
# Warning: CELT is experimental software. Neither the API/ABI, nor
# the bit-stream are stable. Compatibility between different releases
# (even minor ones) is not preserved.
COMMENT = experimental ultra-low delay audio codec (0.7 API)
V = 0.7.1
DISTNAME = celt-$V
PKGNAME = celt07-$V
CATEGORIES = audio
HOMEPAGE = http://www.celt-codec.org/
SHARED_LIBS += celt07 0.0 # 0.0
# BSD
PERMIT_PACKAGE_CDROM = Yes
MASTER_SITES = http://downloads.xiph.org/releases/celt/
WANTLIB = c m ogg sndio
LIB_DEPENDS = audio/libogg
CONFIGURE_STYLE = gnu
CONFIGURE_ARGS = ${CONFIGURE_SHARED} \
--program-suffix=07 \
--with-ogg=${LOCALBASE}
CONFIGURE_ENV = CPPFLAGS="-DUSE_SNDIO"
.include <bsd.port.mk>

2
audio/celt07/distinfo Normal file
View File

@ -0,0 +1,2 @@
SHA256 (celt-0.7.1.tar.gz) = k/Di37WQIbGeadwN7oVeuJ8ZOX2x3qDQ1vkynP+TMGY=
SIZE (celt-0.7.1.tar.gz) = 425092

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-Makefile_in,v 1.1.1.1 2013/10/01 10:09:51 dcoppa Exp $
--- Makefile.in.orig Sun Jan 17 00:53:40 2010
+++ Makefile.in Fri May 31 13:42:38 2013
@@ -332,15 +332,8 @@ distclean-libtool:
install-pkgconfigDATA: $(pkgconfig_DATA)
@$(NORMAL_INSTALL)
test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
- @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
- done
+ echo " $(INSTALL_DATA) $(pkgconfig_DATA) '$(DESTDIR)$(pkgconfigdir)/celt@LIBCELT_SUFFIX@.pc'"; \
+ $(INSTALL_DATA) $(pkgconfig_DATA) "$(DESTDIR)$(pkgconfigdir)/celt@LIBCELT_SUFFIX@.pc" || exit $$?; \
uninstall-pkgconfigDATA:
@$(NORMAL_UNINSTALL)

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-configure,v 1.1.1.1 2013/10/01 10:09:51 dcoppa Exp $
--- configure.orig Fri May 31 08:14:20 2013
+++ configure Fri May 31 08:14:41 2013
@@ -2513,7 +2513,7 @@ CELT_MINOR_VERSION=7
CELT_MICRO_VERSION=1
CELT_EXTRA_VERSION=
CELT_VERSION=$CELT_MAJOR_VERSION.$CELT_MINOR_VERSION.$CELT_MICRO_VERSION$CELT_EXTRA_VERSION
-LIBCELT_SUFFIX=0
+LIBCELT_SUFFIX=07
CELT_LT_CURRENT=0
CELT_LT_REVISION=0

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-libcelt_Makefile_in,v 1.1.1.1 2013/10/01 10:09:51 dcoppa Exp $
--- libcelt/Makefile.in.orig Fri May 31 09:02:13 2013
+++ libcelt/Makefile.in Fri May 31 09:02:51 2013
@@ -23,7 +23,7 @@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@@LIBCELT_SUFFIX@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-tools_Makefile_in,v 1.1.1.1 2013/10/01 10:09:51 dcoppa Exp $
Use sndio for audio
--- tools/Makefile.in.orig Sun Jan 17 00:53:40 2010
+++ tools/Makefile.in Fri May 31 07:43:46 2013
@@ -237,7 +237,8 @@ noinst_HEADERS = wav_io.h
celtenc_SOURCES = celtenc.c wav_io.c skeleton.c
celtenc_LDADD = $(top_builddir)/libcelt/libcelt@LIBCELT_SUFFIX@.la $(OGG_LIBS)
celtdec_SOURCES = celtdec.c wav_io.c
-celtdec_LDADD = $(top_builddir)/libcelt/libcelt@LIBCELT_SUFFIX@.la $(OGG_LIBS)
+celtdec_LDADD = $(top_builddir)/libcelt/libcelt@LIBCELT_SUFFIX@.la $(OGG_LIBS) \
+ -lsndio
all: all-am
.SUFFIXES:

View File

@ -0,0 +1,81 @@
$OpenBSD: patch-tools_celtdec_c,v 1.1.1.1 2013/10/01 10:09:51 dcoppa Exp $
Use sndio for audio
--- tools/celtdec.c.orig Sun Oct 18 03:37:21 2009
+++ tools/celtdec.c Fri May 31 07:41:29 2013
@@ -70,6 +70,9 @@
#include <fcntl.h>
#include <sys/ioctl.h>
+#elif defined USE_SNDIO
+#include <sndio.h>
+
#elif defined HAVE_SYS_AUDIOIO_H
#include <sys/types.h>
#include <fcntl.h>
@@ -92,6 +95,10 @@
((buf[base+1]<<8)&0xff00)| \
(buf[base]&0xff))
+#ifdef USE_SNDIO
+struct sio_hdl *hdl;
+#endif
+
static void print_comments(char *comments, int length)
{
char *c=comments;
@@ -187,6 +194,32 @@ FILE *out_file_open(char *outFile, int rate, int *chan
exit(1);
}
fout = fdopen(audio_fd, "w");
+#elif defined USE_SNDIO
+ struct sio_par par;
+
+ hdl = sio_open(NULL, SIO_PLAY, 0);
+ if (!hdl)
+ {
+ fprintf(stderr, "Cannot open sndio device\n");
+ exit(1);
+ }
+
+ sio_initpar(&par);
+ par.sig = 1;
+ par.bits = 16;
+ par.rate = rate;
+ par.pchan = *channels;
+
+ if (!sio_setpar(hdl, &par) || !sio_getpar(hdl, &par) ||
+ par.sig != 1 || par.bits != 16 || par.rate != rate) {
+ fprintf(stderr, "could not set sndio parameters\n");
+ exit(1);
+ }
+ *channels = par.pchan;
+ if (!sio_start(hdl)) {
+ fprintf(stderr, "could not start sndio\n");
+ exit(1);
+ }
#elif defined HAVE_SYS_AUDIOIO_H
audio_info_t info;
int audio_fd;
@@ -615,6 +648,10 @@ int main(int argc, char **argv)
if (strlen(outFile)==0)
WIN_Play_Samples (out+frame_offset*channels, sizeof(short) * new_frame_size*channels);
else
+#elif defined USE_SNDIO
+ if (strlen(outFile)==0)
+ sio_write (hdl, out+frame_offset*channels, sizeof(short) * new_frame_size*channels);
+ else
#endif
fwrite(out+frame_offset*channels, sizeof(short), new_frame_size*channels, fout);
@@ -671,6 +708,9 @@ int main(int argc, char **argv)
fclose(fin);
if (fout != NULL)
fclose(fout);
+
+ if (print_bitrate)
+ fprintf (stderr, "\n");
return 0;
}

9
audio/celt07/pkg/DESCR Normal file
View File

@ -0,0 +1,9 @@
The CELT codec is an experimental audio codec for use in low-delay
speech and audio communication. It's meant to close the gap between
Vorbis and Speex for applications where both high quality audio and
low delay are desired.
This package contains the celt 0.7 API.
Note that the CELT codec has been merged into the IETF Opus codec
(http://opus-codec.org/) and is now considered obsolete.

12
audio/celt07/pkg/PLIST Normal file
View File

@ -0,0 +1,12 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2013/10/01 10:09:51 dcoppa Exp $
@bin bin/celtdec07
@bin bin/celtenc07
include/celt07/
include/celt07/celt.h
include/celt07/celt_header.h
include/celt07/celt_types.h
lib/libcelt07.a
lib/libcelt07.la
@lib lib/libcelt07.so.${LIBcelt07_VERSION}
lib/pkgconfig/
lib/pkgconfig/celt07.pc