Commit 96d06968 authored by François Grisez's avatar François Grisez

Adds support of MKV with CMake on Linux

parent 9e52f7f1
......@@ -93,6 +93,7 @@ cmake_dependent_option(ENABLE_X11 "Enable X11 support." ${ENABLE_X11_DEFAULT_VAL
cmake_dependent_option(ENABLE_XV "Enable XV support." ${ENABLE_X11_DEFAULT_VALUE} "ENABLE_FFMPEG;UNIX" NO)
cmake_dependent_option(ENABLE_THEORA "Enable theora video codec support." YES "ENABLE_VIDEO" NO)
cmake_dependent_option(ENABLE_VPX "Build mediastreamer2 with VPX codec." YES "ENABLE_VIDEO" NO)
option(ENABLE_MKV "Enable support of MKV files reading and writing." YES)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
......@@ -251,6 +252,12 @@ if(ENABLE_VPX)
set(ENABLE_VPX OFF CACHE BOOL "Build mediastreamer2 with VPX codec." FORCE)
endif()
endif()
if(ENABLE_MKV)
find_package(Matroska2)
if(NOT MATROSKA2_FOUND)
set(ENABLE_MKV OFF CACHE BOOL "Enable support of MKV files reading and writing." FORCE)
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))
......@@ -322,6 +329,9 @@ endif()
if(VPX_FOUND)
include_directories(${VPX_INCLUDE_DIRS})
endif()
if(MATROSKA2_FOUND)
include_directories(${MATROSKA2_INCLUDE_DIRS})
endif()
if(MSVC)
include_directories(${MSVC_INCLUDE_DIR})
endif()
......@@ -374,6 +384,9 @@ endif()
if(SPEEX_FOUND)
set(HAVE_SPEEXDSP 1)
endif()
if(MATROSKA2_FOUND)
set(HAVE_MATROSKA 1)
endif()
if(ENABLE_RELATIVE_PREFIX)
set(PACKAGE_PLUGINS_DIR "./lib/mediastreamer/plugins")
set(PACKAGE_DATA_DIR "./share")
......
......@@ -67,3 +67,4 @@
#cmakedefine HAVE_LINUX_VIDEODEV2_H 1
#cmakedefine HAVE_POLARSSL_SSL_H 1
#cmakedefine HAVE_PCAP 1
#cmakedefine HAVE_MATROSKA 1
......@@ -295,6 +295,12 @@ if(ENABLE_VIDEO)
voip/vp8rtpfmt.h
)
endif()
if(MATROSKA2_FOUND)
list(APPEND VOIP_SOURCE_FILES
videofilters/mkv.c
utils/mkv_reader.c
)
endif()
if(X11_FOUND)
list(APPEND VOIP_SOURCE_FILES utils/x11_helper.c)
endif()
......@@ -410,6 +416,9 @@ endif()
if(VPX_FOUND)
list(APPEND VOIP_LIBS ${VPX_LIBRARIES})
endif()
if(MATROSKA2_FOUND)
list(APPEND VOIP_LIBS ${MATROSKA2_LIBRARIES})
endif()
if(ENABLE_STATIC)
add_library(mediastreamer_voip STATIC ${VOIP_SOURCE_FILES} ${VOIP_GENERATED_SOURCE_FILES})
......
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