0008-Add-support-for-freerdp2.patch 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. From 3780bbb20bf35aa8f21ac672da3f0c5f408468e9 Mon Sep 17 00:00:00 2001
  2. From: Bernd Kuhls <bernd.kuhls@t-online.de>
  3. Date: Thu, 16 Aug 2018 12:27:40 +0200
  4. Subject: [PATCH] Add support for freerdp2
  5. Downloaded from
  6. https://gitweb.gentoo.org/repo/gentoo.git/tree/media-video/vlc/files/vlc-2.2.8-freerdp-2.patch
  7. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
  8. ---
  9. configure.ac | 2 +-
  10. modules/access/rdp.c | 51 ++++++++++++++-------------------------------------
  11. 2 files changed, 15 insertions(+), 38 deletions(-)
  12. diff --git a/configure.ac b/configure.ac
  13. index bfe43512a2..4808b8becf 100644
  14. --- a/configure.ac
  15. +++ b/configure.ac
  16. @@ -1992,7 +1992,7 @@ PKG_ENABLE_MODULES_VLC([VNC], [vnc], [libvncclient >= 0.9.9], (VNC/rfb client su
  17. dnl RDP/Remote Desktop access module
  18. dnl
  19. -PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) )
  20. +PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp2 >= 1.0.1], (RDP/Remote Desktop client support) )
  21. dnl
  22. dnl Real RTSP plugin
  23. diff --git a/modules/access/rdp.c b/modules/access/rdp.c
  24. index 2992090219..49986f5da9 100644
  25. --- a/modules/access/rdp.c
  26. +++ b/modules/access/rdp.c
  27. @@ -45,18 +45,6 @@
  28. # include <freerdp/version.h>
  29. #endif
  30. -#if !defined(FREERDP_VERSION_MAJOR) || \
  31. - (defined(FREERDP_VERSION_MAJOR) && !(FREERDP_VERSION_MAJOR > 1 || (FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR >= 1)))
  32. -# define SoftwareGdi sw_gdi
  33. -# define Fullscreen fullscreen
  34. -# define ServerHostname hostname
  35. -# define Username username
  36. -# define Password password
  37. -# define ServerPort port
  38. -# define EncryptionMethods encryption
  39. -# define ContextSize context_size
  40. -#endif
  41. -
  42. #include <errno.h>
  43. #ifdef HAVE_POLL
  44. # include <poll.h>
  45. @@ -144,6 +132,7 @@ static void desktopResizeHandler( rdpContext *p_context )
  46. vlcrdp_context_t * p_vlccontext = (vlcrdp_context_t *) p_context;
  47. demux_sys_t *p_sys = p_vlccontext->p_demux->p_sys;
  48. rdpGdi *p_gdi = p_context->gdi;
  49. + unsigned bytesPerPixel;
  50. if ( p_sys->es )
  51. {
  52. @@ -153,17 +142,21 @@ static void desktopResizeHandler( rdpContext *p_context )
  53. /* Now init and fill es format */
  54. vlc_fourcc_t i_chroma;
  55. - switch( p_gdi->bytesPerPixel )
  56. + switch( p_gdi->dstFormat )
  57. {
  58. default:
  59. - case 16:
  60. + msg_Dbg( p_vlccontext->p_demux, "unhandled dstFormat %x bpp", p_gdi->dstFormat);
  61. + case PIXEL_FORMAT_BGR16:
  62. i_chroma = VLC_CODEC_RGB16;
  63. + bytesPerPixel = 16;
  64. break;
  65. - case 24:
  66. + case PIXEL_FORMAT_BGR24:
  67. i_chroma = VLC_CODEC_RGB24;
  68. + bytesPerPixel = 24;
  69. break;
  70. - case 32:
  71. + case PIXEL_FORMAT_BGRA32:
  72. i_chroma = VLC_CODEC_RGB32;
  73. + bytesPerPixel = 32;
  74. break;
  75. }
  76. es_format_t fmt;
  77. @@ -176,7 +169,7 @@ static void desktopResizeHandler( rdpContext *p_context )
  78. fmt.video.i_height = p_gdi->height;
  79. fmt.video.i_frame_rate_base = 1000;
  80. fmt.video.i_frame_rate = 1000 * p_sys->f_fps;
  81. - p_sys->i_framebuffersize = p_gdi->width * p_gdi->height * p_gdi->bytesPerPixel;
  82. + p_sys->i_framebuffersize = p_gdi->width * p_gdi->height * bytesPerPixel;
  83. if ( p_sys->p_block )
  84. p_sys->p_block = block_Realloc( p_sys->p_block, 0, p_sys->i_framebuffersize );
  85. @@ -237,28 +230,19 @@ static bool postConnectHandler( freerdp *p_instance )
  86. vlcrdp_context_t * p_vlccontext = (vlcrdp_context_t *) p_instance->context;
  87. msg_Dbg( p_vlccontext->p_demux, "connected to desktop %dx%d (%d bpp)",
  88. -#if defined(FREERDP_VERSION_MAJOR) && (FREERDP_VERSION_MAJOR > 1 || (FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR >= 1))
  89. p_instance->settings->DesktopWidth,
  90. p_instance->settings->DesktopHeight,
  91. p_instance->settings->ColorDepth
  92. -#else
  93. - p_instance->settings->width,
  94. - p_instance->settings->height,
  95. - p_instance->settings->color_depth
  96. -#endif
  97. );
  98. p_instance->update->DesktopResize = desktopResizeHandler;
  99. p_instance->update->BeginPaint = beginPaintHandler;
  100. p_instance->update->EndPaint = endPaintHandler;
  101. - gdi_init( p_instance,
  102. - CLRBUF_16BPP |
  103. -#if defined(FREERDP_VERSION_MAJOR) && defined(FREERDP_VERSION_MINOR) && \
  104. - !(FREERDP_VERSION_MAJOR > 1 || (FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR >= 2))
  105. - CLRBUF_24BPP |
  106. -#endif
  107. - CLRBUF_32BPP, NULL );
  108. + if ( p_instance->settings->ColorDepth > 16 )
  109. + gdi_init( p_instance, PIXEL_FORMAT_XRGB32);
  110. + else
  111. + gdi_init( p_instance, PIXEL_FORMAT_RGB16);
  112. desktopResizeHandler( p_instance->context );
  113. return true;
  114. @@ -432,10 +416,6 @@ static int Open( vlc_object_t *p_this )
  115. if ( p_sys->f_fps <= 0 ) p_sys->f_fps = 1.0;
  116. p_sys->i_frame_interval = 1000000 / p_sys->f_fps;
  117. -#if FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR < 2
  118. - freerdp_channels_global_init();
  119. -#endif
  120. -
  121. p_sys->p_instance = freerdp_new();
  122. if ( !p_sys->p_instance )
  123. {
  124. @@ -508,9 +488,6 @@ static void Close( vlc_object_t *p_this )
  125. freerdp_disconnect( p_sys->p_instance );
  126. freerdp_free( p_sys->p_instance );
  127. -#if FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR < 2
  128. - freerdp_channels_global_uninit();
  129. -#endif
  130. if ( p_sys->p_block )
  131. block_Release( p_sys->p_block );
  132. --
  133. 2.14.4