summaryrefslogtreecommitdiff
path: root/video.c
diff options
context:
space:
mode:
authorJohns <johns98@gmx.net>2012-12-31 17:51:43 +0100
committerJohns <johns98@gmx.net>2012-12-31 17:51:43 +0100
commit33b14be516224f866030718edae7e57efd76edcf (patch)
treef5895dfc608a7dcbd0fe48c5cafb9a882305190b /video.c
parent3907f3eb2f2cea27efddba1f004640645373ffa3 (diff)
downloadvdr-plugin-softhddevice-33b14be516224f866030718edae7e57efd76edcf.tar.gz
vdr-plugin-softhddevice-33b14be516224f866030718edae7e57efd76edcf.tar.bz2
Change VideoSetOutputPosition to work OSD relative.
Diffstat (limited to 'video.c')
-rw-r--r--video.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/video.c b/video.c
index aea2e04..9d1615f 100644
--- a/video.c
+++ b/video.c
@@ -10217,8 +10217,8 @@ void VideoSetHue(int hue)
///
/// Set video output position.
///
-/// @param x video output x coordinate inside the window
-/// @param y video output y coordinate inside the window
+/// @param x video output x coordinate OSD relative
+/// @param y video output y coordinate OSD relative
/// @param width video output width
/// @param height video output height
///
@@ -10226,8 +10226,8 @@ void VideoSetHue(int hue)
///
void VideoSetOutputPosition(int x, int y, int width, int height)
{
- static int last_x; ///< last video output window x coordinate
- static int last_y; ///< last video output window y coordinate
+ static int last_x; ///< last video output window x
+ static int last_y; ///< last video output window y
static unsigned last_width; ///< last video output window width
static unsigned last_height; ///< last video output window height
@@ -10235,32 +10235,33 @@ void VideoSetOutputPosition(int x, int y, int width, int height)
return;
}
if (!width || !height) {
- if (x == last_x && y == last_y && VideoWindowWidth == last_width
- && VideoWindowHeight == last_height) {
- // not necessary...
- return;
- }
// restore full size & remember values to be able to avoid
// interfering with the video thread if possible
- last_width = VideoWindowWidth;
- last_height = VideoWindowHeight;
+ width = VideoWindowWidth;
+ height = VideoWindowHeight;
} else {
- if (x == last_x && y == last_y && (unsigned)width == last_width
- && (unsigned)height == last_height) {
- // not necessary...
- return;
- }
- // scale & remember values to be able to avoid
- // interfering with the video thread if possible
- last_width = width;
- last_height = height;
+ // convert OSD coordinates to window coordinates
+ x = (x * VideoWindowWidth) / OsdWidth;
+ width = (width * VideoWindowWidth) / OsdWidth;
+ y = (y * VideoWindowHeight) / OsdHeight;
+ height = (height * VideoWindowHeight) / OsdHeight;
}
- // remember position to be able to avoid
+
+ if (x == last_x && y == last_y && (unsigned)width == last_width
+ && (unsigned)height == last_height) {
+ // not necessary...
+ return;
+ }
+ // scale & remember values to be able to avoid
// interfering with the video thread if possible
last_x = x;
last_y = y;
+ last_width = width;
+ last_height = height;
+
VideoThreadLock();
// FIXME: what stream?
+ // FIXME: add function to module class
#ifdef USE_VDPAU
if (VideoUsedModule == &VdpauModule) {
VdpauSetOutputPosition(VdpauDecoders[0], last_x, last_y, last_width,