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

Origin commit data
------------------
Branch: master
Commit: f88d47b0f2
Author: martii <m4rtii@gmx.de>
Date: 2013-05-18 (Sat, 18 May 2013)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
martii
2013-05-18 15:29:19 +02:00
parent 4a6cb3f750
commit 749589a583
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)); 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) void cVideo::ShowPicture(const char * fname)
#endif
{ {
lt_debug("%s(%s)\n", __func__, fname); lt_debug("%s(%s)\n", __func__, fname);
static const unsigned char pes_header[] = { 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x80, 0x00, 0x00 }; 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__); lt_info("%s: video_standby == true\n", __func__);
return; return;
} }
#ifdef MARTII
if (isM2V)
strncpy(destname, fname, sizeof(destname));
else {
#endif
strcpy(destname, "/var/cache"); strcpy(destname, "/var/cache");
if (stat(fname, &st2)) if (stat(fname, &st2))
{ {
@@ -408,6 +417,9 @@ void cVideo::ShowPicture(const char * fname)
system(cmd); /* TODO: use libavcodec to directly convert it */ system(cmd); /* TODO: use libavcodec to directly convert it */
utime(destname, &u); utime(destname, &u);
} }
#ifdef MARTII
}
#endif
mfd = open(destname, O_RDONLY); mfd = open(destname, O_RDONLY);
if (mfd < 0) if (mfd < 0)
{ {

View File

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