added cmake option to compile jpeg, off by default
This commit is contained in:
parent
317fb28c7e
commit
c3e9966429
@ -3,6 +3,7 @@ option(WITH_NEON "Enable NEON optimization for rfx decoder" OFF)
|
||||
option(WITH_PROFILER "Compile profiler." OFF)
|
||||
option(WITH_SSE2_TARGET "Allow compiler to generate SSE2 instructions." OFF)
|
||||
option(WITH_SSE2 "Use SSE2 optimization." OFF)
|
||||
option(WITH_JPEG "Use JPEG decoding." OFF)
|
||||
|
||||
option(WITH_DEBUG_CERTIFICATE "Print certificate related debug messages." OFF)
|
||||
option(WITH_DEBUG_CHANNELS "Print channel manager debug messages." OFF)
|
||||
|
@ -25,6 +25,7 @@
|
||||
#cmakedefine WITH_PROFILER
|
||||
#cmakedefine WITH_SSE2
|
||||
#cmakedefine WITH_NEON
|
||||
#cmakedefine WITH_JPEG
|
||||
|
||||
/* Debug */
|
||||
#cmakedefine WITH_DEBUG_CERTIFICATE
|
||||
|
@ -65,10 +65,13 @@ if(WITH_NEON)
|
||||
set_property(SOURCE rfx_neon.c PROPERTY COMPILE_FLAGS "-mfpu=neon -mfloat-abi=softfp")
|
||||
endif()
|
||||
|
||||
if(WITH_JPEG)
|
||||
set(FREERDP_JPEG_LIBS jpeg)
|
||||
endif()
|
||||
|
||||
add_library(freerdp-codec ${FREERDP_CODEC_SRCS})
|
||||
|
||||
set_target_properties(freerdp-codec PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")
|
||||
target_link_libraries(freerdp-codec freerdp-utils jpeg)
|
||||
target_link_libraries(freerdp-codec freerdp-utils ${FREERDP_JPEG_LIBS})
|
||||
|
||||
install(TARGETS freerdp-codec DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
|
||||
|
@ -17,10 +17,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <freerdp/utils/stream.h>
|
||||
#include <freerdp/utils/memory.h>
|
||||
#include <freerdp/codec/color.h>
|
||||
|
||||
#ifdef WITH_JPEG
|
||||
|
||||
#define HAVE_BOOLEAN
|
||||
#include <jpeglib.h>
|
||||
|
||||
@ -63,7 +66,7 @@ static void my_term_source(j_decompress_ptr cinfo)
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
int
|
||||
static int
|
||||
do_decompress(char* comp_data, int comp_data_bytes,
|
||||
int* width, int* height, int* bpp,
|
||||
char* decomp_data, int* decomp_data_bytes)
|
||||
@ -139,3 +142,13 @@ jpeg_decompress(uint8 * input, uint8 * output, int width, int height, int size,
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
boolean
|
||||
jpeg_decompress(uint8 * input, uint8 * output, int width, int height, int size, int bpp)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -92,8 +92,10 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
|
||||
" --rfx: enable RemoteFX\n"
|
||||
" --rfx-mode: RemoteFX operational flags (v[ideo], i[mage]), default is video\n"
|
||||
" --nsc: enable NSCodec (experimental)\n"
|
||||
#ifdef WITH_JPEG
|
||||
" --jpeg: enable jpeg codec, uses 75 quality\n"
|
||||
" --jpegex: enable jpeg and set quality(1..99)\n"
|
||||
#endif
|
||||
" --disable-wallpaper: disables wallpaper\n"
|
||||
" --composition: enable desktop composition\n"
|
||||
" --disable-full-window-drag: disables full window drag\n"
|
||||
@ -369,12 +371,20 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
|
||||
printf("setting codec nsc\n");
|
||||
settings->v3_codec_id = CODEC_ID_NSCODEC;
|
||||
}
|
||||
#ifdef WITH_JPEG
|
||||
else if (strcmp("jpeg", argv[index]) == 0)
|
||||
{
|
||||
printf("setting codec jpeg\n");
|
||||
settings->v3_codec_id = CODEC_ID_JPEG;
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
printf("bad codec name\n");
|
||||
return FREERDP_ARGS_PARSE_FAILURE;
|
||||
}
|
||||
}
|
||||
#ifdef WITH_JPEG
|
||||
else if (strcmp("--jpeg", argv[index]) == 0)
|
||||
{
|
||||
settings->jpeg_codec = true;
|
||||
@ -391,6 +401,7 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
|
||||
settings->jpeg_codec = true;
|
||||
settings->jpeg_quality = atoi(argv[index]);
|
||||
}
|
||||
#endif
|
||||
else if (strcmp("--rfx", argv[index]) == 0)
|
||||
{
|
||||
settings->rfx_codec = true;
|
||||
|
Loading…
Reference in New Issue
Block a user