Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • xiph/opusfile
  • rillian/opusfile
  • TD-Linux/opusfile
  • tterribe/opusfile
  • ePirat/opusfile
  • steils/opusfile
  • markh/opusfile
  • traud/opusfile
  • thesamesam/opusfile
  • martinwguy/opusfile
10 results
Show changes
Commits on Source (110)
...@@ -8,27 +8,33 @@ platform: ...@@ -8,27 +8,33 @@ platform:
- Win32 - Win32
- x64 - x64
environment:
opus_url: https://ci.appveyor.com/api/projects/$(APPVEYOR_ACCOUNT_NAME)/opus/artifacts/opus.zip
install: install:
- cd %APPVEYOR_BUILD_FOLDER%\.. - cd %APPVEYOR_BUILD_FOLDER%\..
- git clone -q https://github.com/xiph/opus.git opus - 'curl -LOG --data-urlencode "job=Configuration: %CONFIGURATION:-NoHTTP=%; Platform: %PLATFORM%" %OPUS_URL%'
- 7z x opus.zip -oopus-artifacts
- move /Y opus-artifacts opus
- git clone -q https://github.com/xiph/ogg.git ogg - git clone -q https://github.com/xiph/ogg.git ogg
- msbuild opus\win32\VS2015\opus.vcxproj /p:Configuration=%CONFIGURATION:-NoHTTP=%;Platform=%PLATFORM% /m /v:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" - msbuild ogg\win32\VS2015\libogg.sln /p:Configuration=%CONFIGURATION:-NoHTTP=%;Platform=%PLATFORM% /m /v:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- msbuild ogg\win32\VS2015\libogg_static.sln /p:Configuration=%CONFIGURATION:-NoHTTP=%;Platform=%PLATFORM% /m /v:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- if %CONFIGURATION:-NoHTTP=%==%CONFIGURATION% git clone -q --branch=OpenSSL_1_0_2-stable https://github.com/openssl/openssl.git openssl - if %CONFIGURATION:-NoHTTP=%==%CONFIGURATION% git clone -q --branch=OpenSSL_1_0_2-stable https://github.com/openssl/openssl.git openssl
- ps: >- - ps: >-
If ($env:Platform -Match "Win32") { If ($env:Platform -Match "Win32") {
$env:VCVARS_PLATFORM="x86" $env:VCVARS_PLATFORM="x86"
$env:OPENSSL_TARGET="VC-WIN32" $env:OPENSSL_TARGET="VC-WIN32"
$env:DO="do_ms" $env:DO="do_nasm"
} Else { } Else {
$env:VCVARS_PLATFORM="amd64" $env:VCVARS_PLATFORM="amd64"
$env:OPENSSL_TARGET="VC-WIN64A" $env:OPENSSL_TARGET="VC-WIN64A"
$env:DO="do_win64a" $env:DO="do_win64a"
} }
- if %CONFIGURATION:-NoHTTP=%==%CONFIGURATION% chocolatey install -y nasm
- if %CONFIGURATION:-NoHTTP=%==%CONFIGURATION% set PATH=%PROGRAMFILES%\nasm;%PATH%
- if %CONFIGURATION:-NoHTTP=%==%CONFIGURATION% call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" %VCVARS_PLATFORM% - if %CONFIGURATION:-NoHTTP=%==%CONFIGURATION% call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" %VCVARS_PLATFORM%
- if %CONFIGURATION:-NoHTTP=%==%CONFIGURATION% cd openssl - if %CONFIGURATION:-NoHTTP=%==%CONFIGURATION% cd openssl
# without prefix, libs end up in out32 for both 32 and 64-bit # without prefix, libs end up in out32 for both 32 and 64-bit
- if %CONFIGURATION:-NoHTTP=%==%CONFIGURATION% perl Configure %OPENSSL_TARGET% no-asm --prefix=%CD%\%PLATFORM%\Release - if %CONFIGURATION:-NoHTTP=%==%CONFIGURATION% perl Configure %OPENSSL_TARGET% --prefix=%CD%\%PLATFORM%\Release
- if %CONFIGURATION:-NoHTTP=%==%CONFIGURATION% call ms\%DO% - if %CONFIGURATION:-NoHTTP=%==%CONFIGURATION% call ms\%DO%
- if %CONFIGURATION:-NoHTTP=%==%CONFIGURATION% nmake /f ms\nt.mak - if %CONFIGURATION:-NoHTTP=%==%CONFIGURATION% nmake /f ms\nt.mak
- if %CONFIGURATION:-NoHTTP=%==%CONFIGURATION% nmake /f ms\nt.mak install - if %CONFIGURATION:-NoHTTP=%==%CONFIGURATION% nmake /f ms\nt.mak install
...@@ -42,7 +48,11 @@ build: ...@@ -42,7 +48,11 @@ build:
verbosity: minimal verbosity: minimal
after_build: after_build:
- 7z a opusfile.zip win32\VS2015\%PLATFORM%\%CONFIGURATION%\opusfile.lib include\opusfile.h - if %CONFIGURATION:-NoHTTP=%==%CONFIGURATION% copy /B %APPVEYOR_BUILD_FOLDER%\..\openssl\%PLATFORM%\Release\lib\* win32\VS2015\%PLATFORM%\%CONFIGURATION%\
- if %CONFIGURATION:-NoHTTP=%==%CONFIGURATION% mkdir include\openssl
- if %CONFIGURATION:-NoHTTP=%==%CONFIGURATION% copy /B %APPVEYOR_BUILD_FOLDER%\..\openssl\inc32\openssl include\openssl\
- 7z a opusfile.zip win32\VS2015\%PLATFORM%\%CONFIGURATION%\opusfile.??? include\
- if %CONFIGURATION:-NoHTTP=%==%CONFIGURATION% 7z a opusfile.zip win32\VS2015\%PLATFORM%\%CONFIGURATION%\lib.pdb win32\VS2015\%PLATFORM%\%CONFIGURATION%\*.lib
artifacts: artifacts:
- path: opusfile.zip - path: opusfile.zip
...@@ -2,3 +2,9 @@ ...@@ -2,3 +2,9 @@
.gitattributes export-ignore .gitattributes export-ignore
update_version export-ignore update_version export-ignore
*.bat eol=crlf
*.sln eol=crlf
*.vcxproj eol=crlf
*.vcxproj.filters eol=crlf
common.props eol=crlf
...@@ -47,3 +47,4 @@ test-driver ...@@ -47,3 +47,4 @@ test-driver
unix/objs unix/objs
unix/opusfile_example unix/opusfile_example
unix/seeking_example unix/seeking_example
build
default:
tags:
- docker
# Image from https://hub.docker.com/_/gcc/ based on Debian
image: gcc:9
autotools:
stage: build
before_script:
- apt-get update &&
apt-get install -y libopus-dev libogg-dev libssl-dev
zip
script:
- ./autogen.sh
- ./configure
- make
- make distcheck
cmake:
stage: build
before_script:
- apt-get update &&
apt-get install -y libopus-dev libogg-dev libssl-dev
doxygen
script:
- curl -O https://cmake.org/files/v3.16/cmake-3.16.9-Linux-x86_64.tar.gz
- tar xzf cmake-3.16.9-Linux-x86_64.tar.gz
- cmake-3.16.9-Linux-x86_64/bin/cmake -Bbuild -H.
- cmake-3.16.9-Linux-x86_64/bin/cmake --build build
tags:
- docker
makefile:
stage: build
before_script:
- apt-get update &&
apt-get install -y libopus-dev libogg-dev libssl-dev
script:
- make -C unix
- make -C unix check
doc:
stage: build
before_script:
- apt-get update &&
apt-get install -y doxygen graphviz
script:
- make -C doc
language: c language: c
# We need at least Ubuntu 14.04 for the libopus dependency. compiler:
sudo: required - gcc
dist: trusty - clang
os:
- linux
- osx
osx_image: xcode11.3
addons: addons:
apt: apt:
packages: packages:
- doxygen
- libogg-dev - libogg-dev
- libopus-dev - libopus-dev
- libssl-dev
homebrew:
brewfile: true
env: PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/opt/openssl/lib/pkgconfig
before_script:
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then
curl -O https://cmake.org/files/v3.16/cmake-3.16.9-Linux-x86_64.tar.gz;
tar xzf cmake-3.16.9-Linux-x86_64.tar.gz;
export PATH="${PWD}/cmake-3.16.9-Linux-x86_64/bin:${PATH}";
fi
script: script:
- cmake -Bbuild -H.
- cmake --build build
- ./autogen.sh - ./autogen.sh
- ./configure - ./configure
- make - make
......
brew 'opus'
brew 'libogg'
brew 'openssl'
brew 'autoconf'
brew 'automake'
brew 'libtool'
brew 'pkg-config'
brew 'cmake@3.16'
brew 'doxygen'
cmake_minimum_required(VERSION 3.16)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
include(OpusFilePackageVersion)
get_package_version(PACKAGE_VERSION PROJECT_VERSION)
string(REPLACE "." ";" PROJECT_VERSION_LIST ${PROJECT_VERSION})
list(GET PROJECT_VERSION_LIST 0 PROJECT_VERSION_MAJOR)
list(GET PROJECT_VERSION_LIST 1 PROJECT_VERSION_MINOR)
project(OpusFile
VERSION ${PROJECT_VERSION}
LANGUAGES C
)
option(OP_DISABLE_HTTP "Disable HTTP support" OFF)
option(OP_DISABLE_FLOAT_API "Disable floating-point API" OFF)
option(OP_FIXED_POINT "Enable fixed-point calculation" OFF)
option(OP_ENABLE_ASSERTIONS "Enable assertions in code" OFF)
option(OP_DISABLE_EXAMPLES "Do not build example applications" OFF)
option(OP_DISABLE_DOCS "Do not build API documentation" OFF)
include(GNUInstallDirs)
find_package(Ogg REQUIRED)
find_package(Opus REQUIRED)
include(CMakePushCheckState)
include(CheckSymbolExists)
cmake_push_check_state(RESET)
include(CheckLibraryExists)
check_library_exists(m lrintf "" OP_HAVE_LIBM)
if(OP_HAVE_LIBM)
list(APPEND CMAKE_REQUIRED_LIBRARIES "m")
endif()
check_symbol_exists(lrintf "math.h" OP_HAVE_LRINTF)
cmake_pop_check_state()
add_library(opusfile
"${CMAKE_CURRENT_SOURCE_DIR}/include/opusfile.h"
"${CMAKE_CURRENT_SOURCE_DIR}/src/info.c"
"${CMAKE_CURRENT_SOURCE_DIR}/src/internal.c"
"${CMAKE_CURRENT_SOURCE_DIR}/src/internal.h"
"${CMAKE_CURRENT_SOURCE_DIR}/src/opusfile.c"
"${CMAKE_CURRENT_SOURCE_DIR}/src/stream.c"
)
add_library(OpusFile::opusfile ALIAS opusfile)
set_target_properties(opusfile PROPERTIES
PUBLIC_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/include/opusfile.h"
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
)
target_include_directories(opusfile
PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/include"
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/opus>
)
target_link_libraries(opusfile
PUBLIC
Ogg::ogg
Opus::opus
$<$<BOOL:${OP_HAVE_LIBM}>:m>
)
target_compile_options(opusfile
PRIVATE
$<$<C_COMPILER_ID:MSVC>:/wd4267>
$<$<C_COMPILER_ID:MSVC>:/wd4244>
$<$<C_COMPILER_ID:MSVC>:/wd4090>
$<$<C_COMPILER_ID:Clang,GNU>:-std=c89>
$<$<C_COMPILER_ID:Clang,GNU>:-pedantic>
$<$<C_COMPILER_ID:Clang,GNU>:-Wall>
$<$<C_COMPILER_ID:Clang,GNU>:-Wextra>
$<$<C_COMPILER_ID:Clang,GNU>:-Wno-parentheses>
$<$<C_COMPILER_ID:Clang,GNU>:-Wno-long-long>
$<$<C_COMPILER_ID:Clang,GNU>:-fvisibility=hidden>
)
target_compile_definitions(opusfile
PRIVATE
$<$<BOOL:${OP_DISABLE_FLOAT_API}>:OP_DISABLE_FLOAT_API>
$<$<BOOL:${OP_FIXED_POINT}>:OP_FIXED_POINT>
$<$<BOOL:${OP_ENABLE_ASSERTIONS}>:OP_ENABLE_ASSERTIONS>
$<$<BOOL:${OP_HAVE_LRINTF}>:OP_HAVE_LRINTF>
)
install(TARGETS opusfile
EXPORT OpusFileTargets
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/opus"
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/opus"
)
if(NOT OP_DISABLE_HTTP)
find_package(OpenSSL REQUIRED)
include(CheckIncludeFile)
include(CheckCSourceCompiles)
cmake_push_check_state(RESET)
if(NOT WIN32)
check_include_file("sys/socket.h" OP_HAVE_SYS_SOCKET_H)
if(NOT OP_HAVE_SYS_SOCKET_H)
message(FATAL_ERROR "HTTP support requires a POSIX socket library")
endif()
endif()
check_c_source_compiles(
"#include <time.h>
int main(void)
{
struct timespec ts;
return clock_gettime(CLOCK_REALTIME, &ts);
}"
OP_HAVE_CLOCK_GETTIME
)
if(NOT OP_HAVE_CLOCK_GETTIME)
check_symbol_exists(ftime "sys/timeb.h" OP_HAVE_FTIME)
if(NOT OP_HAVE_FTIME)
message(FATAL_ERROR "HTTP support requires either clock_gettime() or ftime()")
endif()
endif()
cmake_pop_check_state()
add_library(opusurl
"${CMAKE_CURRENT_SOURCE_DIR}/include/opusfile.h"
"${CMAKE_CURRENT_SOURCE_DIR}/src/http.c"
"${CMAKE_CURRENT_SOURCE_DIR}/src/internal.c"
"${CMAKE_CURRENT_SOURCE_DIR}/src/internal.h"
)
add_library(OpusFile::opusurl ALIAS opusurl)
if(WIN32)
target_sources(opusurl PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/src/wincerts.c"
"${CMAKE_CURRENT_SOURCE_DIR}/src/winerrno.h"
)
endif()
set_target_properties(opusurl PROPERTIES
PUBLIC_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/include/opusfile.h"
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
)
target_include_directories(opusurl
PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/include"
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/opus>
)
target_compile_definitions(opusurl
PRIVATE
$<$<BOOL:${OP_DISABLE_FLOAT_API}>:OP_DISABLE_FLOAT_API>
$<$<BOOL:${OP_FIXED_POINT}>:OP_FIXED_POINT>
$<$<BOOL:${OP_ENABLE_ASSERTIONS}>:OP_ENABLE_ASSERTIONS>
$<$<BOOL:${OP_HAVE_LRINTF}>:OP_HAVE_LRINTF>
$<$<BOOL:${OP_HAVE_CLOCK_GETTIME}>:OP_HAVE_CLOCK_GETTIME>
$<$<BOOL:${OP_HAVE_FTIME}>:OP_HAVE_FTIME>
OP_ENABLE_HTTP
)
target_link_libraries(opusurl
PRIVATE
opusfile
OpenSSL::SSL
$<$<C_COMPILER_ID:MSVC>:ws2_32>
$<$<C_COMPILER_ID:MSVC>:crypt32>
$<$<BOOL:${OP_HAVE_LIBM}>:m>
)
target_compile_options(opusurl
PRIVATE
$<$<C_COMPILER_ID:MSVC>:/wd4267>
$<$<C_COMPILER_ID:MSVC>:/wd4244>
$<$<C_COMPILER_ID:MSVC>:/wd4090>
$<$<C_COMPILER_ID:Clang,GNU>:-std=c89>
$<$<C_COMPILER_ID:Clang,GNU>:-pedantic>
$<$<C_COMPILER_ID:Clang,GNU>:-Wall>
$<$<C_COMPILER_ID:Clang,GNU>:-Wextra>
$<$<C_COMPILER_ID:Clang,GNU>:-Wno-parentheses>
$<$<C_COMPILER_ID:Clang,GNU>:-Wno-long-long>
$<$<C_COMPILER_ID:Clang,GNU>:-fvisibility=hidden>
)
install(TARGETS opusurl
EXPORT OpusFileTargets
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/opus"
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/opus"
)
endif()
if(NOT OP_DISABLE_EXAMPLES)
add_executable(opusfile_example
"${CMAKE_CURRENT_SOURCE_DIR}/examples/opusfile_example.c"
)
add_executable(OpusFile::opusfile_example ALIAS opusfile_example)
if(WIN32)
target_sources(opusfile_example PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/examples/win32utf8.c"
"${CMAKE_CURRENT_SOURCE_DIR}/examples/win32utf8.h"
)
endif()
target_include_directories(opusfile_example
PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/examples"
)
target_link_libraries(opusfile_example
PRIVATE
opusfile
opusurl
)
target_compile_options(opusfile_example
PRIVATE
$<$<C_COMPILER_ID:MSVC>:/wd4267>
$<$<C_COMPILER_ID:MSVC>:/wd4244>
$<$<C_COMPILER_ID:MSVC>:/wd4090>
$<$<C_COMPILER_ID:Clang,GNU>:-std=c89>
$<$<C_COMPILER_ID:Clang,GNU>:-pedantic>
$<$<C_COMPILER_ID:Clang,GNU>:-Wall>
$<$<C_COMPILER_ID:Clang,GNU>:-Wextra>
$<$<C_COMPILER_ID:Clang,GNU>:-Wno-parentheses>
$<$<C_COMPILER_ID:Clang,GNU>:-Wno-long-long>
$<$<C_COMPILER_ID:Clang,GNU>:-fvisibility=hidden>
)
add_executable(seeking_example
"${CMAKE_CURRENT_SOURCE_DIR}/examples/seeking_example.c"
)
add_executable(OpusFile::seeking_example ALIAS seeking_example)
if(WIN32)
target_sources(seeking_example PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/examples/win32utf8.c"
"${CMAKE_CURRENT_SOURCE_DIR}/examples/win32utf8.h"
)
endif()
target_include_directories(seeking_example
PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/examples"
)
target_link_libraries(seeking_example
PRIVATE
opusfile
opusurl
)
target_compile_options(seeking_example
PRIVATE
$<$<C_COMPILER_ID:MSVC>:/wd4267>
$<$<C_COMPILER_ID:MSVC>:/wd4244>
$<$<C_COMPILER_ID:MSVC>:/wd4090>
$<$<C_COMPILER_ID:Clang,GNU>:-std=c89>
$<$<C_COMPILER_ID:Clang,GNU>:-pedantic>
$<$<C_COMPILER_ID:Clang,GNU>:-Wall>
$<$<C_COMPILER_ID:Clang,GNU>:-Wextra>
$<$<C_COMPILER_ID:Clang,GNU>:-Wno-parentheses>
$<$<C_COMPILER_ID:Clang,GNU>:-Wno-long-long>
$<$<C_COMPILER_ID:Clang,GNU>:-fvisibility=hidden>
)
endif()
if(NOT OP_DISABLE_DOCS)
find_package(Doxygen OPTIONAL_COMPONENTS dot)
set(DOXYGEN_PROJECT_BRIEF "Stand-alone decoder library for .opus files.")
set(DOXYGEN_OPTIMIZE_OUTPUT_FOR_C YES)
set(DOXYGEN_QUIET YES)
set(DOXYGEN_WARNINGS YES)
set(DOXYGEN_WARN_IF_UNDOCUMENTED YES)
set(DOXYGEN_WARN_IF_DOC_ERROR YES)
set(DOXYGEN_WARN_NO_PARAMDOC YES)
set(DOXYGEN_JAVADOC_AUTOBRIEF YES)
set(DOXYGEN_SORT_MEMBER_DOCS NO)
set(DOXYGEN_PROJECT_LOGO "${CMAKE_CURRENT_SOURCE_DIR}/doc/opus_logo.svg")
set(DOXYGEN_FULL_PATH_NAMES NO)
doxygen_add_docs(doxygen "${CMAKE_CURRENT_SOURCE_DIR}/include/opusfile.h" ALL USE_STAMP_FILE)
endif()
install(EXPORT OpusFileTargets
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/opusfile"
NAMESPACE OpusFile::
)
include(CMakePackageConfigHelpers)
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/OpusFileConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/OpusFileConfig.cmake"
INSTALL_DESTINATION
"${CMAKE_INSTALL_LIBDIR}/cmake/opusfile"
)
write_basic_package_version_file(
"OpusFileConfigVersion.cmake"
VERSION "${PACKAGE_VERSION}"
COMPATIBILITY AnyNewerVersion
)
install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/OpusFileConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/OpusFileConfigVersion.cmake"
DESTINATION
"${CMAKE_INSTALL_LIBDIR}/cmake/opusfile"
)
# Opusfile # Opusfile
[![GitLab Pipeline Status](https://gitlab.xiph.org/xiph/opusfile/badges/master/pipeline.svg)](https://gitlab.xiph.org/xiph/opusfile/commits/master)
[![Travis Build Status](https://travis-ci.org/xiph/opusfile.svg?branch=master)](https://travis-ci.org/xiph/opusfile) [![Travis Build Status](https://travis-ci.org/xiph/opusfile.svg?branch=master)](https://travis-ci.org/xiph/opusfile)
[![Jenkins Build Status](https://mf4.xiph.org/jenkins/buildStatus/icon?job=opusfile-autotools)](https://mf4.xiph.org/jenkins/view/opus/job/opusfile-autotools/)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/xiph/opusfile?branch=master&svg=true)](https://ci.appveyor.com/project/rillian/opusfile) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/xiph/opusfile?branch=master&svg=true)](https://ci.appveyor.com/project/rillian/opusfile)
The opusfile and opusurl libraries provide a high-level API for The opusfile and opusurl libraries provide a high-level API for
...@@ -12,7 +12,7 @@ opusurl depends on opusfile and openssl. ...@@ -12,7 +12,7 @@ opusurl depends on opusfile and openssl.
The library is functional, but there are likely issues The library is functional, but there are likely issues
we didn't find in our own testing. Please give feedback we didn't find in our own testing. Please give feedback
in #opus on irc.freenode.net or at opus@xiph.org. in #opus on irc.libera.chat or at opus@xiph.org.
Programming documentation is available in tree and online at Programming documentation is available in tree and online at
https://opus-codec.org/docs/ https://opus-codec.org/docs/
find_package(Ogg CONFIG)
if(NOT TARGET Ogg::ogg)
find_package(PkgConfig REQUIRED)
pkg_check_modules(Ogg REQUIRED IMPORTED_TARGET ogg)
set_target_properties(PkgConfig::Ogg PROPERTIES IMPORTED_GLOBAL TRUE)
add_library(Ogg::ogg ALIAS PkgConfig::Ogg)
endif()
find_package(Opus CONFIG)
if(NOT TARGET Opus::opus)
find_package(PkgConfig REQUIRED)
pkg_check_modules(Opus REQUIRED IMPORTED_TARGET opus)
set_target_properties(PkgConfig::Opus PROPERTIES IMPORTED_GLOBAL TRUE)
add_library(Opus::opus ALIAS PkgConfig::Opus)
endif()
@PACKAGE_INIT@
# Ported from CMakeFindDependencyMacro.cmake (finding configs and using pkgconfig as fallback)
set(cmake_quiet_arg)
if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
set(cmake_quiet_arg QUIET)
endif()
set(cmake_required_arg)
if(${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED)
set(cmake_required_arg REQUIRED)
endif()
find_package(Ogg CONFIG ${cmake_quiet_arg})
if(NOT TARGET Ogg::ogg)
find_package(PkgConfig REQUIRED ${cmake_quiet_arg})
pkg_check_modules(Ogg ${cmake_required_arg} ${cmake_quiet_arg} IMPORTED_TARGET ogg)
set_target_properties(PkgConfig::Ogg PROPERTIES IMPORTED_GLOBAL TRUE)
add_library(Ogg::ogg ALIAS PkgConfig::Ogg)
endif()
if (NOT TARGET Ogg::ogg)
set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "${CMAKE_FIND_PACKAGE_NAME} could not be found because dependency Ogg could not be found.")
set(${CMAKE_FIND_PACKAGE_NAME}_FOUND False)
return()
endif()
find_package(Opus CONFIG ${cmake_quiet_arg})
if(NOT TARGET Opus::opus)
find_package(PkgConfig REQUIRED ${cmake_quiet_arg})
pkg_check_modules(Opus ${cmake_required_arg} ${cmake_quiet_arg} IMPORTED_TARGET opus)
set_target_properties(PkgConfig::Opus PROPERTIES IMPORTED_GLOBAL TRUE)
add_library(Opus::opus ALIAS PkgConfig::Opus)
endif()
if (NOT TARGET Opus::opus)
set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "${CMAKE_FIND_PACKAGE_NAME} could not be found because dependency Opus could not be found.")
set(${CMAKE_FIND_PACKAGE_NAME}_FOUND False)
return()
endif()
set(cmake_fd_required_arg)
set(cmake_fd_quiet_arg)
if (NOT @OP_DISABLE_HTTP@)
include(CMakeFindDependencyMacro)
find_dependency(OpenSSL)
endif()
# Including targets of opusfile
include("${CMAKE_CURRENT_LIST_DIR}/opusfileTargets.cmake")
check_required_components(opusfile)
if(__opusfile_version)
return()
endif()
set(__opusfile_version INCLUDED)
function(get_package_version PACKAGE_VERSION PROJECT_VERSION)
find_package(Git)
if(GIT_FOUND AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/.git")
execute_process(COMMAND ${GIT_EXECUTABLE}
--git-dir=${CMAKE_CURRENT_LIST_DIR}/.git describe
--tags --match "v*" OUTPUT_VARIABLE OPUSFILE_PACKAGE_VERSION)
if(OPUSFILE_PACKAGE_VERSION)
string(STRIP ${OPUSFILE_PACKAGE_VERSION}, OPUSFILE_PACKAGE_VERSION)
string(REPLACE \n
""
OPUSFILE_PACKAGE_VERSION
${OPUSFILE_PACKAGE_VERSION})
string(REPLACE ,
""
OPUSFILE_PACKAGE_VERSION
${OPUSFILE_PACKAGE_VERSION})
string(SUBSTRING ${OPUSFILE_PACKAGE_VERSION}
1
-1
OPUSFILE_PACKAGE_VERSION)
message(STATUS "Opus package version from git repo: ${OPUSFILE_PACKAGE_VERSION}")
endif()
elseif(EXISTS "${CMAKE_CURRENT_LIST_DIR}/package_version"
AND NOT OPUSFILE_PACKAGE_VERSION)
# Not a git repo, lets' try to parse it from package_version file if exists
file(STRINGS package_version OPUSFILE_PACKAGE_VERSION
LIMIT_COUNT 1
REGEX "PACKAGE_VERSION=")
string(REPLACE "PACKAGE_VERSION="
""
OPUSFILE_PACKAGE_VERSION
${OPUSFILE_PACKAGE_VERSION})
string(REPLACE "\""
""
OPUSFILE_PACKAGE_VERSION
${OPUSFILE_PACKAGE_VERSION})
# In case we have a unknown dist here we just replace it with 0
string(REPLACE "unknown"
"0"
OPUSFILE_PACKAGE_VERSION
${OPUSFILE_PACKAGE_VERSION})
message(STATUS "Opus package version from package_version file: ${OPUSFILE_PACKAGE_VERSION}")
endif()
if(OPUSFILE_PACKAGE_VERSION)
string(REGEX
REPLACE "^([0-9]+.[0-9]+\\.?([0-9]+)?).*"
"\\1"
OPUSFILE_PROJECT_VERSION
${OPUSFILE_PACKAGE_VERSION})
else()
# fail to parse version from git and package version
message(WARNING "Could not get package version.")
set(OPUSFILE_PACKAGE_VERSION 0)
set(OPUSFILE_PROJECT_VERSION 0)
endif()
message(STATUS "Opus project version: ${OPUSFILE_PROJECT_VERSION}")
set(PACKAGE_VERSION ${OPUSFILE_PACKAGE_VERSION} PARENT_SCOPE)
set(PROJECT_VERSION ${OPUSFILE_PROJECT_VERSION} PARENT_SCOPE)
endfunction()
...@@ -34,7 +34,7 @@ dnl - interfaces added -> increment AGE ...@@ -34,7 +34,7 @@ dnl - interfaces added -> increment AGE
dnl - interfaces removed -> AGE = 0 dnl - interfaces removed -> AGE = 0
OP_LT_CURRENT=4 OP_LT_CURRENT=4
OP_LT_REVISION=2 OP_LT_REVISION=5
OP_LT_AGE=4 OP_LT_AGE=4
AC_SUBST(OP_LT_CURRENT) AC_SUBST(OP_LT_CURRENT)
...@@ -58,7 +58,7 @@ case $host in ...@@ -58,7 +58,7 @@ case $host in
host_mingw=true host_mingw=true
;; ;;
esac esac
AM_CONDITIONAL(OP_WIN32, test "$host_mingw" = "true") AM_CONDITIONAL(OP_WIN32, [test "$host_mingw" = "true"])
AC_ARG_ENABLE([assertions], AC_ARG_ENABLE([assertions],
AS_HELP_STRING([--enable-assertions], [Enable assertions in code]),, AS_HELP_STRING([--enable-assertions], [Enable assertions in code]),,
...@@ -72,21 +72,42 @@ AC_ARG_ENABLE([http], ...@@ -72,21 +72,42 @@ AC_ARG_ENABLE([http],
AS_HELP_STRING([--disable-http], [Disable HTTP support]),, AS_HELP_STRING([--disable-http], [Disable HTTP support]),,
enable_http=yes) enable_http=yes)
AM_COND_IF(OP_WIN32, AM_COND_IF(OP_WIN32, [
AS_IF([test "$enable_http" != "no"], AS_IF([test "$enable_http" != "no"], [
AC_CHECK_HEADER([winsock2.h],, AC_CHECK_HEADER([winsock2.h],, [
AC_MSG_WARN([HTTP support requires a Winsock socket library.]) AC_MSG_WARN([HTTP support requires a Winsock socket library.])
enable_http=no enable_http=no
) ])
), ])
AS_IF([test "$enable_http" != "no"], ], [
AC_CHECK_HEADER([sys/socket.h],, AS_IF([test "$enable_http" != "no"], [
AC_CHECK_HEADER([sys/socket.h],, [
AC_MSG_WARN([HTTP support requires a POSIX socket library.]) AC_MSG_WARN([HTTP support requires a POSIX socket library.])
enable_http=no enable_http=no
) ])
) ])
) ])
AC_SEARCH_LIBS(ftime, [compat], , [enable_http=no])
# HTTP support requires either clock_gettime or ftime. clock_gettime is
# used only if time.h defines CLOCK_REALTIME and the function is available
# in the standard library; on platforms such as glibc < 2.17 where -lrt
# or another library would be required, ftime will be used.
AS_IF([test "$enable_http" != "no"], [
AC_MSG_CHECKING([for clock_gettime])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[#include <time.h>]], [[
struct timespec ts;
return clock_gettime(CLOCK_REALTIME, &ts);
]])
], [
AC_MSG_RESULT([yes])
AC_DEFINE([OP_HAVE_CLOCK_GETTIME], [1],
[Enable use of clock_gettime function])
], [
AC_MSG_RESULT([no])
AC_SEARCH_LIBS(ftime, [compat], , [enable_http=no])
])
])
m4_ifndef([PKG_PROG_PKG_CONFIG], m4_ifndef([PKG_PROG_PKG_CONFIG],
[m4_fatal([Could not locate the pkg-config autoconf macros. [m4_fatal([Could not locate the pkg-config autoconf macros.
......
...@@ -18,3 +18,5 @@ SORT_MEMBER_DOCS = NO ...@@ -18,3 +18,5 @@ SORT_MEMBER_DOCS = NO
HAVE_DOT = @HAVE_DOT@ HAVE_DOT = @HAVE_DOT@
PROJECT_LOGO = @top_srcdir@/doc/opus_logo.svg PROJECT_LOGO = @top_srcdir@/doc/opus_logo.svg
FULL_PATH_NAMES = NO
...@@ -30,5 +30,6 @@ distclean: clean ...@@ -30,5 +30,6 @@ distclean: clean
Doxyfile: Doxyfile.in Makefile ../package_version Doxyfile: Doxyfile.in Makefile ../package_version
sed -e 's/@PACKAGE_NAME@/opusfile/' \ sed -e 's/@PACKAGE_NAME@/opusfile/' \
-e 's/@PACKAGE_VERSION@/$(PACKAGE_VERSION)/' \ -e 's/@PACKAGE_VERSION@/$(PACKAGE_VERSION)/' \
-e 's/@HAVE_DOT@/yes/' \
-e 's/@top_srcdir@/../' \ -e 's/@top_srcdir@/../' \
< $< > $@ < $< > $@
= Release checklist = # Release checklist
Source release: ## Source release
- Update OP_LT_* API versioning in configure.ac. - Update OP_LT_* API versioning in configure.ac.
- Check for uncommitted changes to master. - Check for uncommitted changes to master.
- Prepare win32 binaries
- Do this before tagging the release, as it may require changes which should
be committed
- Tag the release commit with 'git tag -s vN.M'. - Tag the release commit with 'git tag -s vN.M'.
- Include release notes in the tag annotation. - Include release notes in the tag annotation.
- Verify 'make distcheck' produces a tarball with - Verify 'make distcheck' produces a tarball with
...@@ -15,56 +18,41 @@ Source release: ...@@ -15,56 +18,41 @@ Source release:
- Update links on <https://www.opus-codec.org/downloads/>. - Update links on <https://www.opus-codec.org/downloads/>.
- Add a copy of the documentation to <https://www.opus-codec.org/docs/> - Add a copy of the documentation to <https://www.opus-codec.org/docs/>
and update the links. and update the links.
- Add doc/latex/refman as docs/opusfile_api-${version}.pdf on opus-codec.org
- Add doc/html as docs/opusfile_api-${version} on opus-codec.org
Releases are commited to https://svn.xiph.org/releases/opus/ Releases are commited to https://svn.xiph.org/releases/opus/
which propagates to downloads.xiph.org, and copied manually which propagates to downloads.xiph.org, and copied manually
to https://archive.mozilla.org/pub/opus/ to https://archive.mozilla.org/pub/opus/
Release notes and package links should be added to the corresponding
tag at https://gitlab.xiph.org/xiph/opusfile so they show on the
releases page.
Release packages should also be manually attached to the corresponding Release packages should also be manually attached to the corresponding
tag on the github mirror https://github.com/xiph/opusfile/releases tag on the github mirror https://github.com/xiph/opusfile/releases
Win32 binaries: ## Win32 binaries
- Assuming the mingw cross toolchain: - Install cross-i686-w64-mingw32-gcc and associated binutils.
- If you skip this step, libopus will still try to build with the system gcc
and then fail to link.
- Edit mingw/Makefile to point to the latest versions of libogg. opus, openssl
(see <https://archive.mozilla.org/pub/opus/>, checksums in SHA256SUMS.txt)
- run `make -C mingw` - run `make -C mingw`
- Downloads versions of libogg, opus, openssl. - Downloads versions of libogg, opus, openssl.
- Compiles them. - Compiles them.
- Compiles static opusfile and examples against the built deps. - Compiles static opusfile and examples against the built deps.
- Compile dynamic opusfile with: - run `make -C mingw package`
- ./configure --host=i686-w64-mingw32 --prefix=/path/to/builddir/mingw \ - Creates an opusfile-${version}-win32.zip binary package.
PKG_CONFIG_PATH=/path/to/builddir/mingw/lib/pkgconfig
- make && make check && make -C doc/latex
- Add api docs to opus-codec.org.
- mkdir opusfile-${version}-win32
- Copy AUTHORS COPYING README.md include/opusfile.h to the release dir.
- Merge changes between README.md and the version in the last - Merge changes between README.md and the version in the last
binary release. E.g. it's good to include versions of the dependencies, binary release. E.g. it's good to include versions of the dependencies,
release notes, etc. release notes, etc.
- Convert README.md to DOS line endings.
- Copy .libs/libopusfile-0.dll to the release dir.
- Copy .libs/libopusfile.a to the release dir.
- Copy .libs/libopusfile.dll.a to the release dir. (May not be needed?)
- Copy ./lib/libopusurl-0.dll, etc. to the release dir.
- Copy ./bin/*.dll to the release dir for dependencies.
- Copy any other dependent dlls, e.g. on Fedora 23 I needed to copy
/usr/i686-w64-mingw32/sys-root/mingw/bin/libgcc_s_sjlj-1.dll
/usr/i686-w64-mingw32/sys-root/mingw/bin/libwinpthread-1.dll
- Copy doc/latex/refman.pdf to opusfile-${version}-win32/opusfile-${version}.pdf
- Copy examples/.libs/*.exe to the release dir.
- Strip *.dll *.a *.exe in the release dir.
- In the release dir, run:
sha256sum * > SHA256SUMS.txt
gpg --detach-sign --armor SHA256SUMS.txt
- In the parent directory, create the archive:
zip -r opusfile-${version}-win32.zip opusfile-${version}-win32/*
- Copy the archive to a clean system and verify the examples work - Copy the archive to a clean system and verify the examples work
to make sure you've included all the necessary libraries. to make sure you've included all the necessary libraries.
- Upload the archive zipfile to websites. - Upload the archive zipfile to websites.
- Verify file permissions and that it's available at the expected - Verify file permissions and that it's available at the expected URL.
URL. - Update links on <https://www.opus-codec.org/downloads/>.
- Update links on <http://www.opus-codec.org/downloads/>.
- Add doc/latex/refman as docs/opusfile_api-${version}.pdf on opus-codec.org
- Add doc/html as docs/opusfile_api-${version} on opus-codec.org
Binary releases are copied manually to s3 to appear at Binary releases are copied manually to s3 to appear at
https://archive.mozilla.org/pub/mozilla.org/opus/win32/ https://archive.mozilla.org/pub/mozilla.org/opus/win32/
...@@ -5,10 +5,11 @@ ...@@ -5,10 +5,11 @@
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* * * *
* THE libopusfile SOURCE CODE IS (C) COPYRIGHT 1994-2012 * * THE libopusfile SOURCE CODE IS (C) COPYRIGHT 1994-2020 *
* by the Xiph.Org Foundation and contributors http://www.xiph.org/ * * by the Xiph.Org Foundation and contributors https://xiph.org/ *
* * * *
********************************************************************/ ********************************************************************/
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
......
...@@ -5,10 +5,11 @@ ...@@ -5,10 +5,11 @@
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* * * *
* THE libopusfile SOURCE CODE IS (C) COPYRIGHT 1994-2012 * * THE libopusfile SOURCE CODE IS (C) COPYRIGHT 1994-2020 *
* by the Xiph.Org Foundation and contributors http://www.xiph.org/ * * by the Xiph.Org Foundation and contributors https://xiph.org/ *
* * * *
********************************************************************/ ********************************************************************/
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
......
/********************************************************************
* *
* THIS FILE IS PART OF THE libopusfile SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE libopusfile SOURCE CODE IS (C) COPYRIGHT 1994-2020 *
* by the Xiph.Org Foundation and contributors https://xiph.org/ *
* *
********************************************************************/
#if defined(_WIN32) #if defined(_WIN32)
# include <stdio.h> # include <stdio.h>
# include <stdlib.h> # include <stdlib.h>
......
/********************************************************************
* *
* THIS FILE IS PART OF THE libopusfile SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE libopusfile SOURCE CODE IS (C) COPYRIGHT 1994-2020 *
* by the Xiph.Org Foundation and contributors https://xiph.org/ *
* *
********************************************************************/
#if !defined(_win32utf8_H) #if !defined(_win32utf8_H)
# define _win32utf8_H (1) # define _win32utf8_H (1)
# if defined(_WIN32) # if defined(_WIN32)
......