mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 08:21:07 +02:00
osd resolution: Use COsdHelpers::changeOsdResolution() to adjust...
...OSD resolution after switching video format
Origin commit data
------------------
Branch: ni/coolstream
Commit: ff11dd44ab
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2017-02-28 (Tue, 28 Feb 2017)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -49,6 +49,7 @@ enum CS_LOG_MODULE {
|
|||||||
// Initialization
|
// Initialization
|
||||||
void cs_api_init(void);
|
void cs_api_init(void);
|
||||||
void cs_api_exit(void);
|
void cs_api_exit(void);
|
||||||
|
void cs_new_auto_videosystem();
|
||||||
|
|
||||||
// Memory helpers
|
// Memory helpers
|
||||||
void *cs_malloc_uncached(size_t size);
|
void *cs_malloc_uncached(size_t size);
|
||||||
|
@@ -190,6 +190,7 @@ private:
|
|||||||
analog_mode_t analog_mode_scart;
|
analog_mode_t analog_mode_scart;
|
||||||
fp_icon mode_icon;
|
fp_icon mode_icon;
|
||||||
cDemux *demux;
|
cDemux *demux;
|
||||||
|
int current_video_system;
|
||||||
//
|
//
|
||||||
int SelectAutoFormat();
|
int SelectAutoFormat();
|
||||||
void ScalePic();
|
void ScalePic();
|
||||||
@@ -244,6 +245,7 @@ public:
|
|||||||
int Flush(void);
|
int Flush(void);
|
||||||
|
|
||||||
/* set video_system */
|
/* set video_system */
|
||||||
|
int GetVideoSystem();
|
||||||
int SetVideoSystem(int video_system, bool remember = true);
|
int SetVideoSystem(int video_system, bool remember = true);
|
||||||
int SetStreamType(VIDEO_FORMAT type);
|
int SetStreamType(VIDEO_FORMAT type);
|
||||||
void SetSyncMode(AVSYNC_TYPE mode);
|
void SetSyncMode(AVSYNC_TYPE mode);
|
||||||
|
@@ -660,7 +660,11 @@ int COsdSetup::showOsdSetup()
|
|||||||
kext[0].valname = "-";
|
kext[0].valname = "-";
|
||||||
resCount = 1;
|
resCount = 1;
|
||||||
}
|
}
|
||||||
CMenuOptionChooser * osd_res = new CMenuOptionChooser(LOCALE_COLORMENU_OSD_RESOLUTION, &g_settings.osd_resolution, kext, resCount, (resCount>1), this);
|
int videoSystem = COsdHelpers::getInstance()->getVideoSystem();
|
||||||
|
bool enable = ((resCount > 1) &&
|
||||||
|
COsdHelpers::getInstance()->isVideoSystem1080(videoSystem) &&
|
||||||
|
(g_settings.video_Mode != VIDEO_STD_AUTO));
|
||||||
|
CMenuOptionChooser * osd_res = new CMenuOptionChooser(LOCALE_COLORMENU_OSD_RESOLUTION, &g_settings.osd_resolution, kext, resCount, enable, this);
|
||||||
osd_res->setHint("", LOCALE_MENU_HINT_OSD_RESOLUTION);
|
osd_res->setHint("", LOCALE_MENU_HINT_OSD_RESOLUTION);
|
||||||
osd_menu->addItem(osd_res);
|
osd_menu->addItem(osd_res);
|
||||||
#endif
|
#endif
|
||||||
@@ -1394,7 +1398,8 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data)
|
|||||||
return true;
|
return true;
|
||||||
osd_menu->hide();
|
osd_menu->hide();
|
||||||
uint32_t osd_mode = (uint32_t)*(int*)data;
|
uint32_t osd_mode = (uint32_t)*(int*)data;
|
||||||
COsdHelpers::getInstance()->changeOsdResolution(osd_mode, osd_mode);
|
COsdHelpers::getInstance()->g_settings_osd_resolution_save = osd_mode;
|
||||||
|
COsdHelpers::getInstance()->changeOsdResolution(osd_mode);
|
||||||
#if 0
|
#if 0
|
||||||
if (frameBuffer->fullHdAvailable()) {
|
if (frameBuffer->fullHdAvailable()) {
|
||||||
if (frameBuffer->osd_resolutions.empty())
|
if (frameBuffer->osd_resolutions.empty())
|
||||||
|
@@ -44,6 +44,7 @@
|
|||||||
#include <gui/widget/hintbox.h>
|
#include <gui/widget/hintbox.h>
|
||||||
#include <gui/widget/msgbox.h>
|
#include <gui/widget/msgbox.h>
|
||||||
#include <gui/osd_setup.h>
|
#include <gui/osd_setup.h>
|
||||||
|
#include <gui/osd_helpers.h>
|
||||||
|
|
||||||
#include <driver/display.h>
|
#include <driver/display.h>
|
||||||
#include <driver/screen_max.h>
|
#include <driver/screen_max.h>
|
||||||
@@ -412,7 +413,9 @@ void CVideoSettings::setVideoSettings()
|
|||||||
void CVideoSettings::setupVideoSystem(bool do_ask)
|
void CVideoSettings::setupVideoSystem(bool do_ask)
|
||||||
{
|
{
|
||||||
printf("[neutrino VideoSettings] %s setup videosystem...\n", __FUNCTION__);
|
printf("[neutrino VideoSettings] %s setup videosystem...\n", __FUNCTION__);
|
||||||
|
COsdHelpers::getInstance()->resetOsdResolution(g_settings.video_Mode);
|
||||||
videoDecoder->SetVideoSystem(g_settings.video_Mode); //FIXME
|
videoDecoder->SetVideoSystem(g_settings.video_Mode); //FIXME
|
||||||
|
COsdHelpers::getInstance()->changeOsdResolution(0, true, true);
|
||||||
|
|
||||||
if (do_ask)
|
if (do_ask)
|
||||||
{
|
{
|
||||||
@@ -422,7 +425,9 @@ void CVideoSettings::setupVideoSystem(bool do_ask)
|
|||||||
if (ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_VIDEO_MODE_OK), CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_INFO) != CMsgBox::mbrYes)
|
if (ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_VIDEO_MODE_OK), CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_INFO) != CMsgBox::mbrYes)
|
||||||
{
|
{
|
||||||
g_settings.video_Mode = prev_video_mode;
|
g_settings.video_Mode = prev_video_mode;
|
||||||
|
COsdHelpers::getInstance()->resetOsdResolution(g_settings.video_Mode);
|
||||||
videoDecoder->SetVideoSystem(g_settings.video_Mode);
|
videoDecoder->SetVideoSystem(g_settings.video_Mode);
|
||||||
|
COsdHelpers::getInstance()->changeOsdResolution(0, true, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
prev_video_mode = g_settings.video_Mode;
|
prev_video_mode = g_settings.video_Mode;
|
||||||
@@ -606,7 +611,9 @@ void CVideoSettings::nextMode(void)
|
|||||||
else if(res == messages_return::cancel_info) {
|
else if(res == messages_return::cancel_info) {
|
||||||
g_settings.video_Mode = VIDEOMENU_VIDEOMODE_OPTIONS[curmode].key;
|
g_settings.video_Mode = VIDEOMENU_VIDEOMODE_OPTIONS[curmode].key;
|
||||||
//CVFD::getInstance()->ShowText(text);
|
//CVFD::getInstance()->ShowText(text);
|
||||||
|
COsdHelpers::getInstance()->resetOsdResolution(g_settings.video_Mode);
|
||||||
videoDecoder->SetVideoSystem(g_settings.video_Mode);
|
videoDecoder->SetVideoSystem(g_settings.video_Mode);
|
||||||
|
COsdHelpers::getInstance()->changeOsdResolution(0, true, true);
|
||||||
//return;
|
//return;
|
||||||
disp_cur = 1;
|
disp_cur = 1;
|
||||||
}
|
}
|
||||||
|
@@ -81,6 +81,7 @@
|
|||||||
#include "gui/infoviewer.h"
|
#include "gui/infoviewer.h"
|
||||||
#include "gui/mediaplayer.h"
|
#include "gui/mediaplayer.h"
|
||||||
#include "gui/movieplayer.h"
|
#include "gui/movieplayer.h"
|
||||||
|
#include "gui/osd_helpers.h"
|
||||||
#include "gui/osd_setup.h"
|
#include "gui/osd_setup.h"
|
||||||
#include "gui/osdlang_setup.h"
|
#include "gui/osdlang_setup.h"
|
||||||
#include "gui/pictureviewer.h"
|
#include "gui/pictureviewer.h"
|
||||||
@@ -226,6 +227,7 @@ CNeutrinoApp::CNeutrinoApp()
|
|||||||
{
|
{
|
||||||
standby_pressed_at.tv_sec = 0;
|
standby_pressed_at.tv_sec = 0;
|
||||||
osd_resolution_tmp = -1;
|
osd_resolution_tmp = -1;
|
||||||
|
frameBufferInitialized = false;
|
||||||
|
|
||||||
frameBuffer = CFrameBuffer::getInstance();
|
frameBuffer = CFrameBuffer::getInstance();
|
||||||
frameBuffer->setIconBasePath(ICONSDIR);
|
frameBuffer->setIconBasePath(ICONSDIR);
|
||||||
@@ -719,6 +721,7 @@ int CNeutrinoApp::loadSetup(const char * fname)
|
|||||||
|
|
||||||
//screen configuration
|
//screen configuration
|
||||||
g_settings.osd_resolution = (osd_resolution_tmp == -1) ? configfile.getInt32("osd_resolution", 0) : osd_resolution_tmp;
|
g_settings.osd_resolution = (osd_resolution_tmp == -1) ? configfile.getInt32("osd_resolution", 0) : osd_resolution_tmp;
|
||||||
|
COsdHelpers::getInstance()->g_settings_osd_resolution_save = g_settings.osd_resolution;
|
||||||
g_settings.screen_StartX_crt_0 = configfile.getInt32("screen_StartX_crt_0", 80);
|
g_settings.screen_StartX_crt_0 = configfile.getInt32("screen_StartX_crt_0", 80);
|
||||||
g_settings.screen_StartY_crt_0 = configfile.getInt32("screen_StartY_crt_0", 45);
|
g_settings.screen_StartY_crt_0 = configfile.getInt32("screen_StartY_crt_0", 45);
|
||||||
g_settings.screen_EndX_crt_0 = configfile.getInt32("screen_EndX_crt_0" , 1280 - g_settings.screen_StartX_crt_0 - 1);
|
g_settings.screen_EndX_crt_0 = configfile.getInt32("screen_EndX_crt_0" , 1280 - g_settings.screen_StartX_crt_0 - 1);
|
||||||
@@ -1359,7 +1362,7 @@ void CNeutrinoApp::saveSetup(const char * fname)
|
|||||||
configfile.setInt32("channellist_show_numbers", g_settings.channellist_show_numbers);
|
configfile.setInt32("channellist_show_numbers", g_settings.channellist_show_numbers);
|
||||||
|
|
||||||
//screen configuration
|
//screen configuration
|
||||||
configfile.setInt32("osd_resolution" , g_settings.osd_resolution);
|
configfile.setInt32("osd_resolution" , COsdHelpers::getInstance()->g_settings_osd_resolution_save);
|
||||||
configfile.setInt32("screen_StartX_lcd_0", g_settings.screen_StartX_lcd_0);
|
configfile.setInt32("screen_StartX_lcd_0", g_settings.screen_StartX_lcd_0);
|
||||||
configfile.setInt32("screen_StartY_lcd_0", g_settings.screen_StartY_lcd_0);
|
configfile.setInt32("screen_StartY_lcd_0", g_settings.screen_StartY_lcd_0);
|
||||||
configfile.setInt32("screen_EndX_lcd_0" , g_settings.screen_EndX_lcd_0);
|
configfile.setInt32("screen_EndX_lcd_0" , g_settings.screen_EndX_lcd_0);
|
||||||
@@ -1870,6 +1873,7 @@ void CNeutrinoApp::CmdParser(int argc, char **argv)
|
|||||||
/**************************************************************************************
|
/**************************************************************************************
|
||||||
* CNeutrinoApp - setup the framebuffer *
|
* CNeutrinoApp - setup the framebuffer *
|
||||||
**************************************************************************************/
|
**************************************************************************************/
|
||||||
|
|
||||||
void CNeutrinoApp::SetupFrameBuffer()
|
void CNeutrinoApp::SetupFrameBuffer()
|
||||||
{
|
{
|
||||||
frameBuffer->init();
|
frameBuffer->init();
|
||||||
@@ -1898,6 +1902,10 @@ void CNeutrinoApp::SetupFrameBuffer()
|
|||||||
frameBuffer->osd_resolutions[ort].yRes,
|
frameBuffer->osd_resolutions[ort].yRes,
|
||||||
frameBuffer->osd_resolutions[ort].bpp);
|
frameBuffer->osd_resolutions[ort].bpp);
|
||||||
|
|
||||||
|
/*
|
||||||
|
setFbMode = 0;
|
||||||
|
COsdHelpers::getInstance()->changeOsdResolution(0, true);
|
||||||
|
*/
|
||||||
#else
|
#else
|
||||||
/* all other hardware ignores setMode parameters */
|
/* all other hardware ignores setMode parameters */
|
||||||
setFbMode = frameBuffer->setMode(0, 0, 0);
|
setFbMode = frameBuffer->setMode(0, 0, 0);
|
||||||
@@ -1908,6 +1916,7 @@ void CNeutrinoApp::SetupFrameBuffer()
|
|||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
frameBuffer->Clear();
|
frameBuffer->Clear();
|
||||||
|
frameBufferInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************************
|
/**************************************************************************************
|
||||||
@@ -2121,6 +2130,9 @@ int CNeutrinoApp::run(int argc, char **argv)
|
|||||||
TIMER_START();
|
TIMER_START();
|
||||||
cs_api_init();
|
cs_api_init();
|
||||||
cs_register_messenger(CSSendMessage);
|
cs_register_messenger(CSSendMessage);
|
||||||
|
#ifdef BOXMODEL_CS_HD2
|
||||||
|
cs_new_auto_videosystem();
|
||||||
|
#endif
|
||||||
|
|
||||||
g_Locale = new CLocaleManager;
|
g_Locale = new CLocaleManager;
|
||||||
|
|
||||||
@@ -2179,6 +2191,8 @@ TIMER_START();
|
|||||||
ZapStart_arg.volume = g_settings.current_volume;
|
ZapStart_arg.volume = g_settings.current_volume;
|
||||||
ZapStart_arg.webtv_xml = &g_settings.webtv_xml;
|
ZapStart_arg.webtv_xml = &g_settings.webtv_xml;
|
||||||
|
|
||||||
|
ZapStart_arg.osd_resolution = g_settings.osd_resolution;
|
||||||
|
|
||||||
CCamManager::getInstance()->SetCITuner(g_settings.ci_tuner);
|
CCamManager::getInstance()->SetCITuner(g_settings.ci_tuner);
|
||||||
/* create decoders, read channels */
|
/* create decoders, read channels */
|
||||||
bool zapit_init = CZapit::getInstance()->Start(&ZapStart_arg);
|
bool zapit_init = CZapit::getInstance()->Start(&ZapStart_arg);
|
||||||
@@ -2970,6 +2984,24 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
|
|||||||
CMoviePlayerGui::getInstance(true).showSubtitle(data);
|
CMoviePlayerGui::getInstance(true).showSubtitle(data);
|
||||||
return messages_return::handled;
|
return messages_return::handled;
|
||||||
}
|
}
|
||||||
|
if (msg == NeutrinoMessages::EVT_AUTO_SET_VIDEOSYSTEM) {
|
||||||
|
printf(">>>>>[CNeutrinoApp::%s:%d] Receive EVT_AUTO_SET_VIDEOSYSTEM message\n", __func__, __LINE__);
|
||||||
|
COsdHelpers *coh = COsdHelpers::getInstance();
|
||||||
|
int videoSystem = (int)data;
|
||||||
|
if (coh->getVideoSystem() == videoSystem)
|
||||||
|
return messages_return::handled;
|
||||||
|
|
||||||
|
if (!frameBufferInitialized) {
|
||||||
|
coh->resetOsdResolution(videoSystem);
|
||||||
|
videoDecoder->SetVideoSystem(videoSystem, false);
|
||||||
|
return messages_return::handled;
|
||||||
|
}
|
||||||
|
|
||||||
|
coh->resetOsdResolution(videoSystem);
|
||||||
|
videoDecoder->SetVideoSystem(videoSystem, false);
|
||||||
|
coh->changeOsdResolution(0, true, true);
|
||||||
|
return messages_return::handled;
|
||||||
|
}
|
||||||
if(msg == NeutrinoMessages::EVT_ZAP_COMPLETE) {
|
if(msg == NeutrinoMessages::EVT_ZAP_COMPLETE) {
|
||||||
CZapit::getInstance()->GetAudioMode(g_settings.audio_AnalogMode);
|
CZapit::getInstance()->GetAudioMode(g_settings.audio_AnalogMode);
|
||||||
if(g_settings.audio_AnalogMode < 0 || g_settings.audio_AnalogMode > 2)
|
if(g_settings.audio_AnalogMode < 0 || g_settings.audio_AnalogMode > 2)
|
||||||
|
@@ -109,6 +109,7 @@ private:
|
|||||||
bool channelList_painted;
|
bool channelList_painted;
|
||||||
int first_mode_found;
|
int first_mode_found;
|
||||||
int osd_resolution_tmp;
|
int osd_resolution_tmp;
|
||||||
|
bool frameBufferInitialized;
|
||||||
|
|
||||||
void SDT_ReloadChannels();
|
void SDT_ReloadChannels();
|
||||||
void setupNetwork( bool force= false );
|
void setupNetwork( bool force= false );
|
||||||
|
@@ -42,6 +42,7 @@ typedef struct ZAPIT_start_arg
|
|||||||
t_channel_id startchannelradio_id;
|
t_channel_id startchannelradio_id;
|
||||||
int uselastchannel;
|
int uselastchannel;
|
||||||
int video_mode;
|
int video_mode;
|
||||||
|
uint32_t osd_resolution;
|
||||||
int volume;
|
int volume;
|
||||||
int ci_clock;
|
int ci_clock;
|
||||||
std::list<std::string> *webtv_xml;
|
std::list<std::string> *webtv_xml;
|
||||||
|
@@ -76,6 +76,7 @@
|
|||||||
#include <OpenThreads/ScopedLock>
|
#include <OpenThreads/ScopedLock>
|
||||||
|
|
||||||
#include <neutrino.h>
|
#include <neutrino.h>
|
||||||
|
#include <gui/osd_helpers.h>
|
||||||
|
|
||||||
/* globals */
|
/* globals */
|
||||||
int sig_delay = 2; // seconds between signal check
|
int sig_delay = 2; // seconds between signal check
|
||||||
@@ -1664,6 +1665,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd)
|
|||||||
CZapitMessages::commandInt msg;
|
CZapitMessages::commandInt msg;
|
||||||
CBasicServer::receive_data(connfd, &msg, sizeof(msg));
|
CBasicServer::receive_data(connfd, &msg, sizeof(msg));
|
||||||
videoDecoder->SetVideoSystem(msg.val);
|
videoDecoder->SetVideoSystem(msg.val);
|
||||||
|
COsdHelpers::getInstance()->changeOsdResolution(0, true);
|
||||||
CNeutrinoApp::getInstance()->g_settings_video_Mode(msg.val);
|
CNeutrinoApp::getInstance()->g_settings_video_Mode(msg.val);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -2368,6 +2370,8 @@ bool CZapit::Start(Z_start_arg *ZapStart_arg)
|
|||||||
|
|
||||||
videoDecoder->SetDemux(videoDemux);
|
videoDecoder->SetDemux(videoDemux);
|
||||||
videoDecoder->SetVideoSystem(video_mode);
|
videoDecoder->SetVideoSystem(video_mode);
|
||||||
|
uint32_t osd_resolution = ZapStart_arg->osd_resolution;
|
||||||
|
COsdHelpers::getInstance()->changeOsdResolution(osd_resolution);
|
||||||
videoDecoder->Standby(false);
|
videoDecoder->Standby(false);
|
||||||
|
|
||||||
audioDecoder->SetDemux(audioDemux);
|
audioDecoder->SetDemux(audioDemux);
|
||||||
|
Reference in New Issue
Block a user