summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/xrdp_client_info.h1
-rw-r--r--libxrdp/xrdp_rdp.c9
-rw-r--r--libxrdp/xrdp_sec.c10
-rw-r--r--vrplayer/mainwindow.cpp20
-rw-r--r--xrdp/xrdp.ini4
-rw-r--r--xrdpvr/xrdpvr.c29
-rw-r--r--xrdpvr/xrdpvr_internal.h22
7 files changed, 73 insertions, 22 deletions
diff --git a/common/xrdp_client_info.h b/common/xrdp_client_info.h
index 596177c4..a364927d 100644
--- a/common/xrdp_client_info.h
+++ b/common/xrdp_client_info.h
@@ -86,6 +86,7 @@ struct xrdp_client_info
int jpeg_prop_len;
char jpeg_prop[64];
int v3_codec_id;
+ int use_bulk_comp;
};
#endif
diff --git a/libxrdp/xrdp_rdp.c b/libxrdp/xrdp_rdp.c
index 12490235..264f6096 100644
--- a/libxrdp/xrdp_rdp.c
+++ b/libxrdp/xrdp_rdp.c
@@ -103,6 +103,15 @@ xrdp_rdp_read_config(struct xrdp_client_info *client_info)
client_info->use_bitmap_comp = 1;
}
}
+ else if (g_strcasecmp(item, "bulk_compression") == 0)
+ {
+ if (g_strcasecmp(value, "yes") == 0 ||
+ g_strcasecmp(value, "true") == 0 ||
+ g_strcasecmp(value, "1") == 0)
+ {
+ client_info->use_bulk_comp = 1;
+ }
+ }
else if (g_strcasecmp(item, "crypt_level") == 0)
{
if (g_strcasecmp(value, "low") == 0)
diff --git a/libxrdp/xrdp_sec.c b/libxrdp/xrdp_sec.c
index 66b66264..17348274 100644
--- a/libxrdp/xrdp_sec.c
+++ b/libxrdp/xrdp_sec.c
@@ -385,8 +385,16 @@ xrdp_sec_process_logon_info(struct xrdp_sec *self, struct stream *s)
if (flags & RDP_COMPRESSION)
{
- self->rdp_layer->client_info.rdp_compression = 1;
DEBUG(("flag RDP_COMPRESSION found"));
+ if (self->rdp_layer->client_info.use_bulk_comp)
+ {
+ DEBUG(("flag RDP_COMPRESSION set"));
+ self->rdp_layer->client_info.rdp_compression = 1;
+ }
+ else
+ {
+ DEBUG(("flag RDP_COMPRESSION not set"));
+ }
}
in_uint16_le(s, len_domain);
diff --git a/vrplayer/mainwindow.cpp b/vrplayer/mainwindow.cpp
index 9cafa016..2d9baa34 100644
--- a/vrplayer/mainwindow.cpp
+++ b/vrplayer/mainwindow.cpp
@@ -175,15 +175,21 @@ void MainWindow::openMediaFile()
void MainWindow::getVdoGeometry(QRect *rect)
{
- int x = geometry().x() + lblVideo->geometry().x();
-
- int y = pos().y() + lblVideo->geometry().y() +
- ui->mainToolBar->geometry().height() * 4 + 10;
-
+ int x;
+ int y;
+ int width;
+ int height;
+ QPoint pt;
+
+ pt = lblVideo->mapToGlobal(QPoint(0, 0));
+ x = pt.x();
+ y = pt.y();
+ width = lblVideo->width();
+ height = lblVideo->height();
rect->setX(x);
rect->setY(y);
- rect->setWidth(lblVideo->geometry().width());
- rect->setHeight(lblVideo->geometry().height());
+ rect->setWidth(width);
+ rect->setHeight(height);
}
void MainWindow::clearDisplay()
diff --git a/xrdp/xrdp.ini b/xrdp/xrdp.ini
index c0852518..e4960f1f 100644
--- a/xrdp/xrdp.ini
+++ b/xrdp/xrdp.ini
@@ -23,8 +23,9 @@ tcp_keepalive=yes
#red=ff0000
#green=00ff00
#background=626c72
-#autorun=xrdp7
+#autorun=xrdp1
#hidelogwindow=yes
+#bulk_compression=yes
[Logging]
LogFile=/opt/xrdp/var/log/xrdp.log
@@ -55,4 +56,3 @@ channel.drdynvc=true
channel.cliprdr=true
channel.rail=true
channel.xrdpvr=true
-
diff --git a/xrdpvr/xrdpvr.c b/xrdpvr/xrdpvr.c
index b30869a8..9c49979a 100644
--- a/xrdpvr/xrdpvr.c
+++ b/xrdpvr/xrdpvr.c
@@ -95,7 +95,8 @@ xrdpvr_deinit_player(void *channel, int stream_id)
av_free(g_psi.frame);
avcodec_close(g_psi.p_audio_codec_ctx);
avcodec_close(g_psi.p_video_codec_ctx);
- avformat_close_input(&g_psi.p_format_ctx);
+ //avformat_close_input(&g_psi.p_format_ctx);
+ av_close_input_file(g_psi.p_format_ctx);
/* do remote cleanup */
@@ -141,14 +142,16 @@ xrdpvr_play_media(void *channel, int stream_id, char *filename)
av_register_all();
/* open media file - this will read just the header */
- if (avformat_open_input(&g_psi.p_format_ctx, filename, NULL, NULL))
+ //if (avformat_open_input(&g_psi.p_format_ctx, filename, NULL, NULL))
+ if (av_open_input_file(&g_psi.p_format_ctx, filename, NULL, 0, NULL))
{
printf("ERROR opening %s\n", filename);
return -1;
}
/* now get the real stream info */
- if (avformat_find_stream_info(g_psi.p_format_ctx, NULL) < 0)
+ //if (avformat_find_stream_info(g_psi.p_format_ctx, NULL) < 0)
+ if (av_find_stream_info(g_psi.p_format_ctx) < 0)
{
printf("ERRRO reading stream info\n");
return -1;
@@ -162,13 +165,13 @@ xrdpvr_play_media(void *channel, int stream_id, char *filename)
/* find first audio / video stream */
for (i = 0; i < g_psi.p_format_ctx->nb_streams; i++)
{
- if (g_psi.p_format_ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
+ if (g_psi.p_format_ctx->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO &&
g_video_index < 0)
{
g_video_index = i;
}
- if (g_psi.p_format_ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO &&
+ if (g_psi.p_format_ctx->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO &&
g_audio_index < 0)
{
g_audio_index = i;
@@ -179,7 +182,8 @@ xrdpvr_play_media(void *channel, int stream_id, char *filename)
{
/* close file and return with error */
printf("ERROR: no audio/video stream found in %s\n", filename);
- avformat_close_input(&g_psi.p_format_ctx);
+ //avformat_close_input(&g_psi.p_format_ctx);
+ av_close_input_file(g_psi.p_format_ctx);
return -1;
}
@@ -207,16 +211,18 @@ xrdpvr_play_media(void *channel, int stream_id, char *filename)
}
/* open decoder for audio stream */
- if (avcodec_open2(g_psi.p_audio_codec_ctx, g_psi.p_audio_codec,
- NULL) < 0)
+ //if (avcodec_open2(g_psi.p_audio_codec_ctx, g_psi.p_audio_codec,
+ // NULL) < 0)
+ if (avcodec_open(g_psi.p_audio_codec_ctx, g_psi.p_audio_codec) < 0)
{
printf("ERROR: could not open audio decoder\n");
return -1;
}
/* open decoder for video stream */
- if (avcodec_open2(g_psi.p_video_codec_ctx, g_psi.p_video_codec,
- NULL) < 0)
+ //if (avcodec_open2(g_psi.p_video_codec_ctx, g_psi.p_video_codec,
+ // NULL) < 0)
+ if (avcodec_open(g_psi.p_video_codec_ctx, g_psi.p_video_codec) < 0)
{
printf("ERROR: could not open video decoder\n");
return -1;
@@ -342,7 +348,7 @@ int xrdpvr_play_frame(void *channel, int stream_id, int *videoTimeout, int *audi
*audioTimeout = (int) ((dts - g_psi.audioTimeout) * 1000000);
*videoTimeout = -1;
- if (g_psi.audioTimeout > dts)
+ if (g_psi.audioTimeout > dts)
{
g_psi.audioTimeout = dts;
delay_in_us = 1000 * 40;
@@ -728,4 +734,3 @@ xrdpvr_write_to_client(void *channel, STREAM *s)
usleep(1000 * 3);
}
}
-
diff --git a/xrdpvr/xrdpvr_internal.h b/xrdpvr/xrdpvr_internal.h
index ca15caf1..29160d46 100644
--- a/xrdpvr/xrdpvr_internal.h
+++ b/xrdpvr/xrdpvr_internal.h
@@ -26,8 +26,30 @@
#include <stdint.h>
#include <sys/types.h>
#include <fcntl.h>
+#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
+#if LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR == 20
+#define DISTRO_DEBIAN6
+#endif
+
+#if LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR == 72
+#define DISTRO_UBUNTU1104
+#endif
+
+#if LIBAVCODEC_VERSION_MAJOR == 53 && LIBAVCODEC_VERSION_MINOR == 35
+#define DISTRO_UBUNTU1204
+#endif
+
+#if !defined(DISTRO_DEBIAN6) && !defined(DISTRO_UBUNTU1104) && !defined(DISTRO_UBUNTU1204)
+#warning unsupported distro
+#endif
+
+#ifdef DISTRO_UBUNTU1204
+#define CODEC_TYPE_VIDEO AVMEDIA_TYPE_VIDEO
+#define CODEC_TYPE_AUDIO AVMEDIA_TYPE_AUDIO
+#endif
+
#define MAX_BUFSIZE (1024 * 1024 * 8)
#define CMD_SET_VIDEO_FORMAT 1