diff options
author | Johns <johns98@gmx.net> | 2012-05-21 15:34:33 +0200 |
---|---|---|
committer | Johns <johns98@gmx.net> | 2012-05-21 15:34:33 +0200 |
commit | 32527f832e203e8d111f0da07f91e146e24dd48a (patch) | |
tree | 02486613967e6619f37bb79579b60097eb6d7c09 /video.c | |
parent | 57bbd02c57f59715c1a5469aaff53b5cefcd29d4 (diff) | |
download | vdr-plugin-softhddevice-32527f832e203e8d111f0da07f91e146e24dd48a.tar.gz vdr-plugin-softhddevice-32527f832e203e8d111f0da07f91e146e24dd48a.tar.bz2 |
Makes OSD size configurable.
Diffstat (limited to 'video.c')
-rw-r--r-- | video.c | 29 |
1 files changed, 27 insertions, 2 deletions
@@ -370,6 +370,8 @@ static pthread_mutex_t VideoLockMutex; ///< video lock mutex #endif +static int OsdConfigWidth; ///< osd configured width +static int OsdConfigHeight; ///< osd configured height static char OsdShown; ///< flag show osd static int OsdWidth; ///< osd width static int OsdHeight; ///< osd height @@ -8667,6 +8669,9 @@ void VideoOsdDrawARGB(int x, int y, int width, int height, /// /// Get OSD size. /// +/// @param[out] width OSD width +/// @param[out] height OSD height +/// void VideoGetOsdSize(int *width, int *height) { *width = 1920; @@ -8677,6 +8682,21 @@ void VideoGetOsdSize(int *width, int *height) } } +/// Set OSD Size. +/// +/// @param width OSD width +/// @param height OSD height +/// +void VideoSetOsdSize(int width, int height) +{ + if (OsdConfigWidth != width || OsdConfigHeight != height) { + VideoOsdExit(); + OsdConfigWidth = width; + OsdConfigHeight = height; + VideoOsdInit(); + } +} + /// /// Setup osd. /// @@ -8685,8 +8705,13 @@ void VideoGetOsdSize(int *width, int *height) /// void VideoOsdInit(void) { - OsdWidth = VideoWindowWidth; // FIXME: must be configured - OsdHeight = VideoWindowHeight; + if (OsdConfigWidth && OsdConfigHeight) { + OsdWidth = OsdConfigWidth; + OsdHeight = OsdConfigHeight; + } else { + OsdWidth = VideoWindowWidth; + OsdHeight = VideoWindowHeight; + } #ifdef USE_GLX // FIXME: make an extra function for this |