From ce756e11005d91d421dd9a9ce625d385a334e4bb Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 3 Oct 2018 18:01:22 +0200 Subject: [PATCH] src/driver/fb_generic.cpp/h: use methode showFrame() as bool function Allows the evaluation of this function for conditions if needed. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ecb119001477909cd4622cc4ce7d05fd02d975bf Author: Thilo Graf Date: 2018-10-03 (Wed, 03 Oct 2018) ------------------ This commit was generated by Migit --- src/driver/fb_generic.cpp | 11 +++++++++-- src/driver/fb_generic.h | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/driver/fb_generic.cpp b/src/driver/fb_generic.cpp index ed660fdb0..654abfcde 100644 --- a/src/driver/fb_generic.cpp +++ b/src/driver/fb_generic.cpp @@ -1538,10 +1538,17 @@ void CFrameBuffer::Clear() //memset(getFrameBufferPointer(), 0, stride * yRes); } -void CFrameBuffer::showFrame(const std::string & filename) +bool CFrameBuffer::showFrame(const std::string & filename) { std::string picture = getIconPath(filename, ""); - videoDecoder->ShowPicture(picture.c_str()); + if (access(picture.c_str(), F_OK) == 0){ + videoDecoder->ShowPicture(picture.c_str()); + return true; + } + else + printf("[CFrameBuffer]\[%s - %d], image not found: %s\n", __func__, __LINE__, picture.c_str()); + + return false; } void CFrameBuffer::stopFrame() diff --git a/src/driver/fb_generic.h b/src/driver/fb_generic.h index d1cfc3226..164470ff7 100644 --- a/src/driver/fb_generic.h +++ b/src/driver/fb_generic.h @@ -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 Clear(); - void showFrame(const std::string & filename); + bool showFrame(const std::string & filename); void stopFrame(); bool loadBackgroundPic(const std::string & filename, bool show = true); bool Lock(void);