From b6fb3009542576c88973a99d5fb66bf91aa62bb0 Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Wed, 2 Jan 2013 23:07:23 -0800 Subject: xrdpvr: compile fix for older ffmpeg --- xrdpvr/xrdpvr.c | 7 +++---- xrdpvr/xrdpvr_internal.h | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/xrdpvr/xrdpvr.c b/xrdpvr/xrdpvr.c index b30869a8..8a63dbed 100644 --- a/xrdpvr/xrdpvr.c +++ b/xrdpvr/xrdpvr.c @@ -162,13 +162,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; @@ -342,7 +342,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 +728,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 #include #include +#include #include +#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 -- cgit v1.2.1 From eb4209e93263c1ff939d394ced134cd82d3ef1db Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Sun, 6 Jan 2013 23:56:40 -0800 Subject: libxrdp: added ini settings for bulk compressor --- common/xrdp_client_info.h | 1 + libxrdp/xrdp_rdp.c | 9 +++++++++ libxrdp/xrdp_sec.c | 10 +++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) 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); -- cgit v1.2.1 From b2c242f50eed96431e19c5905fc1c0269709da7c Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Mon, 7 Jan 2013 00:05:46 -0800 Subject: update for xrdp.ini --- xrdp/xrdp.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xrdp/xrdp.ini b/xrdp/xrdp.ini index 6ee1d9c3..f500f63f 100644 --- a/xrdp/xrdp.ini +++ b/xrdp/xrdp.ini @@ -22,8 +22,9 @@ tcp_keepalive=yes #red=ff0000 #green=00ff00 #background=626c72 -#autorun=xrdp7 +#autorun=xrdp1 #hidelogwindow=yes +#bulk_compression=yes [Logging] LogFile=xrdp.log @@ -108,4 +109,3 @@ channel.drdynvc=true channel.cliprdr=true channel.rail=true channel.xrdpvr=true - -- cgit v1.2.1 From 13327df86fe120cdc2e978dda8becef78730bbb6 Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Sun, 13 Jan 2013 20:13:27 -0800 Subject: vrplayer: change to get screen position --- vrplayer/mainwindow.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) 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() -- cgit v1.2.1 From 88be8505a9a61ed9de288dfbb486c815b440ef36 Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Mon, 14 Jan 2013 10:22:10 -0800 Subject: vrplayer: fix for building with older ffmpeg --- xrdpvr/xrdpvr.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/xrdpvr/xrdpvr.c b/xrdpvr/xrdpvr.c index 8a63dbed..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; @@ -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; -- cgit v1.2.1