summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--softhddev.c17
-rw-r--r--softhddev.h4
-rw-r--r--softhddevice.cpp8
-rw-r--r--video.c18
-rw-r--r--video.h2
6 files changed, 34 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 91a5128..0e756a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
User johns
Date:
+ Support multiple streams with ScaleVideo.
Makes 4:3 and 16:9 display format configurable.
Don't use DVB display format.
diff --git a/softhddev.c b/softhddev.c
index 61b6258..4c99b7d 100644
--- a/softhddev.c
+++ b/softhddev.c
@@ -1,7 +1,7 @@
///
/// @file softhddev.c @brief A software HD device plugin for VDR.
///
-/// Copyright (c) 2011, 2013 by Johns. All Rights Reserved.
+/// Copyright (c) 2011 - 2013 by Johns. All Rights Reserved.
///
/// Contributor(s):
///
@@ -2836,3 +2836,18 @@ void GetStats(int *missed, int *duped, int *dropped, int *counter)
VideoGetStats(MyHwDecoder, missed, duped, dropped, counter);
}
}
+
+/**
+** Scale the currently shown video.
+**
+** @param x video window x coordinate OSD relative
+** @param y video window y coordinate OSD relative
+** @param width video window width OSD relative
+** @param height video window height OSD relative
+*/
+void ScaleVideo(int x, int y, int width, int height)
+{
+ if (MyHwDecoder) {
+ VideoSetOutputPosition(MyHwDecoder, x, y, width, height);
+ }
+}
diff --git a/softhddev.h b/softhddev.h
index 60dfcbf..cf8bf2b 100644
--- a/softhddev.h
+++ b/softhddev.h
@@ -1,7 +1,7 @@
///
/// @file softhddev.h @brief software HD device plugin header file.
///
-/// Copyright (c) 2011 - 2012 by Johns. All Rights Reserved.
+/// Copyright (c) 2011 - 2013 by Johns. All Rights Reserved.
///
/// Contributor(s):
///
@@ -95,6 +95,8 @@ extern "C"
/// Get decoder statistics
extern void GetStats(int *, int *, int *, int *);
+ /// C plugin scale video
+ extern void ScaleVideo(int, int, int, int);
#ifdef __cplusplus
}
#endif
diff --git a/softhddevice.cpp b/softhddevice.cpp
index 5ac8f11..d85f52e 100644
--- a/softhddevice.cpp
+++ b/softhddevice.cpp
@@ -324,7 +324,7 @@ cSoftOsd::~cSoftOsd(void)
::GetOsdSize(&width, &height, &video_aspect);
// works osd relative
- VideoSetOutputPosition(0, 0, width, height);
+ ::ScaleVideo(0, 0, width, height);
}
#endif
}
@@ -358,8 +358,8 @@ void cSoftOsd::Flush(void)
// FIXME: vidWin is OSD relative not video window.
// FIXME: doesn't work if fixed OSD width != real window width
// FIXME: solved in VideoSetOutputPosition
- VideoSetOutputPosition(Left() + vidWin.x1, Top() + vidWin.y1,
- vidWin.Width(), vidWin.Height());
+ ::ScaleVideo(Left() + vidWin.x1, Top() + vidWin.y1, vidWin.Width(),
+ vidWin.Height());
}
#endif
@@ -1913,7 +1913,7 @@ void cSoftHdDevice::ScaleVideo(const cRect & rect)
dsyslog("[softhddev]%s: %dx%d%+d%+d\n", __FUNCTION__, VidWinRect.Width(),
VidWinRect.Height(), VidWinRect.X(), VidWinRect.Y());
#endif
- VideoSetOutputPosition(rect.X(), rect.Y(), rect.Width(), rect.Height());
+ ::ScaleVideo(rect.X(), rect.Y(), rect.Width(), rect.Height());
}
#endif
diff --git a/video.c b/video.c
index 2c29047..4f5ecd8 100644
--- a/video.c
+++ b/video.c
@@ -10230,14 +10230,14 @@ void VideoSetHue(int hue)
///
/// Set video output position.
///
-/// @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
-///
-/// @note FIXME: need to know which stream.
+/// @param hw_decoder video hardware decoder
+/// @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
///
-void VideoSetOutputPosition(int x, int y, int width, int height)
+void VideoSetOutputPosition(VideoHwDecoder * hw_decoder, int x, int y,
+ int width, int height)
{
static int last_x; ///< last video output window x
static int last_y; ///< last video output window y
@@ -10277,9 +10277,9 @@ void VideoSetOutputPosition(int x, int y, int width, int height)
// FIXME: add function to module class
#ifdef USE_VDPAU
if (VideoUsedModule == &VdpauModule) {
- VdpauSetOutputPosition(VdpauDecoders[0], last_x, last_y, last_width,
+ VdpauSetOutputPosition(&hw_decoder->Vdpau, last_x, last_y, last_width,
last_height);
- VdpauUpdateOutput(VdpauDecoders[0]);
+ VdpauUpdateOutput(&hw_decoder->Vdpau);
}
#endif
#ifdef USE_VAAPI
diff --git a/video.h b/video.h
index fab717f..1385122 100644
--- a/video.h
+++ b/video.h
@@ -110,7 +110,7 @@ extern void VideoSetSaturation(int);
extern void VideoSetHue(int);
/// Set video output position.
-extern void VideoSetOutputPosition(int, int, int, int);
+extern void VideoSetOutputPosition(VideoHwDecoder *, int, int, int, int);
/// Set video mode.
extern void VideoSetVideoMode(int, int, int, int);