static int shadow_encoder_init_nsc(rdpShadowEncoder* encoder) { rdpContext* context = (rdpContext*) encoder->client; rdpSettings* settings = context->settings; if (!encoder->nsc) encoder->nsc = nsc_context_new(); if (!encoder->nsc) goto fail; if (!nsc_context_reset(encoder->nsc, encoder->width, encoder->height)) goto fail; encoder->nsc->ColorLossLevel = settings->NSCodecColorLossLevel; encoder->nsc->ChromaSubsamplingLevel = settings->NSCodecAllowSubsampling ? 1 : 0; encoder->nsc->DynamicColorFidelity = settings->NSCodecAllowDynamicColorFidelity; nsc_context_set_pixel_format(encoder->nsc, PIXEL_FORMAT_BGRX32); encoder->codecs |= FREERDP_CODEC_NSCODEC; return 1; fail: nsc_context_free(encoder->nsc); return -1; }
BOOL freerdp_client_codecs_reset(rdpCodecs* codecs, UINT32 flags, UINT32 width, UINT32 height) { BOOL rc = TRUE; if (!freerdp_client_codecs_prepare(codecs, flags)) return FALSE; if (flags & FREERDP_CODEC_INTERLEAVED) { if (codecs->interleaved) { rc &= bitmap_interleaved_context_reset(codecs->interleaved); } } if (flags & FREERDP_CODEC_PLANAR) { if (codecs->planar) { rc &= freerdp_bitmap_planar_context_reset(codecs->planar); } } if (flags & FREERDP_CODEC_NSCODEC) { if (codecs->nsc) { rc &= nsc_context_reset(codecs->nsc, width, height); } } if (flags & FREERDP_CODEC_REMOTEFX) { if (codecs->rfx) { rc &= rfx_context_reset(codecs->rfx, width, height); } } if (flags & FREERDP_CODEC_CLEARCODEC) { if (codecs->clear) { rc &= clear_context_reset(codecs->clear); } } if (flags & FREERDP_CODEC_ALPHACODEC) { } if (flags & FREERDP_CODEC_PROGRESSIVE) { if (codecs->progressive) { rc &= progressive_context_reset(codecs->progressive); } } if (flags & (FREERDP_CODEC_AVC420 | FREERDP_CODEC_AVC444)) { if (codecs->h264) { rc &= h264_context_reset(codecs->h264, width, height); } } return rc; }
BOOL freerdp_client_codecs_reset(rdpCodecs* codecs, UINT32 flags) { if (flags & FREERDP_CODEC_INTERLEAVED) { if (codecs->interleaved) { bitmap_interleaved_context_reset(codecs->interleaved); } } if (flags & FREERDP_CODEC_PLANAR) { if (codecs->planar) { freerdp_bitmap_planar_context_reset(codecs->planar); } } if (flags & FREERDP_CODEC_NSCODEC) { if (codecs->nsc) { nsc_context_reset(codecs->nsc); } } if (flags & FREERDP_CODEC_REMOTEFX) { if (codecs->rfx) { rfx_context_reset(codecs->rfx); } } if (flags & FREERDP_CODEC_CLEARCODEC) { if (codecs->clear) { clear_context_reset(codecs->clear); } } if (flags & FREERDP_CODEC_ALPHACODEC) { } if (flags & FREERDP_CODEC_PROGRESSIVE) { if (codecs->progressive) { progressive_context_reset(codecs->progressive); } } if (flags & FREERDP_CODEC_H264) { if (codecs->h264) { h264_context_reset(codecs->h264); } } return TRUE; }