Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sndio audiofilter #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ cmake_dependent_option(ENABLE_QSA "Enable QSA (QNX Sound Architecture) support."
cmake_dependent_option(ENABLE_OSS "Enable OSS support." NO "ENABLE_SOUND;LINUX_OR_BSD" NO)
cmake_dependent_option(ENABLE_PORTAUDIO "Enable portaudio native support." NO "ENABLE_SOUND" NO)
cmake_dependent_option(ENABLE_PULSEAUDIO "Enable pulseaudio support." YES "ENABLE_SOUND" NO)
cmake_dependent_option(ENABLE_SNDIO "Enable sndio support." YES "ENABLE_SOUND" NO)
option(ENABLE_G726 "Build mediastreamer2 with the G726 codec." NO)
option(ENABLE_GSM "Build mediastreamer2 with the GSM codec." YES)
option(ENABLE_BV16 "Build mediastreamer2 with the BV16 codec." YES)
Expand Down Expand Up @@ -228,6 +229,12 @@ endif()
if(ENABLE_PORTAUDIO)
find_package(PortAudio REQUIRED)
endif()
if(ENABLE_SNDIO)
find_library(SNDIO NAMES sndio)
if (SNDIO)
set(SNDIO_FOUND ON)
endif()
endif()
if(ENABLE_PULSEAUDIO)
find_package(PulseAudio)
if(NOT PULSEAUDIO_FOUND)
Expand Down Expand Up @@ -348,7 +355,7 @@ if(ENABLE_QNX)
endif()
endif()

if(ENABLE_SOUND AND NOT(WIN32 OR ENABLE_ALSA OR ENABLE_ARTSC OR ENABLE_MACSND OR ENABLE_MACAQSND OR ENABLE_OSS OR ENABLE_PORTAUDIO OR ENABLE_PULSEAUDIO OR ENABLE_QSA OR ENABLE_ANDROIDSND))
if(ENABLE_SOUND AND NOT(WIN32 OR ENABLE_ALSA OR ENABLE_ARTSC OR ENABLE_MACSND OR ENABLE_MACAQSND OR ENABLE_OSS OR ENABLE_PORTAUDIO OR ENABLE_PULSEAUDIO OR ENABLE_SNDIO OR ENABLE_QSA OR ENABLE_ANDROIDSND))
message(FATAL_ERROR "Could not find a support sound driver API. Use -DENABLE_SOUND=NO if you don't care about having sound.")
endif()

Expand Down Expand Up @@ -442,6 +449,10 @@ if(PULSEAUDIO_FOUND)
list(APPEND MEDIASTREAMER2_INCLUDE_DIRS ${PULSEAUDIO_INCLUDE_DIRS})
set(__PULSEAUDIO_ENABLED__ 1)
endif()
if(SNDIO_FOUND)
list(APPEND LINK_LIBS sndio)
set(__SNDIO_ENABLED__ 1)
endif()
if(QSA_FOUND)
list(APPEND LINK_LIBS ${QSA_LIBRARIES})
list(APPEND LINK_LIBS ${QNXAUDIOMANAGER_LIBRARIES})
Expand Down
2 changes: 2 additions & 0 deletions include/mediastreamer2/allfilters.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ typedef enum MSFilterId{
MS_ALSA_WRITE_ID,
MS_OSS_READ_ID,
MS_OSS_WRITE_ID,
MS_SNDIO_READ_ID,
MS_SNDIO_WRITE_ID,
MS_ULAW_ENC_ID,
MS_ULAW_DEC_ID,
MS_ALAW_ENC_ID,
Expand Down
1 change: 1 addition & 0 deletions mediastreamer-config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

#cmakedefine __ALSA_ENABLED__
#cmakedefine __ARTS_ENABLED__
#cmakedefine __SNDIO_ENABLED__
#cmakedefine __MACSND_ENABLED__
#cmakedefine __MAC_AQ_ENABLED__
#cmakedefine __PORTAUDIO_ENABLED__
Expand Down
3 changes: 3 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ endif()
if(ENABLE_PULSEAUDIO)
list(APPEND VOIP_SOURCE_FILES_C audiofilters/pulseaudio.c)
endif()
if(ENABLE_SNDIO)
list(APPEND VOIP_SOURCE_FILES_C audiofilters/sndio.c)
endif()
if(ENABLE_QSA)
list(APPEND VOIP_SOURCE_FILES_C audiofilters/qsa.c)
endif()
Expand Down
Loading