From 402ec04fcff209d190dac8861d04a9b9693ecccd Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 5 May 2013 18:53:41 +0200 Subject: [PATCH] generic-pc: use HD framebuffer resolution Use 1280x720 instead of 720x576 as default. The resolution can be changed via the environment variable GLFB_RESOLUTION. Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/eb9d2f44efaf3b608960641cb7e2717363afa418 Author: Stefan Seyfried Date: 2013-05-05 (Sun, 05 May 2013) ------------------ This commit was generated by Migit --- generic-pc/init.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/generic-pc/init.cpp b/generic-pc/init.cpp index 4c4481a..ad272f9 100644 --- a/generic-pc/init.cpp +++ b/generic-pc/init.cpp @@ -1,3 +1,4 @@ +#include #include #include "init_lib.h" @@ -14,8 +15,26 @@ void init_td_api() if (!initialized) lt_debug_init(); lt_info("%s begin, initialized=%d, debug=0x%02x\n", __func__, (int)initialized, debuglevel); - if (! glfb) - glfb = new GLFramebuffer(720, 576); /* hard coded to PAL resolution for now */ + if (! glfb) { + int x = 1280, y = 720; /* default OSD FB resolution */ + /* + * export GLFB_RESOLUTION=720,576 + * to restore old default behviour + */ + const char *tmp = getenv("GLFB_RESOLUTION"); + const char *p = NULL; + if (tmp) + p = strchr(tmp, ','); + if (p) { + x = atoi(tmp); + y = atoi(p + 1); + } + lt_info("%s: setting GL Framebuffer size to %dx%d\n", __func__, x, y); + if (!p) + lt_info("%s: export GLFB_RESOLUTION=\",\" to set another resolution\n", __func__); + + glfb = new GLFramebuffer(x, y); /* hard coded to PAL resolution for now */ + } initialized = true; }