[SPARK] cVideo::ShowPicture: add optional argument for destination m2v

This commit is contained in:
martii
2013-09-06 22:23:22 +02:00
parent 938a6c4491
commit 1756351a36
4 changed files with 23 additions and 19 deletions

View File

@@ -211,7 +211,7 @@ void cVideo::SetVideoMode(analog_mode_t)
{
}
void cVideo::ShowPicture(const char *fname)
void cVideo::ShowPicture(const char *fname, const char *)
{
lt_info("%s(%s)\n", __func__, fname);
if (access(fname, R_OK))

View File

@@ -180,7 +180,7 @@ class cVideo : public OpenThreads::Thread
bool SetCECMode(VIDEO_HDMI_CEC_MODE) { return true; };
void SetCECAutoView(bool) { return; };
void SetCECAutoStandby(bool) { return; };
void ShowPicture(const char * fname);
void ShowPicture(const char * fname, const char *);
void StopPicture();
void Standby(unsigned int bOn);
void Pig(int x, int y, int w, int h, int osd_w = 1064, int osd_h = 600, int startx = 0, int starty = 0, int endx = 1279, int endy = 719);

View File

@@ -380,7 +380,7 @@ void cVideo::SetVideoMode(analog_mode_t mode)
proc_put("/proc/stb/avs/0/colorformat", m, strlen(m));
}
void cVideo::ShowPicture(const char * fname)
void cVideo::ShowPicture(const char * fname, const char *_destname)
{
lt_debug("%s(%s)\n", __func__, fname);
char destname[512];
@@ -397,6 +397,9 @@ void cVideo::ShowPicture(const char * fname)
const char *lastDot = strrchr(fname, '.');
if (lastDot && !strcasecmp(lastDot + 1, "m2v"))
strncpy(destname, fname, sizeof(destname));
else {
if (_destname)
strncpy(destname, _destname, sizeof(destname));
else {
strcpy(destname, "/var/cache");
if (stat(fname, &st2))
@@ -414,6 +417,7 @@ void cVideo::ShowPicture(const char * fname)
while ((p = strchr(p, '/')) != NULL)
*p = '.';
strcat(destname, ".m2v");
}
/* ...then check if it exists already... */
if (stat(destname, &st) || (st.st_mtime != st2.st_mtime) || (st.st_size == 0))
{

View File

@@ -186,7 +186,7 @@ class cVideo
bool SetCECMode(VIDEO_HDMI_CEC_MODE) { return true; };
void SetCECAutoView(bool) { return; };
void SetCECAutoStandby(bool) { return; };
void ShowPicture(const char * fname);
void ShowPicture(const char * fname, const char *_destname = NULL);
void StopPicture();
void Standby(unsigned int bOn);
void Pig(int x, int y, int w, int h, int osd_w = 1064, int osd_h = 600, int startx = 0, int starty = 0, int endx = 1279, int endy = 719);