Disable JPEG codec support if not compiled in.

This commit is contained in:
Armin Novak 2017-07-24 15:23:36 +02:00
parent 1648deb435
commit dd4b5ea126
3 changed files with 14 additions and 1 deletions

View File

@ -34,7 +34,6 @@
#include <freerdp/codec/bitmap.h>
#include <freerdp/codec/rfx.h>
#include <freerdp/codec/jpeg.h>
#include "xf_graphics.h"
#include "xf_gdi.h"

View File

@ -136,8 +136,10 @@ static COMMAND_LINE_ARGUMENT_A args[] =
{ "rfx-mode", COMMAND_LINE_VALUE_REQUIRED, "<image|video>", NULL, NULL, -1, NULL, "RemoteFX mode" },
{ "frame-ack", COMMAND_LINE_VALUE_REQUIRED, "<number>", NULL, NULL, -1, NULL, "Number of frame acknowledgement" },
{ "nsc", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, "nscodec", "Enable NSCodec" },
#if defined(WITH_JPEG)
{ "jpeg", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "Enable JPEG codec" },
{ "jpeg-quality", COMMAND_LINE_VALUE_REQUIRED, "<percentage>", NULL, NULL, -1, NULL, "JPEG quality" },
#endif
{ "nego", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "Enable protocol security negotiation" },
{ "sec", COMMAND_LINE_VALUE_REQUIRED, "<rdp|tls|nla|ext>", NULL, NULL, -1, NULL, "force specific protocol security" },
{ "sec-rdp", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "rdp protocol security" },
@ -2179,6 +2181,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
{
settings->NSCodec = TRUE;
}
#if defined(WITH_JPEG)
CommandLineSwitchCase(arg, "jpeg")
{
settings->JpegCodec = TRUE;
@ -2188,6 +2191,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
{
settings->JpegQuality = atoi(arg->Value) % 100;
}
#endif
CommandLineSwitchCase(arg, "nego")
{
settings->NegotiateSecurityLayer = arg->Value ? TRUE : FALSE;
@ -2387,6 +2391,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
{
settings->NSCodec = TRUE;
}
#if defined(WITH_JPEG)
else if (strcmp(arg->Value, "jpeg") == 0)
{
settings->JpegCodec = TRUE;
@ -2394,6 +2399,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
if (settings->JpegQuality == 0)
settings->JpegQuality = 75;
}
#endif
}
CommandLineSwitchCase(arg, "fast-path")
{

View File

@ -114,6 +114,7 @@ static const GUID CODEC_GUID_IMAGE_REMOTEFX =
{ 0x80, 0x3C, 0x0E, 0xCB, 0xEE, 0xA1, 0x9C, 0x54 }
};
#if defined(WITH_JPEG)
/* CODEC_GUID_JPEG 0x430C9EED1BAF4CE6869ACB8B37B66237 */
static const GUID CODEC_GUID_JPEG =
@ -122,6 +123,7 @@ static const GUID CODEC_GUID_JPEG =
0x1BAF, 0x4CE6,
{ 0x86, 0x9A, 0xCB, 0x8B, 0x37, 0xB6, 0x62, 0x37 }
};
#endif
static void rdp_read_capability_set_header(wStream* s, UINT16* length,
UINT16* type)
@ -2953,6 +2955,7 @@ static BOOL rdp_write_nsc_client_capability_container(wStream* s,
return TRUE;
}
#if defined(WITH_JPEG)
static BOOL rdp_write_jpeg_client_capability_container(wStream* s,
rdpSettings* settings)
{
@ -2963,6 +2966,7 @@ static BOOL rdp_write_jpeg_client_capability_container(wStream* s,
Stream_Write_UINT8(s, settings->JpegQuality);
return TRUE;
}
#endif
/**
* Write RemoteFX Server Capability Container.\n
@ -3032,8 +3036,10 @@ static BOOL rdp_write_bitmap_codecs_capability_set(wStream* s,
if (settings->NSCodec)
bitmapCodecCount++;
#if defined(WITH_JPEG)
if (settings->JpegCodec)
bitmapCodecCount++;
#endif
if (settings->RemoteFxImageCodec)
bitmapCodecCount++;
@ -3080,6 +3086,7 @@ static BOOL rdp_write_bitmap_codecs_capability_set(wStream* s,
}
}
#if defined(WITH_JPEG)
if (settings->JpegCodec)
{
rdp_write_bitmap_codec_guid(s, &CODEC_GUID_JPEG); /* codecGUID */
@ -3099,6 +3106,7 @@ static BOOL rdp_write_bitmap_codecs_capability_set(wStream* s,
return FALSE;
}
}
#endif
if (settings->RemoteFxImageCodec)
{