Commit a070fcaf authored by Peio Rigaux's avatar Peio Rigaux

reverted const buffer hack as it is now fixed by allowing unused link options...

reverted const buffer hack as it is now fixed by allowing unused link options given to the compiler for check_compile. Previsouly, the use cont buffer valuer was not defined because the check_compile related to stricmp and strnicmp suceeded as a false positive (i.e they were marked as found while not being found)
parent 7bc491fd
......@@ -47,6 +47,10 @@ if(TURBOJPEG_INCLUDE_DIRS AND TURBOJPEG_LIBRARIES AND NOT MSVC)
list(APPEND CMAKE_REQUIRED_INCLUDES ${TURBOJPEG_INCLUDE_DIRS})
list(APPEND CMAKE_REQUIRED_LIBRARIES ${TURBOJPEG_LIBRARIES})
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror")
if(CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Wno-error=unused-command-line-argument")
endif()
check_c_source_compiles("
#include <turbojpeg.h>
int main(int argc, char *argv[]) {
......
......@@ -468,9 +468,9 @@ static void video_capture_detect(MSWebCamManager *obj){
}
char *idstring = bctbx_strdup_printf("%sFacingCamera%d", facing, c->id);
cam->id = ms_strdup(idstring);
bctbx_free(idstring);
ms_web_cam_manager_add_cam(obj,cam);
ms_message("camera created: id=%d frontFacing=%d orientation=%d [msid:%s]\n", c->id, c->frontFacing, c->orientation, idstring);
bctbx_free(idstring);
}
env->DeleteLocalRef(indexes);
env->DeleteLocalRef(frontFacing);
......
......@@ -123,6 +123,13 @@ static void jpg_process(MSFilter *f) {
error = tjCompressFromYUVPlanes(
s->turboJpeg,
//This define has the purpose to support multiple versions of turboJPEG.
//The related value is set by the check_compile in the cmake/FindTurboJPEG.cmake
//Here we may have an "incompatible pointer type" build warning treated as an error (build with sanitizer)
//in the else block. If this is the case, check the CMakeError.log of TurboJPEG and ms2
#ifdef TURBOJPEG_USE_CONST_BUFFERS
(const unsigned char **)yuvbuf.planes,
#else
......
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