Skip to content

Commit

Permalink
Enabling RFX_PRO key frame handling.
Browse files Browse the repository at this point in the history
 - Also update librfxcodec
  • Loading branch information
Nexarian committed Jan 22, 2024
1 parent 51fedcb commit b494c04
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
1 change: 0 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
url = https://github.com/neutrinolabs/librfxcodec.git
branch = .
ignore = untracked

[submodule "libpainter"]
path = libpainter
url = https://github.com/neutrinolabs/libpainter.git
Expand Down
27 changes: 19 additions & 8 deletions xrdp/xrdp_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,8 @@ process_enc_rfx(struct xrdp_encoder *self, XRDP_ENC_DATA *enc)
struct rfx_tile *tiles;
struct rfx_rect *rfxrects;
int alloc_bytes;
int encode_flags;
int encode_passes;

LOG_DEVEL(LOG_LEVEL_DEBUG, "process_enc_rfx:");
LOG_DEVEL(LOG_LEVEL_DEBUG, "process_enc_rfx: num_crects %d num_drects %d",
Expand All @@ -372,6 +374,7 @@ process_enc_rfx(struct xrdp_encoder *self, XRDP_ENC_DATA *enc)
event_processed = self->xrdp_encoder_event_processed;

all_tiles_written = 0;
encode_passes = 0;
do
{
tiles_written = 0;
Expand Down Expand Up @@ -423,15 +426,23 @@ process_enc_rfx(struct xrdp_encoder *self, XRDP_ENC_DATA *enc)
}

out_data_bytes = self->max_compressed_bytes;
tiles_written = rfxcodec_encode(self->codec_handle,
out_data + XRDP_SURCMD_PREFIX_BYTES,
&out_data_bytes, enc->data,
enc->width, enc->height,
enc->width * 4,
rfxrects, enc->num_drects,
tiles, enc->num_crects,
self->quants, self->num_quants);

encode_flags = 0;
if (((int)enc->flags & KEY_FRAME_REQUESTED) && encode_passes == 0)
{
encode_flags = RFX_FLAGS_PRO_KEY;
}
tiles_written = rfxcodec_encode_ex(self->codec_handle,
out_data + XRDP_SURCMD_PREFIX_BYTES,
&out_data_bytes, enc->data,
enc->width, enc->height,
enc->width * 4,
rfxrects, enc->num_drects,
tiles, enc->num_crects,
self->quants, self->num_quants,
encode_flags);
}
++encode_passes;
}

LOG_DEVEL(LOG_LEVEL_DEBUG,
Expand Down

0 comments on commit b494c04

Please sign in to comment.