diff options
author | wiz <wiz@pkgsrc.org> | 2014-04-12 06:39:34 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2014-04-12 06:39:34 +0000 |
commit | feea9d153b09c7065dfda995ed3b9d9846232f3a (patch) | |
tree | 02c859be842e96343e3f562b80b03724eb7ccd19 /audio/opusfile | |
parent | aa2912515f61618d5be5bbb6246de07973f73b93 (diff) | |
download | pkgsrc-feea9d153b09c7065dfda995ed3b9d9846232f3a.tar.gz |
Import opusfile-0.5 as audio/opusfile.
Opus is a totally open, royalty-free, highly versatile audio codec.
Opus is unmatched for interactive speech and music transmission
over the Internet, but also intended for storage and streaming
applications. It is standardized by the Internet Engineering Task
Force (IETF) as RFC 6716 which incorporated technology from Skype's
SILK codec and Xiph.Org's CELT codec.
This package contains a high level API for decoding and seeking in
opus files.
Diffstat (limited to 'audio/opusfile')
-rw-r--r-- | audio/opusfile/DESCR | 9 | ||||
-rw-r--r-- | audio/opusfile/Makefile | 22 | ||||
-rw-r--r-- | audio/opusfile/PLIST | 9 | ||||
-rw-r--r-- | audio/opusfile/buildlink3.mk | 16 | ||||
-rw-r--r-- | audio/opusfile/distinfo | 6 | ||||
-rw-r--r-- | audio/opusfile/patches/patch-src_http.c | 162 |
6 files changed, 224 insertions, 0 deletions
diff --git a/audio/opusfile/DESCR b/audio/opusfile/DESCR new file mode 100644 index 00000000000..456a19ed115 --- /dev/null +++ b/audio/opusfile/DESCR @@ -0,0 +1,9 @@ +Opus is a totally open, royalty-free, highly versatile audio codec. +Opus is unmatched for interactive speech and music transmission +over the Internet, but also intended for storage and streaming +applications. It is standardized by the Internet Engineering Task +Force (IETF) as RFC 6716 which incorporated technology from Skype's +SILK codec and Xiph.Org's CELT codec. + +This package contains a high level API for decoding and seeking in +opus files. diff --git a/audio/opusfile/Makefile b/audio/opusfile/Makefile new file mode 100644 index 00000000000..e67335289d8 --- /dev/null +++ b/audio/opusfile/Makefile @@ -0,0 +1,22 @@ +# $NetBSD: Makefile,v 1.1 2014/04/12 06:39:34 wiz Exp $ + +DISTNAME= opusfile-0.5 +CATEGORIES= audio +MASTER_SITES= http://downloads.xiph.org/releases/opus/ + +MAINTAINER= pkgsrc-users@NetBSD.org +HOMEPAGE= http://opus-codec.org/ +COMMENT= Decoding and seeking API for opus files +LICENSE= modified-bsd + +GNU_CONFIGURE= yes +USE_LIBTOOL= yes +USE_TOOLS+= gmake pkg-config + +PKGCONFIG_OVERRIDE+= opusfile.pc.in +PKGCONFIG_OVERRIDE+= opusurl.pc.in + +.include "../../security/openssl/buildlink3.mk" +.include "../../audio/libopus/buildlink3.mk" +.include "../../multimedia/libogg/buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/audio/opusfile/PLIST b/audio/opusfile/PLIST new file mode 100644 index 00000000000..d9926e15a84 --- /dev/null +++ b/audio/opusfile/PLIST @@ -0,0 +1,9 @@ +@comment $NetBSD: PLIST,v 1.1 2014/04/12 06:39:34 wiz Exp $ +include/opus/opusfile.h +lib/libopusfile.la +lib/libopusurl.la +lib/pkgconfig/opusfile.pc +lib/pkgconfig/opusurl.pc +share/doc/opusfile/AUTHORS +share/doc/opusfile/COPYING +share/doc/opusfile/README.txt diff --git a/audio/opusfile/buildlink3.mk b/audio/opusfile/buildlink3.mk new file mode 100644 index 00000000000..d5c98da7688 --- /dev/null +++ b/audio/opusfile/buildlink3.mk @@ -0,0 +1,16 @@ +# $NetBSD: buildlink3.mk,v 1.1 2014/04/12 06:39:34 wiz Exp $ + +BUILDLINK_TREE+= opusfile + +.if !defined(OPUSFILE_BUILDLINK3_MK) +OPUSFILE_BUILDLINK3_MK:= + +BUILDLINK_API_DEPENDS.opusfile+= opusfile>=0.5 +BUILDLINK_PKGSRCDIR.opusfile?= ../../audio/opusfile + +.include "../../security/openssl/buildlink3.mk" +.include "../../audio/libopus/buildlink3.mk" +.include "../../multimedia/libogg/buildlink3.mk" +.endif # OPUSFILE_BUILDLINK3_MK + +BUILDLINK_TREE+= -opusfile diff --git a/audio/opusfile/distinfo b/audio/opusfile/distinfo new file mode 100644 index 00000000000..0f688714d84 --- /dev/null +++ b/audio/opusfile/distinfo @@ -0,0 +1,6 @@ +$NetBSD: distinfo,v 1.1 2014/04/12 06:39:34 wiz Exp $ + +SHA1 (opusfile-0.5.tar.gz) = 1ba9dabbbaa35034af8167661a918df6c003317e +RMD160 (opusfile-0.5.tar.gz) = 5b384fac3a6094e774a4397826335763f426fcb9 +Size (opusfile-0.5.tar.gz) = 437671 bytes +SHA1 (patch-src_http.c) = 1a150b3168623ed52ba7abe50f0bcdf28cfc12b6 diff --git a/audio/opusfile/patches/patch-src_http.c b/audio/opusfile/patches/patch-src_http.c new file mode 100644 index 00000000000..f9be4ae5cb4 --- /dev/null +++ b/audio/opusfile/patches/patch-src_http.c @@ -0,0 +1,162 @@ +$NetBSD: patch-src_http.c,v 1.1 2014/04/12 06:39:34 wiz Exp $ + +Avoid using the obsolete ftime() function. + +--- src/http.c.orig 2013-12-05 16:49:13.000000000 +0000 ++++ src/http.c +@@ -347,7 +347,7 @@ typedef int op_sock; + # define op_reset_errno() (errno=0) + + # endif +-# include <sys/timeb.h> ++# include <sys/time.h> + # include <openssl/x509v3.h> + + /*The maximum number of simultaneous connections. +@@ -788,7 +788,7 @@ struct OpusHTTPConn{ + /*The next connection in either the LRU or free list.*/ + OpusHTTPConn *next; + /*The last time we blocked for reading from this connection.*/ +- struct timeb read_time; ++ struct timeval read_time; + /*The number of bytes we've read since the last time we blocked.*/ + opus_int64 read_bytes; + /*The estimated throughput of this connection, in bytes/s.*/ +@@ -838,7 +838,7 @@ struct OpusHTTPStream{ + struct sockaddr_in6 v6; + } addr; + /*The last time we re-resolved the host.*/ +- struct timeb resolve_time; ++ struct timeval resolve_time; + /*A buffer used to build HTTP requests.*/ + OpusStringBuf request; + /*A buffer used to build proxy CONNECT requests.*/ +@@ -992,26 +992,26 @@ static int op_http_conn_estimate_availab + return available; + } + +-static opus_int32 op_time_diff_ms(const struct timeb *_end, +- const struct timeb *_start){ ++static opus_int32 op_time_diff_ms(const struct timeval *_end, ++ const struct timeval *_start){ + opus_int64 dtime; +- dtime=_end->time-(opus_int64)_start->time; +- OP_ASSERT(_end->millitm<1000); +- OP_ASSERT(_start->millitm<1000); ++ dtime=_end->tv_sec-(opus_int64)_start->tv_sec; ++ OP_ASSERT(_end->tv_usec<1000000); ++ OP_ASSERT(_start->tv_usec<1000000); + if(OP_UNLIKELY(dtime>(OP_INT32_MAX-1000)/1000))return OP_INT32_MAX; + if(OP_UNLIKELY(dtime<(OP_INT32_MIN+1000)/1000))return OP_INT32_MIN; +- return (opus_int32)dtime*1000+_end->millitm-_start->millitm; ++ return (opus_int32)dtime*1000+(_end->tv_usec-_start->tv_usec)/1000; + } + + /*Update the read rate estimate for this connection.*/ + static void op_http_conn_read_rate_update(OpusHTTPConn *_conn){ +- struct timeb read_time; ++ struct timeval read_time; + opus_int32 read_delta_ms; + opus_int64 read_delta_bytes; + opus_int64 read_rate; + read_delta_bytes=_conn->read_bytes; + if(read_delta_bytes<=0)return; +- ftime(&read_time); ++ gettimeofday(&read_time, NULL); + read_delta_ms=op_time_diff_ms(&read_time,&_conn->read_time); + read_rate=_conn->read_rate; + read_delta_ms=OP_MAX(read_delta_ms,1); +@@ -1902,7 +1902,7 @@ static int op_sock_connect_next(op_sock + # define OP_NPROTOS (2) + + static int op_http_connect_impl(OpusHTTPStream *_stream,OpusHTTPConn *_conn, +- const struct addrinfo *_addrs,struct timeb *_start_time){ ++ const struct addrinfo *_addrs,struct timeval *_start_time){ + const struct addrinfo *addr; + const struct addrinfo *addrs[OP_NPROTOS]; + struct pollfd fds[OP_NPROTOS]; +@@ -1932,7 +1932,7 @@ static int op_http_connect_impl(OpusHTTP + _stream->free_head=_conn->next; + _conn->next=_stream->lru_head; + _stream->lru_head=_conn; +- ftime(_start_time); ++ gettimeofday(_start_time, NULL); + *&_conn->read_time=*_start_time; + _conn->read_bytes=0; + _conn->read_rate=0; +@@ -2034,14 +2034,14 @@ static int op_http_connect_impl(OpusHTTP + } + + static int op_http_connect(OpusHTTPStream *_stream,OpusHTTPConn *_conn, +- const struct addrinfo *_addrs,struct timeb *_start_time){ +- struct timeb resolve_time; ++ const struct addrinfo *_addrs,struct timeval *_start_time){ ++ struct timeval resolve_time; + struct addrinfo *new_addrs; + int ret; + /*Re-resolve the host if we need to (RFC 6555 says we MUST do so + occasionally).*/ + new_addrs=NULL; +- ftime(&resolve_time); ++ gettimeofday(&resolve_time, NULL); + if(_addrs!=&_stream->addr_info||op_time_diff_ms(&resolve_time, + &_stream->resolve_time)>=OP_RESOLVE_CACHE_TIMEOUT_MS){ + new_addrs=op_resolve(_stream->connect_host,_stream->connect_port); +@@ -2191,8 +2191,8 @@ static int op_http_stream_open(OpusHTTPS + addrs=NULL; + for(nredirs=0;nredirs<OP_REDIRECT_LIMIT;nredirs++){ + OpusParsedURL next_url; +- struct timeb start_time; +- struct timeb end_time; ++ struct timeval start_time; ++ struct timeval end_time; + char *next; + char *status_code; + int minor_version_pos; +@@ -2321,7 +2321,7 @@ static int op_http_stream_open(OpusHTTPS + if(OP_UNLIKELY(ret<0))return ret; + ret=op_http_conn_read_response(_stream->conns+0,&_stream->response); + if(OP_UNLIKELY(ret<0))return ret; +- ftime(&end_time); ++ gettimeofday(&end_time, NULL); + next=op_http_parse_status_line(&v1_1_compat,&status_code, + _stream->response.buf); + if(OP_UNLIKELY(next==NULL))return OP_FALSE; +@@ -2733,8 +2733,8 @@ static int op_http_conn_handle_response( + converted into a request for the rest.*/ + static int op_http_conn_open_pos(OpusHTTPStream *_stream, + OpusHTTPConn *_conn,opus_int64 _pos,opus_int32 _chunk_size){ +- struct timeb start_time; +- struct timeb end_time; ++ struct timeval start_time; ++ struct timeval end_time; + opus_int32 connect_rate; + opus_int32 connect_time; + int ret; +@@ -2744,7 +2744,7 @@ static int op_http_conn_open_pos(OpusHTT + if(OP_UNLIKELY(ret<0))return ret; + ret=op_http_conn_handle_response(_stream,_conn); + if(OP_UNLIKELY(ret!=0))return OP_FALSE; +- ftime(&end_time); ++ gettimeofday(&end_time, NULL); + _stream->cur_conni=_conn-_stream->conns; + OP_ASSERT(_stream->cur_conni>=0&&_stream->cur_conni<OP_NCONNS_MAX); + /*The connection has been successfully opened. +@@ -2996,7 +2996,7 @@ static int op_http_conn_read_ahead(OpusH + } + + static int op_http_stream_seek(void *_stream,opus_int64 _offset,int _whence){ +- struct timeb seek_time; ++ struct timeval seek_time; + OpusHTTPStream *stream; + OpusHTTPConn *conn; + OpusHTTPConn **pnext; +@@ -3037,7 +3037,7 @@ static int op_http_stream_seek(void *_st + op_http_conn_read_rate_update(stream->conns+ci); + *&seek_time=*&stream->conns[ci].read_time; + } +- else ftime(&seek_time); ++ else gettimeofday(&seek_time, NULL); + /*If we seeked past the end of the stream, just disable the active + connection.*/ + if(pos>=content_length){ |