mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 17:01:08 +02:00
screensaver.cpp: use fallback if video decoder is busy
Origin commit data
------------------
Commit: 7c66036c2a
Author: GetAway <get-away@t-online.de>
Date: 2019-03-12 (Tue, 12 Mar 2019)
This commit is contained in:
@@ -38,6 +38,7 @@
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <memory.h>
|
#include <memory.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
@@ -50,6 +51,7 @@
|
|||||||
#include <gui/osd_helpers.h>
|
#include <gui/osd_helpers.h>
|
||||||
#include <gui/pictureviewer.h>
|
#include <gui/pictureviewer.h>
|
||||||
#include <system/debug.h>
|
#include <system/debug.h>
|
||||||
|
#include <zapit/settings.h>
|
||||||
#include <global.h>
|
#include <global.h>
|
||||||
#include <hardware/video.h>
|
#include <hardware/video.h>
|
||||||
#include <cs_api.h>
|
#include <cs_api.h>
|
||||||
@@ -1541,15 +1543,24 @@ void CFrameBuffer::Clear()
|
|||||||
//memset(getFrameBufferPointer(), 0, stride * yRes);
|
//memset(getFrameBufferPointer(), 0, stride * yRes);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CFrameBuffer::showFrame(const std::string & filename)
|
bool CFrameBuffer::showFrame(const std::string & filename, bool fallback)
|
||||||
{
|
{
|
||||||
std::string picture = getIconPath(filename, "");
|
std::string picture = getIconPath(filename, "");
|
||||||
if (access(picture.c_str(), F_OK) == 0){
|
if (access(picture.c_str(), F_OK) == 0)
|
||||||
videoDecoder->ShowPicture(picture.c_str());
|
{
|
||||||
|
if (videoDecoder->ShowPicture(picture.c_str()))
|
||||||
return true;
|
return true;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (fallback) {
|
||||||
|
return g_PicViewer->DisplayImage(picture, 0, 0, getScreenWidth(true), getScreenHeight(true), TM_NONE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
printf("[CFrameBuffer]\[%s - %d], image not found: %s\n", __func__, __LINE__, picture.c_str());
|
dprintf(DEBUG_NORMAL,"[CFrameBuffer]\[%s - %d], fallback is disabled, paint of image was stopped: %s\n", __func__, __LINE__, picture.c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
dprintf(DEBUG_NORMAL,"[CFrameBuffer]\[%s - %d], image not found: %s\n", __func__, __LINE__, picture.c_str());
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -266,7 +266,7 @@ class CFrameBuffer : public sigc::trackable
|
|||||||
void RestoreScreen(int x, int y, int dx, int dy, fb_pixel_t * const memp);
|
void RestoreScreen(int x, int y, int dx, int dy, fb_pixel_t * const memp);
|
||||||
|
|
||||||
void Clear();
|
void Clear();
|
||||||
bool showFrame(const std::string & filename);
|
bool showFrame(const std::string & filename, bool fallback = false);
|
||||||
void stopFrame();
|
void stopFrame();
|
||||||
bool loadBackgroundPic(const std::string & filename, bool show = true);
|
bool loadBackgroundPic(const std::string & filename, bool show = true);
|
||||||
bool Lock(void);
|
bool Lock(void);
|
||||||
|
Reference in New Issue
Block a user