diff options
author | Johns <johns98@gmx.net> | 2013-01-04 21:50:55 +0100 |
---|---|---|
committer | Johns <johns98@gmx.net> | 2013-01-04 21:50:55 +0100 |
commit | d89ada9aad29870ad08b503aac3e85d8bc36c2ff (patch) | |
tree | 8981298c636147105f8549ff327c9fdf60786bb9 /softhddev.c | |
parent | 59d1a6b1f2a69e8f24279a00b38848f29ed92726 (diff) | |
download | vdr-plugin-softhddevice-d89ada9aad29870ad08b503aac3e85d8bc36c2ff.tar.gz vdr-plugin-softhddevice-d89ada9aad29870ad08b503aac3e85d8bc36c2ff.tar.bz2 |
Makes PIP+Video position configurable.
Diffstat (limited to 'softhddev.c')
-rw-r--r-- | softhddev.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/softhddev.c b/softhddev.c index 558fed7..ad8c609 100644 --- a/softhddev.c +++ b/softhddev.c @@ -2917,6 +2917,33 @@ void ScaleVideo(int x, int y, int width, int height) #ifdef USE_PIP /** +** Set PIP position. +** +** @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 +** @param pip_x pip window x coordinate OSD relative +** @param pip_y pip window y coordinate OSD relative +** @param pip_width pip window width OSD relative +** @param pip_height pip window height OSD relative +*/ +void PipSetPosition(int x, int y, int width, int height, int pip_x, int pip_y, + int pip_width, int pip_height) +{ + if (!MyVideoStream->HwDecoder) { // video not running + return; + } + ScaleVideo(x, y, width, height); + + if (!PipVideoStream->HwDecoder) { // pip not running + return; + } + VideoSetOutputPosition(PipVideoStream->HwDecoder, pip_x, pip_y, + pip_width, pip_height); +} + +/** ** Start PIP stream. ** ** @param x video window x coordinate OSD relative @@ -2935,8 +2962,6 @@ void PipStart(int x, int y, int width, int height, int pip_x, int pip_y, return; } - ScaleVideo(x, y, width, height); - if (!PipVideoStream->Decoder) { PipVideoStream->SkipStream = 1; if ((PipVideoStream->HwDecoder = VideoNewHwDecoder(PipVideoStream))) { @@ -2948,10 +2973,9 @@ void PipStart(int x, int y, int width, int height, int pip_x, int pip_y, PipVideoStream->LastCodecID = CODEC_ID_NONE; VideoPacketInit(PipVideoStream); - VideoSetOutputPosition(PipVideoStream->HwDecoder, pip_x, pip_y, - pip_width, pip_height); } } + PipSetPosition(x, y, width, height, pip_x, pip_y, pip_width, pip_height); } /** |