- libarmbox: try to fix getBlank/setBlank

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2020-12-31 02:16:55 +01:00
committed by Thilo Graf
parent fcf18b73aa
commit b0aedf247f
2 changed files with 18 additions and 4 deletions

View File

@@ -398,6 +398,7 @@ cVideo::cVideo(int, void *, void *, unsigned int unit)
saturation = -1;
hue = -1;
video_standby = 0;
blank_mode = 0;
if (unit > 1) {
hal_info("%s: unit %d out of range, setting to 0\n", __func__, unit);
devnum = 0;
@@ -560,6 +561,7 @@ int cVideo::Start(void * /*PcrChannel*/, unsigned short /*PcrPid*/, unsigned sho
SetControl(VIDEO_CONTROL_HUE, hue);
hue = -1;
}
blank_mode = 0;
return res;
}
@@ -572,16 +574,22 @@ int cVideo::Stop(bool blank)
return -1;
}
playstate = blank ? VIDEO_STOPPED : VIDEO_FREEZED;
blank_mode = blank;
return fop(ioctl, VIDEO_STOP, blank ? 1 : 0);
}
int cVideo::setBlank(int)
int cVideo::setBlank(int enable)
{
fop(ioctl, VIDEO_PLAY);
fop(ioctl, VIDEO_CONTINUE);
video_still_picture sp = { NULL, 0 };
fop(ioctl, VIDEO_STILLPICTURE, &sp);
return Stop(1);
if (enable)
{
video_still_picture sp = { NULL, 0 };
fop(ioctl, VIDEO_STILLPICTURE, &sp);
return Stop(1);
}
else
return Start();
}
int cVideo::SetVideoSystem(int video_system, bool remember)
@@ -741,9 +749,14 @@ void cVideo::Standby(unsigned int bOn)
int cVideo::getBlank(void)
{
#if 0
int ret = proc_get_hex(VMPEG_xres[devnum]);
hal_debug("%s => %d\n", __func__, !ret);
return !ret;
#else
hal_debug("%s => %d\n", __func__, blank_mode);
return blank_mode;
#endif
}
void cVideo::Pig(int x, int y, int w, int h, int osd_w, int osd_h, int startx, int starty, int endx, int endy)