Support multiple streams with ScaleVideo.

This commit is contained in:
Johns 2013-01-01 15:21:28 +01:00
parent acf377ec60
commit 3d5e59a6e5
6 changed files with 34 additions and 16 deletions

View File

@ -1,6 +1,7 @@
User johns User johns
Date: Date:
Support multiple streams with ScaleVideo.
Makes 4:3 and 16:9 display format configurable. Makes 4:3 and 16:9 display format configurable.
Don't use DVB display format. Don't use DVB display format.

View File

@ -1,7 +1,7 @@
/// ///
/// @file softhddev.c @brief A software HD device plugin for VDR. /// @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): /// Contributor(s):
/// ///
@ -2836,3 +2836,18 @@ void GetStats(int *missed, int *duped, int *dropped, int *counter)
VideoGetStats(MyHwDecoder, missed, duped, dropped, 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);
}
}

View File

@ -1,7 +1,7 @@
/// ///
/// @file softhddev.h @brief software HD device plugin header file. /// @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): /// Contributor(s):
/// ///
@ -95,6 +95,8 @@ extern "C"
/// Get decoder statistics /// Get decoder statistics
extern void GetStats(int *, int *, int *, int *); extern void GetStats(int *, int *, int *, int *);
/// C plugin scale video
extern void ScaleVideo(int, int, int, int);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -324,7 +324,7 @@ cSoftOsd::~cSoftOsd(void)
::GetOsdSize(&width, &height, &video_aspect); ::GetOsdSize(&width, &height, &video_aspect);
// works osd relative // works osd relative
VideoSetOutputPosition(0, 0, width, height); ::ScaleVideo(0, 0, width, height);
} }
#endif #endif
} }
@ -358,8 +358,8 @@ void cSoftOsd::Flush(void)
// FIXME: vidWin is OSD relative not video window. // FIXME: vidWin is OSD relative not video window.
// FIXME: doesn't work if fixed OSD width != real window width // FIXME: doesn't work if fixed OSD width != real window width
// FIXME: solved in VideoSetOutputPosition // FIXME: solved in VideoSetOutputPosition
VideoSetOutputPosition(Left() + vidWin.x1, Top() + vidWin.y1, ::ScaleVideo(Left() + vidWin.x1, Top() + vidWin.y1, vidWin.Width(),
vidWin.Width(), vidWin.Height()); vidWin.Height());
} }
#endif #endif
@ -1913,7 +1913,7 @@ void cSoftHdDevice::ScaleVideo(const cRect & rect)
dsyslog("[softhddev]%s: %dx%d%+d%+d\n", __FUNCTION__, VidWinRect.Width(), dsyslog("[softhddev]%s: %dx%d%+d%+d\n", __FUNCTION__, VidWinRect.Width(),
VidWinRect.Height(), VidWinRect.X(), VidWinRect.Y()); VidWinRect.Height(), VidWinRect.X(), VidWinRect.Y());
#endif #endif
VideoSetOutputPosition(rect.X(), rect.Y(), rect.Width(), rect.Height()); ::ScaleVideo(rect.X(), rect.Y(), rect.Width(), rect.Height());
} }
#endif #endif

18
video.c
View File

@ -10230,14 +10230,14 @@ void VideoSetHue(int hue)
/// ///
/// Set video output position. /// Set video output position.
/// ///
/// @param x video output x coordinate OSD relative /// @param hw_decoder video hardware decoder
/// @param y video output y coordinate OSD relative /// @param x video output x coordinate OSD relative
/// @param width video output width /// @param y video output y coordinate OSD relative
/// @param height video output height /// @param width video output width
/// @param height video output height
/// ///
/// @note FIXME: need to know which stream. void VideoSetOutputPosition(VideoHwDecoder * hw_decoder, int x, int y,
/// int width, int height)
void VideoSetOutputPosition(int x, int y, int width, int height)
{ {
static int last_x; ///< last video output window x static int last_x; ///< last video output window x
static int last_y; ///< last video output window y 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 // FIXME: add function to module class
#ifdef USE_VDPAU #ifdef USE_VDPAU
if (VideoUsedModule == &VdpauModule) { if (VideoUsedModule == &VdpauModule) {
VdpauSetOutputPosition(VdpauDecoders[0], last_x, last_y, last_width, VdpauSetOutputPosition(&hw_decoder->Vdpau, last_x, last_y, last_width,
last_height); last_height);
VdpauUpdateOutput(VdpauDecoders[0]); VdpauUpdateOutput(&hw_decoder->Vdpau);
} }
#endif #endif
#ifdef USE_VAAPI #ifdef USE_VAAPI

View File

@ -110,7 +110,7 @@ extern void VideoSetSaturation(int);
extern void VideoSetHue(int); extern void VideoSetHue(int);
/// Set video output position. /// Set video output position.
extern void VideoSetOutputPosition(int, int, int, int); extern void VideoSetOutputPosition(VideoHwDecoder *, int, int, int, int);
/// Set video mode. /// Set video mode.
extern void VideoSetVideoMode(int, int, int, int); extern void VideoSetVideoMode(int, int, int, int);