Commit 5faf018f authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Changes to build Android Camera2 capture plugin

parent 883a2173
......@@ -53,6 +53,9 @@ endif()
if (ENABLE_AAUDIO)
lcb_dependencies("msaaudio")
endif()
if (ENABLE_CAMERA2)
lcb_dependencies("msandroidcamera2")
endif()
if (ENABLE_ELPH264)
lcb_dependencies("mselph264")
endif()
############################################################################
# msandroidcamera2.cmake
# Copyright (C) 2019 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
############################################################################
lcb_git_repository("https://gitlab.linphone.org/BC/public/msandroidcamera2.git")
lcb_git_tag_latest("master")
lcb_git_tag("master")
lcb_external_source_paths("msandroidcamera2")
lcb_groupable(YES)
lcb_sanitizable(YES)
lcb_plugin(YES)
lcb_dependencies("ms2")
lcb_cmake_options(
"-DENABLE_CAMERA2=${ENABLE_CAMERA2}"
)
......@@ -55,7 +55,9 @@ set(DEFAULT_VALUE_ENABLE_ZRTP ON)
set(DEFAULT_VALUE_ENABLE_TOOLS OFF)
set(ENABLE_NLS NO CACHE BOOL "" FORCE)
set(DEFAULT_VALUE_ENABLE_ASSETS ON)
set(DEFAULT_VALUE_ENABLE_AAUDIO OFF)
set(DEFAULT_VALUE_ENABLE_CAMERA2 OFF)
if ((NOT DEFINED CMAKE_INSTALL_PREFIX) OR CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/linphone-sdk/desktop" CACHE PATH "Default linphone-sdk installation prefix" FORCE)
endif()
endif()
\ No newline at end of file
......@@ -66,6 +66,7 @@ lcb_add_strict_dependent_option("OpenH264" "H.264 video encoding/decoding suppor
lcb_add_dependent_option("VPX" "VPX (VP8) video encoding/decoding support." "${DEFAULT_VALUE_ENABLE_VPX}" "ENABLE_VIDEO" OFF)
lcb_add_strict_dependent_option("X264" "H.264 video encoding support with the x264 library (require license)." OFF "ENABLE_VIDEO;ENABLE_GPL_THIRD_PARTIES;ENABLE_UNMAINTAINED" OFF "ENABLE_NON_FREE_CODECS" "non free codecs option not enabled (ENABLE_NON_FREE_CODECS).")
lcb_add_option("AAudio" "AAudio Android sound card for Android 8+." "${DEFAULT_VALUE_ENABLE_AAUDIO}")
lcb_add_option("Camera2" "Android capture filter using Camera2 API for Android 8+" "${DEFAULT_VALUE_ENABLE_CAMERA2}")
# Other options
lcb_add_option("PCAP" "PCAP support." "${DEFAULT_VALUE_ENABLE_PCAP}")
......@@ -34,16 +34,22 @@ string(REGEX MATCH "Pkg\\.Revision = ([0-9]+)\\.([0-9]+)\\." NDK_VERSION_MATCH "
set(CMAKE_ANDROID_NDK_VERSION ${CMAKE_MATCH_1})
set(CMAKE_ANDROID_NDK_VERSION_MINOR ${CMAKE_MATCH_2})
if(ENABLE_AAUDIO)
set(ANDROID_NATIVE_API_LEVEL "android-28")
else()
if(CMAKE_ANDROID_NDK_VERSION VERSION_LESS 19)
set(ANDROID_NATIVE_API_LEVEL "android-17")
if(NOT ANDROID_NATIVE_API_LEVEL)
if(ENABLE_AAUDIO)
set(ANDROID_NATIVE_API_LEVEL "android-28")
elseif(ENABLE_CAMERA2)
# android-26 is required if using capture filter included preview display, otherwise android-24 is enough
set(ANDROID_NATIVE_API_LEVEL "android-24")
else()
# Starting with NDK 19, API 17 no longer exists
set(ANDROID_NATIVE_API_LEVEL "android-21")
if(CMAKE_ANDROID_NDK_VERSION VERSION_LESS 19)
set(ANDROID_NATIVE_API_LEVEL "android-17")
else()
# Starting with NDK 19, API 17 no longer exists
set(ANDROID_NATIVE_API_LEVEL "android-21")
endif()
endif()
endif()
set(ANDROID_CPP_FEATURES "rtti exceptions")
set(ANDROID_STL "c++_shared")
......@@ -69,4 +75,4 @@ set(CMAKE_C_FLAGS_RELWITHDEBINFO "-Os -g -DNDEBUG")
set(CMAKE_C_FLAGS_ASAN "-fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls")
set(CMAKE_CXX_FLAGS_ASAN "-fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls")
set(CMAKE_SHARED_LINKER_FLAGS_ASAN "-fsanitize=address")
\ No newline at end of file
set(CMAKE_SHARED_LINKER_FLAGS_ASAN "-fsanitize=address")
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