libspark/video: ShowPicture: add flag to indicate that input file is already m2v and doesn't need to be converted

This commit is contained in:
martii
2013-05-18 15:29:19 +02:00
parent a5cc6ae698
commit f88d47b0f2
2 changed files with 16 additions and 0 deletions

View File

@@ -364,7 +364,11 @@ void cVideo::SetVideoMode(analog_mode_t mode)
proc_put("/proc/stb/avs/0/colorformat", m, strlen(m));
}
#ifdef MARTII
void cVideo::ShowPicture(const char * fname, bool isM2V)
#else
void cVideo::ShowPicture(const char * fname)
#endif
{
lt_debug("%s(%s)\n", __func__, fname);
static const unsigned char pes_header[] = { 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x80, 0x00, 0x00 };
@@ -380,6 +384,11 @@ void cVideo::ShowPicture(const char * fname)
lt_info("%s: video_standby == true\n", __func__);
return;
}
#ifdef MARTII
if (isM2V)
strncpy(destname, fname, sizeof(destname));
else {
#endif
strcpy(destname, "/var/cache");
if (stat(fname, &st2))
{
@@ -408,6 +417,9 @@ void cVideo::ShowPicture(const char * fname)
system(cmd); /* TODO: use libavcodec to directly convert it */
utime(destname, &u);
}
#ifdef MARTII
}
#endif
mfd = open(destname, O_RDONLY);
if (mfd < 0)
{

View File

@@ -174,7 +174,11 @@ class cVideo
bool SetCECMode(VIDEO_HDMI_CEC_MODE) { return true; };
void SetCECAutoView(bool) { return; };
void SetCECAutoStandby(bool) { return; };
#ifdef MARTII
void ShowPicture(const char * fname, bool isM2V = false);
#else
void ShowPicture(const char * fname);
#endif
void StopPicture();
void Standby(unsigned int bOn);
#ifdef MARTII