2024-06-11 10:30:18 +03:00
|
|
|
# codec
|
|
|
|
|
|
|
|
set(CODEC_SRCS
|
|
|
|
bulk.c
|
|
|
|
bulk.h
|
|
|
|
dsp.c
|
|
|
|
color.c
|
2024-06-11 10:51:29 +03:00
|
|
|
color.h
|
2024-06-11 10:30:18 +03:00
|
|
|
audio.c
|
|
|
|
planar.c
|
|
|
|
bitmap.c
|
|
|
|
interleaved.c
|
|
|
|
progressive.c
|
|
|
|
rfx_bitstream.h
|
|
|
|
rfx_constants.h
|
|
|
|
rfx_decode.c
|
|
|
|
rfx_decode.h
|
|
|
|
rfx_differential.h
|
|
|
|
rfx_dwt.c
|
|
|
|
rfx_dwt.h
|
|
|
|
rfx_encode.c
|
|
|
|
rfx_encode.h
|
|
|
|
rfx_quantization.c
|
|
|
|
rfx_quantization.h
|
|
|
|
rfx_rlgr.c
|
|
|
|
rfx_rlgr.h
|
|
|
|
rfx_types.h
|
|
|
|
rfx.c
|
|
|
|
region.c
|
|
|
|
nsc.c
|
|
|
|
nsc_encode.c
|
|
|
|
nsc_encode.h
|
|
|
|
nsc_types.h
|
|
|
|
ncrush.c
|
|
|
|
xcrush.c
|
|
|
|
mppc.c
|
|
|
|
zgfx.c
|
|
|
|
clear.c
|
|
|
|
jpeg.c
|
|
|
|
h264.c
|
|
|
|
yuv.c)
|
|
|
|
|
|
|
|
set(CODEC_SSE2_SRCS
|
2024-06-11 10:47:22 +03:00
|
|
|
sse/rfx_sse2.c
|
|
|
|
sse/rfx_sse2.h
|
|
|
|
sse/nsc_sse2.c
|
|
|
|
sse/nsc_sse2.h
|
2024-06-11 10:30:18 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
set(CODEC_NEON_SRCS
|
2024-06-11 10:47:22 +03:00
|
|
|
neon/rfx_neon.c
|
|
|
|
neon/rfx_neon.h
|
|
|
|
neon/nsc_neon.c
|
|
|
|
neon/nsc_neon.h
|
2024-06-11 10:30:18 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
# Append initializers
|
|
|
|
set(CODEC_LIBS "")
|
|
|
|
list(APPEND CODEC_SRCS ${CODEC_SSE2_SRCS})
|
|
|
|
list(APPEND CODEC_SRCS ${CODEC_NEON_SRCS})
|
|
|
|
|
2024-06-25 10:08:54 +03:00
|
|
|
include(CompilerDetect)
|
2024-07-04 14:25:40 +03:00
|
|
|
include (DetectIntrinsicSupport)
|
2024-06-25 10:08:54 +03:00
|
|
|
|
2024-06-11 10:30:18 +03:00
|
|
|
if(WITH_SSE2)
|
2024-07-04 10:32:55 +03:00
|
|
|
|
2024-07-09 19:11:38 +03:00
|
|
|
if (HAVE_SSE_OR_AVX)
|
2024-06-25 10:08:54 +03:00
|
|
|
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
|
2024-06-11 10:30:18 +03:00
|
|
|
if (CODEC_SSE2_SRCS)
|
|
|
|
set_source_files_properties(${CODEC_SSE2_SRCS} PROPERTIES COMPILE_FLAGS "-msse2" )
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
if (CODEC_SSE2_SRCS)
|
|
|
|
set_source_files_properties(${CODEC_SSE2_SRCS} PROPERTIES COMPILE_FLAGS "/arch:SSE2" )
|
|
|
|
endif()
|
2024-07-04 10:32:55 +03:00
|
|
|
endif()
|
|
|
|
endif()
|
2024-06-11 10:30:18 +03:00
|
|
|
endif()
|
|
|
|
if(WITH_NEON)
|
2024-07-05 10:44:45 +03:00
|
|
|
# aarch64 requires NEON by default, no flag required
|
|
|
|
if (HAVE_NEON AND NOT HAVE_NEON64)
|
2024-07-04 10:32:55 +03:00
|
|
|
if (CODEC_SSE2_SRCS)
|
|
|
|
set_source_files_properties(${CODEC_NEON_SRCS} PROPERTIES COMPILE_FLAGS "-mfpu=neon" )
|
|
|
|
endif()
|
|
|
|
endif()
|
2024-06-11 10:30:18 +03:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if (WITH_DSP_FFMPEG)
|
|
|
|
set(CODEC_SRCS
|
|
|
|
${CODEC_SRCS}
|
|
|
|
dsp_ffmpeg.c
|
|
|
|
dsp_ffmpeg.h)
|
2024-08-26 12:01:54 +03:00
|
|
|
include_directories(SYSTEM ${FFMPEG_INCLUDE_DIRS})
|
2024-06-11 10:30:18 +03:00
|
|
|
list(APPEND CODEC_LIBS ${FFMPEG_LIBRARIES})
|
|
|
|
endif (WITH_DSP_FFMPEG)
|
|
|
|
|
|
|
|
if (WITH_SOXR)
|
|
|
|
list(APPEND CODEC_LIBS ${SOXR_LIBRARIES})
|
2024-08-26 12:01:54 +03:00
|
|
|
include_directories(SYSTEM ${SOXR_INCLUDE_DIR})
|
2024-06-11 10:30:18 +03:00
|
|
|
endif(WITH_SOXR)
|
|
|
|
|
|
|
|
if(GSM_FOUND)
|
|
|
|
list(APPEND CODEC_LIBS ${GSM_LIBRARIES})
|
2024-08-26 12:01:54 +03:00
|
|
|
include_directories(SYSTEM ${GSM_INCLUDE_DIRS})
|
2024-06-11 10:30:18 +03:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(LAME_FOUND)
|
|
|
|
list(APPEND CODEC_LIBS ${LAME_LIBRARIES})
|
2024-08-26 12:01:54 +03:00
|
|
|
include_directories(SYSTEM ${LAME_INCLUDE_DIRS})
|
2024-06-11 10:30:18 +03:00
|
|
|
endif()
|
|
|
|
|
2024-07-10 15:28:26 +03:00
|
|
|
if (WITH_FDK_AAC)
|
|
|
|
list(APPEND CODEC_SRCS
|
|
|
|
dsp_fdk_impl.c
|
|
|
|
dsp_fdk_impl.h
|
|
|
|
dsp_fdk_aac.c
|
|
|
|
dsp_fdk_aac.h)
|
|
|
|
endif()
|
|
|
|
|
2024-06-11 10:30:18 +03:00
|
|
|
if(FAAD2_FOUND)
|
|
|
|
list(APPEND CODEC_LIBS ${FAAD2_LIBRARIES})
|
2024-08-26 12:01:54 +03:00
|
|
|
include_directories(SYSTEM ${FAAD2_INCLUDE_DIRS})
|
2024-06-11 10:30:18 +03:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(FAAC_FOUND)
|
|
|
|
list(APPEND CODEC_LIBS ${FAAC_LIBRARIES})
|
2024-08-26 12:01:54 +03:00
|
|
|
include_directories(SYSTEM ${FAAC_INCLUDE_DIRS})
|
2024-06-11 10:30:18 +03:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_OPENH264)
|
|
|
|
set(CODEC_SRCS ${CODEC_SRCS} h264_openh264.c)
|
2024-08-26 12:01:54 +03:00
|
|
|
include_directories(SYSTEM ${OPENH264_INCLUDE_DIR})
|
2024-06-11 10:30:18 +03:00
|
|
|
if (NOT WITH_OPENH264_LOADING)
|
|
|
|
list(APPEND CODEC_LIBS ${OPENH264_LIBRARIES})
|
|
|
|
endif (NOT WITH_OPENH264_LOADING)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_VIDEO_FFMPEG)
|
|
|
|
set(CODEC_SRCS ${CODEC_SRCS} h264_ffmpeg.c)
|
2024-08-26 12:01:54 +03:00
|
|
|
include_directories(SYSTEM ${FFMPEG_INCLUDE_DIRS})
|
2024-06-11 10:30:18 +03:00
|
|
|
list(APPEND CODEC_LIBS ${FFMPEG_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WIN32 AND WITH_MEDIA_FOUNDATION)
|
|
|
|
set(CODEC_SRCS ${CODEC_SRCS} h264_mf.c)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ANDROID AND WITH_MEDIACODEC)
|
|
|
|
list(APPEND CODEC_SRCS h264_mediacodec.c)
|
|
|
|
|
|
|
|
find_library(MEDIACODEC mediandk REQUIRED)
|
|
|
|
list(APPEND CODEC_LIBS ${MEDIACODEC})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_library(freerdp-codecs OBJECT
|
|
|
|
${CODEC_SRCS}
|
|
|
|
)
|
|
|
|
freerdp_library_add(${CODEC_LIBS})
|
|
|
|
freerdp_object_library_add(freerdp-codecs)
|
|
|
|
|
|
|
|
if(BUILD_TESTING)
|
|
|
|
add_subdirectory(test)
|
|
|
|
endif()
|