Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Image RemoteFX #58

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/rfxconstants.h → include/ms-rdprfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ enum _RLGR_MODE

/* properties.flags */
#define CODEC_MODE 0x02
#define CODEC_MODE_IMAGE CODEC_MODE
#define CODEC_MODE_VIDEO 0x00

/* properties.cct */
#define COL_CONV_ICT 0x1
Expand Down
4 changes: 2 additions & 2 deletions include/rfxcodec_encode.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ struct rfx_tile
};

void *
rfxcodec_encode_create(int width, int height, int format, int flags);
rfxcodec_encode_create(int width, int height, int format, int flags, int codec_mode);
int
rfxcodec_encode_create_ex(int width, int height, int format, int flags,
void **handle);
void **handle, int codec_mode);
int
rfxcodec_encode_destroy(void *handle);
/* quants, 5 ints per set, should be num_quants * 5 chars in quants)
Expand Down
1 change: 0 additions & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ noinst_HEADERS = \
rfx_bitstream.h \
rfxcommon.h \
rfxencode_compose.h \
rfxconstants.h \
rfxencode_alpha.h \
rfxencode_differential.h \
rfxencode_dwt.h \
Expand Down
13 changes: 8 additions & 5 deletions src/rfxencode.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "rfxcommon.h"
#include "rfxencode.h"
#include "rfxencode_compose.h"
#include "rfxconstants.h"
#include "ms-rdprfx.h"
#include "rfxencode_tile.h"
#include "rfxencode_rlgr1.h"
#include "rfxencode_rlgr3.h"
Expand All @@ -51,7 +51,7 @@
/******************************************************************************/
int
rfxcodec_encode_create_ex(int width, int height, int format, int flags,
void **handle)
void **handle, int codec_mode)
{
struct rfxencode *enc;
int ax;
Expand All @@ -65,6 +65,8 @@ rfxcodec_encode_create_ex(int width, int height, int format, int flags,
return 1;
}

enc->flags = (codec_mode == CODEC_MODE_IMAGE) ? CODEC_MODE_IMAGE : CODEC_MODE_VIDEO;

enc->dwt_buffer = (sint16 *) (((size_t) (enc->dwt_buffer_a)) & ~15);
enc->dwt_buffer1 = (sint16 *) (((size_t) (enc->dwt_buffer1_a)) & ~15);
enc->dwt_buffer2 = (sint16 *) (((size_t) (enc->dwt_buffer2_a)) & ~15);
Expand Down Expand Up @@ -285,12 +287,12 @@ rfxcodec_encode_create_ex(int width, int height, int format, int flags,

/******************************************************************************/
void *
rfxcodec_encode_create(int width, int height, int format, int flags)
rfxcodec_encode_create(int width, int height, int format, int flags, int codec_mode)
{
int error;
void *handle;

error = rfxcodec_encode_create_ex(width, height, format, flags, &handle);
error = rfxcodec_encode_create_ex(width, height, format, flags, &handle, codec_mode);
if (error == 0)
{
return handle;
Expand Down Expand Up @@ -363,7 +365,8 @@ rfxcodec_encode_ex(void *handle, char *cdata, int *cdata_bytes,
}

/* Only the first frame should send the RemoteFX header */
if ((enc->frame_idx == 0) && (enc->header_processed == 0))
if (enc->flags == CODEC_MODE_IMAGE ||
((enc->frame_idx == 0) && (enc->header_processed == 0)))
{
if (rfx_compose_message_header(enc, &s) != 0)
{
Expand Down
2 changes: 1 addition & 1 deletion src/rfxencode_alpha.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include "rfxcommon.h"
#include "rfxencode.h"
#include "rfxconstants.h"
#include "ms-rdprfx.h"
#include "rfxencode_tile.h"

#define LLOG_LEVEL 1
Expand Down
2 changes: 1 addition & 1 deletion src/rfxencode_compose.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include "rfxcommon.h"
#include "rfxencode.h"
#include "rfxconstants.h"
#include "ms-rdprfx.h"
#include "rfxencode_tile.h"

#include "rfxencode_quantization.h"
Expand Down
2 changes: 1 addition & 1 deletion src/rfxencode_differential.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include "rfxcommon.h"
#include "rfxencode.h"
#include "rfxconstants.h"
#include "ms-rdprfx.h"

/******************************************************************************/
int
Expand Down
2 changes: 1 addition & 1 deletion src/rfxencode_quantization.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#include "rfxcommon.h"
#include "rfxencode.h"
#include "rfxconstants.h"
#include "ms-rdprfx.h"

#if 0
/******************************************************************************/
Expand Down
2 changes: 1 addition & 1 deletion src/rfxencode_rgb_to_yuv.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include "rfxcommon.h"
#include "rfxencode.h"
#include "rfxconstants.h"
#include "ms-rdprfx.h"
#include "rfxencode_tile.h"
#include "rfxencode_dwt.h"
#include "rfxencode_quantization.h"
Expand Down
2 changes: 1 addition & 1 deletion src/rfxencode_tile.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include "rfxcommon.h"
#include "rfxencode.h"
#include "rfxconstants.h"
#include "ms-rdprfx.h"
#include "rfxencode_tile.h"
#include "rfxencode_dwt.h"
#include "rfxencode_dwt_rem.h"
Expand Down