mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 00:41:17 +02:00
- screensaver: user pictureviewer instead of videoDecoder ...
... to avoid interrupts while playing and keep pictures unscaled
This commit is contained in:
@@ -45,6 +45,7 @@ CScreenSaver::CScreenSaver()
|
|||||||
{
|
{
|
||||||
thrScreenSaver = 0;
|
thrScreenSaver = 0;
|
||||||
m_frameBuffer = CFrameBuffer::getInstance();
|
m_frameBuffer = CFrameBuffer::getInstance();
|
||||||
|
m_viewer = new CPictureViewer();
|
||||||
index = 0;
|
index = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,6 +54,8 @@ CScreenSaver::~CScreenSaver()
|
|||||||
if(thrScreenSaver)
|
if(thrScreenSaver)
|
||||||
pthread_cancel(thrScreenSaver);
|
pthread_cancel(thrScreenSaver);
|
||||||
thrScreenSaver = 0;
|
thrScreenSaver = 0;
|
||||||
|
|
||||||
|
delete m_viewer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -70,6 +73,18 @@ void CScreenSaver::Start()
|
|||||||
{
|
{
|
||||||
CAudioMute::getInstance()->enableMuteIcon(false);
|
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)
|
if(!thrScreenSaver)
|
||||||
{
|
{
|
||||||
//printf("[%s] %s: starting thread\n", __FILE__, __FUNCTION__);
|
//printf("[%s] %s: starting thread\n", __FILE__, __FUNCTION__);
|
||||||
@@ -91,6 +106,7 @@ void CScreenSaver::Stop()
|
|||||||
pthread_cancel(thrScreenSaver);
|
pthread_cancel(thrScreenSaver);
|
||||||
thrScreenSaver = 0;
|
thrScreenSaver = 0;
|
||||||
|
|
||||||
|
m_frameBuffer->paintBackground(); //clear entire screen
|
||||||
CAudioMute::getInstance()->enableMuteIcon(true);
|
CAudioMute::getInstance()->enableMuteIcon(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,15 +160,14 @@ bool CScreenSaver::ReadDir()
|
|||||||
{
|
{
|
||||||
curr_lenght = strlen((*dirpointer).d_name);
|
curr_lenght = strlen((*dirpointer).d_name);
|
||||||
string str = dir_name;
|
string str = dir_name;
|
||||||
// printf("%d\n",curr_lenght);
|
//printf("%d\n",curr_lenght);
|
||||||
if(curr_lenght > 4)
|
if(curr_lenght > 4)
|
||||||
{
|
{
|
||||||
strncpy(curr_ext,(*dirpointer).d_name+(curr_lenght-4),5);
|
strncpy(curr_ext,(*dirpointer).d_name+(curr_lenght-4),5);
|
||||||
|
|
||||||
for (p = curr_ext; *p; ++p)
|
for (p = curr_ext; *p; ++p)
|
||||||
*p = (char)tolower(*p);
|
*p = (char)tolower(*p);
|
||||||
// printf("%s\n",curr_ext);
|
//printf("%s\n",curr_ext);
|
||||||
|
|
||||||
if((strcmp(".jpg",curr_ext))
|
if((strcmp(".jpg",curr_ext))
|
||||||
//|| (strcmp(".png",curr_ext))
|
//|| (strcmp(".png",curr_ext))
|
||||||
//|| (strcmp(".bmp",curr_ext))
|
//|| (strcmp(".bmp",curr_ext))
|
||||||
@@ -204,11 +219,10 @@ void CScreenSaver::PaintPicture()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("[CScreenSaver] ShowPicture: %s\n", v_bg_files.at(index).c_str());
|
printf("[CScreenSaver] PaintPicture: %s\n", v_bg_files.at(index).c_str());
|
||||||
videoDecoder->StopPicture();
|
m_viewer->ShowImage(v_bg_files.at(index).c_str(), false /*unscaled*/);
|
||||||
videoDecoder->ShowPicture(v_bg_files.at(index).c_str());
|
|
||||||
index++;
|
|
||||||
|
|
||||||
|
index++;
|
||||||
if(index == v_bg_files.size())
|
if(index == v_bg_files.size())
|
||||||
index = 0;
|
index = 0;
|
||||||
}
|
}
|
||||||
|
@@ -39,6 +39,7 @@ class CScreenSaver
|
|||||||
static void* ScreenSaverPrg(void *arg);
|
static void* ScreenSaverPrg(void *arg);
|
||||||
vector<string> v_bg_files;
|
vector<string> v_bg_files;
|
||||||
unsigned int index;
|
unsigned int index;
|
||||||
|
CPictureViewer *m_viewer;
|
||||||
|
|
||||||
bool ReadDir();
|
bool ReadDir();
|
||||||
void PaintPicture();
|
void PaintPicture();
|
||||||
|
Reference in New Issue
Block a user