Commit 7451aeb8 authored by Ghislain MARY's avatar Ghislain MARY

Activate compilation of opus filter on windows with cmake.

parent cd4838bc
cmake_minimum_required(VERSION 2.6)
project(MEDIASTREAMER2 C)
option(MS2_ENABLE_OPUS "Build mediastreamer2 with the OPUS codec." ON)
if(NOT ORTP_ROOT_DIR)
set(ORTP_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../oRTP)
endif()
......@@ -22,6 +24,10 @@ include_directories(
if(USE_INSTALLED_COMPONENTS)
include_directories(${CMAKE_INSTALL_PREFIX}/include)
if(MS2_ENABLE_OPUS)
include_directories(${CMAKE_INSTALL_PREFIX}/include/opus)
find_library(LIBOPUS libopus.lib PATHS ${CMAKE_INSTALL_PREFIX}/lib)
endif(MS2_ENABLE_OPUS)
else()
include_directories(
${ORTP_INCLUDE_DIR}
......
......@@ -122,6 +122,10 @@ set(VOIP_SOURCE_FILES
voip/rfc3984.c
)
if(MS2_ENABLE_OPUS)
set(VOIP_SOURCE_FILES ${VOIP_SOURCE_FILES} audiofilters/msopus.c)
endif(MS2_ENABLE_OPUS)
set(VOIP_GENERATED_SOURCE_FILES
${CMAKE_CURRENT_BINARY_DIR}/voipdescs.h
)
......@@ -151,6 +155,9 @@ if(WIN32)
set(VOIP_LIBS ws2_32 ole32 oleaut32 winmm uuid)
endif(WIN32)
set(VOIP_LIBS ${VOIP_LIBS} libortp libmediastreamer_base libspeex libspeexdsp)
if(MS2_ENABLE_OPUS)
set(VOIP_LIBS ${VOIP_LIBS} ${LIBOPUS})
endif(MS2_ENABLE_OPUS)
add_library(libmediastreamer_voip SHARED ${VOIP_SOURCE_FILES} ${VOIP_GENERATED_SOURCE_FILES})
set_target_properties(libmediastreamer_voip PROPERTIES VERSION 2.9.2 SOVERSION 3)
......
......@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "mediastreamer2/msticker.h"
#include "ortp/rtp.h"
#include <stdint.h>
#include <opus.h>
#define SIGNAL_SAMPLE_SIZE 2 // 2 bytes per sample
......@@ -679,8 +679,8 @@ static void ms_opus_dec_process(MSFilter *f) {
/* Concealment if needed */
if (ms_concealer_context_is_concealement_required(d->concealer, f->ticker->time)) {
int imLength = 0;
im = NULL;
uint8_t *payload = NULL;
im = NULL;
// try fec : info are stored in the next packet, do we have it?
if (d->rtp_picker_context.picker) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment