vlc-2.2.8-freerdp-2.patch 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. --- a/configure.ac
  2. +++ b/configure.ac
  3. @@ -1957,7 +1957,7 @@ PKG_ENABLE_MODULES_VLC([VNC], [vnc], [li
  4. dnl RDP/Remote Desktop access module
  5. dnl
  6. -PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) )
  7. +PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp2 >= 1.0.1], (RDP/Remote Desktop client support) )
  8. dnl
  9. dnl Real RTSP plugin
  10. --- a/modules/access/rdp.c 2017-12-25 17:45:32.964429170 +0100
  11. +++ b/modules/access/rdp.c 2017-12-25 17:53:15.114093670 +0100
  12. @@ -45,18 +45,6 @@
  13. # include <freerdp/version.h>
  14. #endif
  15. -#if !defined(FREERDP_VERSION_MAJOR) || \
  16. - (defined(FREERDP_VERSION_MAJOR) && !(FREERDP_VERSION_MAJOR > 1 || (FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR >= 1)))
  17. -# define SoftwareGdi sw_gdi
  18. -# define Fullscreen fullscreen
  19. -# define ServerHostname hostname
  20. -# define Username username
  21. -# define Password password
  22. -# define ServerPort port
  23. -# define EncryptionMethods encryption
  24. -# define ContextSize context_size
  25. -#endif
  26. -
  27. #include <errno.h>
  28. #ifdef HAVE_POLL
  29. # include <poll.h>
  30. @@ -140,6 +128,7 @@
  31. vlcrdp_context_t * p_vlccontext = (vlcrdp_context_t *) p_context;
  32. demux_sys_t *p_sys = p_vlccontext->p_demux->p_sys;
  33. rdpGdi *p_gdi = p_context->gdi;
  34. + unsigned bytesPerPixel;
  35. if ( p_sys->es )
  36. {
  37. @@ -149,19 +138,23 @@
  38. /* Now init and fill es format */
  39. vlc_fourcc_t i_chroma;
  40. - switch( p_gdi->bytesPerPixel )
  41. + switch( p_gdi->dstFormat )
  42. {
  43. default:
  44. - case 16:
  45. + msg_Dbg( p_vlccontext->p_demux, "unhandled dstFormat %x bpp", p_gdi->dstFormat);
  46. + case PIXEL_FORMAT_BGR16:
  47. i_chroma = VLC_CODEC_RGB16;
  48. + bytesPerPixel = 16;
  49. break;
  50. - case 24:
  51. + case PIXEL_FORMAT_BGR24:
  52. i_chroma = VLC_CODEC_RGB24;
  53. + bytesPerPixel = 24;
  54. break;
  55. - case 32:
  56. + case PIXEL_FORMAT_BGRA32:
  57. i_chroma = VLC_CODEC_RGB32;
  58. + bytesPerPixel = 32;
  59. break;
  60. }
  61. es_format_t fmt;
  62. es_format_Init( &fmt, VIDEO_ES, i_chroma );
  63. @@ -172,7 +165,7 @@
  64. fmt.video.i_height = p_gdi->height;
  65. fmt.video.i_frame_rate_base = 1000;
  66. fmt.video.i_frame_rate = 1000 * p_sys->f_fps;
  67. - p_sys->i_framebuffersize = p_gdi->width * p_gdi->height * p_gdi->bytesPerPixel;
  68. + p_sys->i_framebuffersize = p_gdi->width * p_gdi->height * bytesPerPixel;
  69. if ( p_sys->p_block )
  70. p_sys->p_block = block_Realloc( p_sys->p_block, 0, p_sys->i_framebuffersize );
  71. @@ -233,28 +226,19 @@
  72. vlcrdp_context_t * p_vlccontext = (vlcrdp_context_t *) p_instance->context;
  73. msg_Dbg( p_vlccontext->p_demux, "connected to desktop %dx%d (%d bpp)",
  74. -#if defined(FREERDP_VERSION_MAJOR) && (FREERDP_VERSION_MAJOR > 1 || (FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR >= 1))
  75. p_instance->settings->DesktopWidth,
  76. p_instance->settings->DesktopHeight,
  77. p_instance->settings->ColorDepth
  78. -#else
  79. - p_instance->settings->width,
  80. - p_instance->settings->height,
  81. - p_instance->settings->color_depth
  82. -#endif
  83. );
  84. p_instance->update->DesktopResize = desktopResizeHandler;
  85. p_instance->update->BeginPaint = beginPaintHandler;
  86. p_instance->update->EndPaint = endPaintHandler;
  87. - gdi_init( p_instance,
  88. - CLRBUF_16BPP |
  89. -#if defined(FREERDP_VERSION_MAJOR) && defined(FREERDP_VERSION_MINOR) && \
  90. - !(FREERDP_VERSION_MAJOR > 1 || (FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR >= 2))
  91. - CLRBUF_24BPP |
  92. -#endif
  93. - CLRBUF_32BPP, NULL );
  94. + if ( p_instance->settings->ColorDepth > 16 )
  95. + gdi_init( p_instance, PIXEL_FORMAT_XRGB32);
  96. + else
  97. + gdi_init( p_instance, PIXEL_FORMAT_RGB16);
  98. desktopResizeHandler( p_instance->context );
  99. return true;
  100. @@ -428,10 +412,6 @@
  101. if ( p_sys->f_fps <= 0 ) p_sys->f_fps = 1.0;
  102. p_sys->i_frame_interval = 1000000 / p_sys->f_fps;
  103. -#if FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR < 2
  104. - freerdp_channels_global_init();
  105. -#endif
  106. -
  107. p_sys->p_instance = freerdp_new();
  108. if ( !p_sys->p_instance )
  109. {
  110. @@ -506,9 +486,6 @@
  111. freerdp_disconnect( p_sys->p_instance );
  112. freerdp_free( p_sys->p_instance );
  113. -#if FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR < 2
  114. - freerdp_channels_global_uninit();
  115. -#endif
  116. if ( p_sys->p_block )
  117. block_Release( p_sys->p_block );