Lines 45-62
Link Here
|
45 |
# include <freerdp/version.h> |
45 |
# include <freerdp/version.h> |
46 |
#endif |
46 |
#endif |
47 |
|
47 |
|
48 |
#if !defined(FREERDP_VERSION_MAJOR) || \ |
|
|
49 |
(defined(FREERDP_VERSION_MAJOR) && !(FREERDP_VERSION_MAJOR > 1 || (FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR >= 1))) |
50 |
# define SoftwareGdi sw_gdi |
51 |
# define Fullscreen fullscreen |
52 |
# define ServerHostname hostname |
53 |
# define Username username |
54 |
# define Password password |
55 |
# define ServerPort port |
56 |
# define EncryptionMethods encryption |
57 |
# define ContextSize context_size |
58 |
#endif |
59 |
|
60 |
#include <errno.h> |
48 |
#include <errno.h> |
61 |
#ifdef HAVE_POLL |
49 |
#ifdef HAVE_POLL |
62 |
# include <poll.h> |
50 |
# include <poll.h> |
Lines 140-145
Link Here
|
140 |
vlcrdp_context_t * p_vlccontext = (vlcrdp_context_t *) p_context; |
128 |
vlcrdp_context_t * p_vlccontext = (vlcrdp_context_t *) p_context; |
141 |
demux_sys_t *p_sys = p_vlccontext->p_demux->p_sys; |
129 |
demux_sys_t *p_sys = p_vlccontext->p_demux->p_sys; |
142 |
rdpGdi *p_gdi = p_context->gdi; |
130 |
rdpGdi *p_gdi = p_context->gdi; |
|
|
131 |
unsigned bytesPerPixel; |
143 |
|
132 |
|
144 |
if ( p_sys->es ) |
133 |
if ( p_sys->es ) |
145 |
{ |
134 |
{ |
Lines 149-167
Link Here
|
149 |
|
138 |
|
150 |
/* Now init and fill es format */ |
139 |
/* Now init and fill es format */ |
151 |
vlc_fourcc_t i_chroma; |
140 |
vlc_fourcc_t i_chroma; |
152 |
switch( p_gdi->bytesPerPixel ) |
141 |
|
|
|
142 |
switch( p_gdi->dstFormat ) |
153 |
{ |
143 |
{ |
154 |
default: |
144 |
default: |
155 |
case 16: |
145 |
msg_Dbg( p_vlccontext->p_demux, "unhandled dstFormat %x bpp", p_gdi->dstFormat); |
|
|
146 |
case PIXEL_FORMAT_BGR16: |
156 |
i_chroma = VLC_CODEC_RGB16; |
147 |
i_chroma = VLC_CODEC_RGB16; |
|
|
148 |
bytesPerPixel = 16; |
157 |
break; |
149 |
break; |
158 |
case 24: |
150 |
case PIXEL_FORMAT_BGR24: |
159 |
i_chroma = VLC_CODEC_RGB24; |
151 |
i_chroma = VLC_CODEC_RGB24; |
|
|
152 |
bytesPerPixel = 24; |
160 |
break; |
153 |
break; |
161 |
case 32: |
154 |
case PIXEL_FORMAT_BGRA32: |
162 |
i_chroma = VLC_CODEC_RGB32; |
155 |
i_chroma = VLC_CODEC_RGB32; |
|
|
156 |
bytesPerPixel = 32; |
163 |
break; |
157 |
break; |
164 |
} |
158 |
} |
|
|
159 |
|
165 |
es_format_t fmt; |
160 |
es_format_t fmt; |
166 |
es_format_Init( &fmt, VIDEO_ES, i_chroma ); |
161 |
es_format_Init( &fmt, VIDEO_ES, i_chroma ); |
167 |
|
162 |
|
Lines 172-178
Link Here
|
172 |
fmt.video.i_height = p_gdi->height; |
167 |
fmt.video.i_height = p_gdi->height; |
173 |
fmt.video.i_frame_rate_base = 1000; |
168 |
fmt.video.i_frame_rate_base = 1000; |
174 |
fmt.video.i_frame_rate = 1000 * p_sys->f_fps; |
169 |
fmt.video.i_frame_rate = 1000 * p_sys->f_fps; |
175 |
p_sys->i_framebuffersize = p_gdi->width * p_gdi->height * p_gdi->bytesPerPixel; |
170 |
p_sys->i_framebuffersize = p_gdi->width * p_gdi->height * bytesPerPixel; |
176 |
|
171 |
|
177 |
if ( p_sys->p_block ) |
172 |
if ( p_sys->p_block ) |
178 |
p_sys->p_block = block_Realloc( p_sys->p_block, 0, p_sys->i_framebuffersize ); |
173 |
p_sys->p_block = block_Realloc( p_sys->p_block, 0, p_sys->i_framebuffersize ); |
Lines 233-260
Link Here
|
233 |
vlcrdp_context_t * p_vlccontext = (vlcrdp_context_t *) p_instance->context; |
228 |
vlcrdp_context_t * p_vlccontext = (vlcrdp_context_t *) p_instance->context; |
234 |
|
229 |
|
235 |
msg_Dbg( p_vlccontext->p_demux, "connected to desktop %dx%d (%d bpp)", |
230 |
msg_Dbg( p_vlccontext->p_demux, "connected to desktop %dx%d (%d bpp)", |
236 |
#if defined(FREERDP_VERSION_MAJOR) && (FREERDP_VERSION_MAJOR > 1 || (FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR >= 1)) |
|
|
237 |
p_instance->settings->DesktopWidth, |
231 |
p_instance->settings->DesktopWidth, |
238 |
p_instance->settings->DesktopHeight, |
232 |
p_instance->settings->DesktopHeight, |
239 |
p_instance->settings->ColorDepth |
233 |
p_instance->settings->ColorDepth |
240 |
#else |
|
|
241 |
p_instance->settings->width, |
242 |
p_instance->settings->height, |
243 |
p_instance->settings->color_depth |
244 |
#endif |
245 |
); |
234 |
); |
246 |
|
235 |
|
247 |
p_instance->update->DesktopResize = desktopResizeHandler; |
236 |
p_instance->update->DesktopResize = desktopResizeHandler; |
248 |
p_instance->update->BeginPaint = beginPaintHandler; |
237 |
p_instance->update->BeginPaint = beginPaintHandler; |
249 |
p_instance->update->EndPaint = endPaintHandler; |
238 |
p_instance->update->EndPaint = endPaintHandler; |
250 |
|
239 |
|
251 |
gdi_init( p_instance, |
240 |
if ( p_instance->settings->ColorDepth > 16 ) |
252 |
CLRBUF_16BPP | |
241 |
gdi_init( p_instance, PIXEL_FORMAT_XRGB32); |
253 |
#if defined(FREERDP_VERSION_MAJOR) && defined(FREERDP_VERSION_MINOR) && \ |
242 |
else |
254 |
!(FREERDP_VERSION_MAJOR > 1 || (FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR >= 2)) |
243 |
gdi_init( p_instance, PIXEL_FORMAT_RGB16); |
255 |
CLRBUF_24BPP | |
|
|
256 |
#endif |
257 |
CLRBUF_32BPP, NULL ); |
258 |
|
244 |
|
259 |
desktopResizeHandler( p_instance->context ); |
245 |
desktopResizeHandler( p_instance->context ); |
260 |
return true; |
246 |
return true; |
Lines 428-437
Link Here
|
428 |
if ( p_sys->f_fps <= 0 ) p_sys->f_fps = 1.0; |
414 |
if ( p_sys->f_fps <= 0 ) p_sys->f_fps = 1.0; |
429 |
p_sys->i_frame_interval = 1000000 / p_sys->f_fps; |
415 |
p_sys->i_frame_interval = 1000000 / p_sys->f_fps; |
430 |
|
416 |
|
431 |
#if FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR < 2 |
|
|
432 |
freerdp_channels_global_init(); |
433 |
#endif |
434 |
|
435 |
p_sys->p_instance = freerdp_new(); |
417 |
p_sys->p_instance = freerdp_new(); |
436 |
if ( !p_sys->p_instance ) |
418 |
if ( !p_sys->p_instance ) |
437 |
{ |
419 |
{ |
Lines 506-514
Link Here
|
506 |
|
488 |
|
507 |
freerdp_disconnect( p_sys->p_instance ); |
489 |
freerdp_disconnect( p_sys->p_instance ); |
508 |
freerdp_free( p_sys->p_instance ); |
490 |
freerdp_free( p_sys->p_instance ); |
509 |
#if FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR < 2 |
|
|
510 |
freerdp_channels_global_uninit(); |
511 |
#endif |
512 |
|
491 |
|
513 |
if ( p_sys->p_block ) |
492 |
if ( p_sys->p_block ) |
514 |
block_Release( p_sys->p_block ); |
493 |
block_Release( p_sys->p_block ); |