screensaver: user pictureviewer instead of videoDecoder ...

... to avoid interrupts while playing and keep pictures unscaled


Origin commit data
------------------
Branch: ni/coolstream
Commit: ecc98b7def
Author: vanhofen <vanhofen@gmx.de>
Date: 2014-12-24 (Wed, 24 Dec 2014)

Origin message was:
------------------
- screensaver: user pictureviewer instead of videoDecoder ...

... to avoid interrupts while playing and keep pictures unscaled


------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2014-12-24 23:24:11 +01:00
parent f051971c61
commit 6c0e82fcd4
2 changed files with 22 additions and 7 deletions

View File

@@ -45,6 +45,7 @@ CScreenSaver::CScreenSaver()
{
thrScreenSaver = 0;
m_frameBuffer = CFrameBuffer::getInstance();
m_viewer = new CPictureViewer();
index = 0;
}
@@ -53,6 +54,8 @@ CScreenSaver::~CScreenSaver()
if(thrScreenSaver)
pthread_cancel(thrScreenSaver);
thrScreenSaver = 0;
delete m_viewer;
}
@@ -70,6 +73,18 @@ void CScreenSaver::Start()
{
CAudioMute::getInstance()->enableMuteIcon(false);
m_viewer->SetScaling((CPictureViewer::ScalingMode)g_settings.picviewer_scaling);
m_viewer->SetVisible(g_settings.screen_StartX, g_settings.screen_EndX, g_settings.screen_StartY, g_settings.screen_EndY);
if (g_settings.video_Format == 3)
m_viewer->SetAspectRatio(16.0/9);
else
m_viewer->SetAspectRatio(4.0/3);
m_viewer->Cleanup();
videoDecoder->StopPicture();
if(!thrScreenSaver)
{
//printf("[%s] %s: starting thread\n", __FILE__, __FUNCTION__);
@@ -91,6 +106,7 @@ void CScreenSaver::Stop()
pthread_cancel(thrScreenSaver);
thrScreenSaver = 0;
m_frameBuffer->paintBackground(); //clear entire screen
CAudioMute::getInstance()->enableMuteIcon(true);
}
@@ -144,15 +160,14 @@ bool CScreenSaver::ReadDir()
{
curr_lenght = strlen((*dirpointer).d_name);
string str = dir_name;
// printf("%d\n",curr_lenght);
//printf("%d\n",curr_lenght);
if(curr_lenght > 4)
{
strncpy(curr_ext,(*dirpointer).d_name+(curr_lenght-4),5);
for (p = curr_ext; *p; ++p)
*p = (char)tolower(*p);
// printf("%s\n",curr_ext);
//printf("%s\n",curr_ext);
if((strcmp(".jpg",curr_ext))
//|| (strcmp(".png",curr_ext))
//|| (strcmp(".bmp",curr_ext))
@@ -204,11 +219,10 @@ void CScreenSaver::PaintPicture()
return;
}
printf("[CScreenSaver] ShowPicture: %s\n", v_bg_files.at(index).c_str());
videoDecoder->StopPicture();
videoDecoder->ShowPicture(v_bg_files.at(index).c_str());
index++;
printf("[CScreenSaver] PaintPicture: %s\n", v_bg_files.at(index).c_str());
m_viewer->ShowImage(v_bg_files.at(index).c_str(), false /*unscaled*/);
index++;
if(index == v_bg_files.size())
index = 0;
}