spark: improve cVideo::ShowPicture()

* don't clear stillpicture on radio channel change
* don't show stillpicture in standby
This commit is contained in:
Stefan Seyfried
2012-02-25 22:15:37 +01:00
parent 7bf0a98909
commit 55d0d90b5b

View File

@@ -57,6 +57,7 @@ cVideo * videoDecoder = NULL;
int system_rev = 0; int system_rev = 0;
static bool hdmi_enabled = true; static bool hdmi_enabled = true;
static bool stillpicture = false;
#define VIDEO_STREAMTYPE_MPEG2 0 #define VIDEO_STREAMTYPE_MPEG2 0
#define VIDEO_STREAMTYPE_MPEG4_H264 1 #define VIDEO_STREAMTYPE_MPEG4_H264 1
@@ -260,6 +261,11 @@ int cVideo::Start(void * /*PcrChannel*/, unsigned short /*PcrPid*/, unsigned sho
int cVideo::Stop(bool blank) int cVideo::Stop(bool blank)
{ {
lt_debug("%s(%d)\n", __FUNCTION__, blank); lt_debug("%s(%d)\n", __FUNCTION__, blank);
if (stillpicture)
{
lt_debug("%s: stillpicture == true\n", __func__);
return -1;
}
playstate = blank ? VIDEO_STOPPED : VIDEO_FREEZED; playstate = blank ? VIDEO_STOPPED : VIDEO_FREEZED;
return fop(ioctl, VIDEO_STOP, blank ? 1 : 0); return fop(ioctl, VIDEO_STOP, blank ? 1 : 0);
} }
@@ -349,6 +355,12 @@ void cVideo::ShowPicture(const char * fname)
char *p; char *p;
int mfd; int mfd;
struct stat st, st2; struct stat st, st2;
if (video_standby)
{
/* does not work and the driver does not seem to like it */
lt_info("%s: video_standby == true\n", __func__);
return;
}
strcpy(destname, "/var/cache"); strcpy(destname, "/var/cache");
if (stat(fname, &st2)) if (stat(fname, &st2))
{ {
@@ -385,11 +397,13 @@ void cVideo::ShowPicture(const char * fname)
} }
fstat(mfd, &st); fstat(mfd, &st);
Stop(1);
closeDevice(); closeDevice();
openDevice(); openDevice();
if (fd >= 0) if (fd >= 0)
{ {
stillpicture = true;
if (ioctl(fd, VIDEO_SET_FORMAT, VIDEO_FORMAT_16_9) < 0) if (ioctl(fd, VIDEO_SET_FORMAT, VIDEO_FORMAT_16_9) < 0)
lt_info("%s: VIDEO_SET_FORMAT failed (%m)\n", __func__); lt_info("%s: VIDEO_SET_FORMAT failed (%m)\n", __func__);
bool seq_end_avail = false; bool seq_end_avail = false;
@@ -425,10 +439,8 @@ void cVideo::ShowPicture(const char * fname)
void cVideo::StopPicture() void cVideo::StopPicture()
{ {
#if 0 lt_debug("%s\n", __func__);
lt_debug("%s\n", __FUNCTION__); stillpicture = false;
fop(ioctl, MPEG_VID_SELECT_SOURCE, VID_SOURCE_DEMUX);
#endif
} }
void cVideo::Standby(unsigned int bOn) void cVideo::Standby(unsigned int bOn)
@@ -449,6 +461,7 @@ void cVideo::Standby(unsigned int bOn)
hdmi_out(true); hdmi_out(true);
openDevice(); openDevice();
} }
video_standby = bOn;
} }
int cVideo::getBlank(void) int cVideo::getBlank(void)