From 70e2f30a8c306db213ff79ad201c669c227dbd71 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 25 Feb 2012 22:15:37 +0100 Subject: [PATCH] spark: improve cVideo::ShowPicture() * don't clear stillpicture on radio channel change * don't show stillpicture in standby Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/55d0d90b5b7144ef3710731a49c1e59a3eb1ca8d Author: Stefan Seyfried Date: 2012-02-25 (Sat, 25 Feb 2012) ------------------ This commit was generated by Migit --- libspark/video.cpp | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/libspark/video.cpp b/libspark/video.cpp index dcbe987..cdaa9c1 100644 --- a/libspark/video.cpp +++ b/libspark/video.cpp @@ -57,6 +57,7 @@ cVideo * videoDecoder = NULL; int system_rev = 0; static bool hdmi_enabled = true; +static bool stillpicture = false; #define VIDEO_STREAMTYPE_MPEG2 0 #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) { lt_debug("%s(%d)\n", __FUNCTION__, blank); + if (stillpicture) + { + lt_debug("%s: stillpicture == true\n", __func__); + return -1; + } playstate = blank ? VIDEO_STOPPED : VIDEO_FREEZED; return fop(ioctl, VIDEO_STOP, blank ? 1 : 0); } @@ -349,6 +355,12 @@ void cVideo::ShowPicture(const char * fname) char *p; int mfd; 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"); if (stat(fname, &st2)) { @@ -385,11 +397,13 @@ void cVideo::ShowPicture(const char * fname) } fstat(mfd, &st); - Stop(1); closeDevice(); openDevice(); + if (fd >= 0) { + stillpicture = true; + if (ioctl(fd, VIDEO_SET_FORMAT, VIDEO_FORMAT_16_9) < 0) lt_info("%s: VIDEO_SET_FORMAT failed (%m)\n", __func__); bool seq_end_avail = false; @@ -425,10 +439,8 @@ void cVideo::ShowPicture(const char * fname) void cVideo::StopPicture() { -#if 0 - lt_debug("%s\n", __FUNCTION__); - fop(ioctl, MPEG_VID_SELECT_SOURCE, VID_SOURCE_DEMUX); -#endif + lt_debug("%s\n", __func__); + stillpicture = false; } void cVideo::Standby(unsigned int bOn) @@ -449,6 +461,7 @@ void cVideo::Standby(unsigned int bOn) hdmi_out(true); openDevice(); } + video_standby = bOn; } int cVideo::getBlank(void)