diff options
author | horchi <vdr@jwendel.de> | 2018-10-04 18:51:40 +0200 |
---|---|---|
committer | horchi <vdr@jwendel.de> | 2018-10-04 18:51:40 +0200 |
commit | f52393ce3d48203bdf1a340bd4db12a3dc8a20a3 (patch) | |
tree | 3f3f2a5d37cd1e5a74d020365783a2613853894d /seduthread.c | |
parent | de40508e84fa064b369dea17c6d74e7ceba3fbb3 (diff) | |
download | vdr-plugin-seduatmo-f52393ce3d48203bdf1a340bd4db12a3dc8a20a3.tar.gz vdr-plugin-seduatmo-f52393ce3d48203bdf1a340bd4db12a3dc8a20a3.tar.bz2 |
2018-10-04: Version 0.0.6\n Added support of softhdcuvid plugin\n\n0.0.6
Diffstat (limited to 'seduthread.c')
-rw-r--r-- | seduthread.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/seduthread.c b/seduthread.c index e558345..93a8054 100644 --- a/seduthread.c +++ b/seduthread.c @@ -66,6 +66,10 @@ void cSeduThread::Action() tell(0, "atmo Thread started (pid=%d)", getpid()); + // wait for softhddevice started (assume no retry action below needed) + + sleep(5); + loopActive = true; pixAverage = new PixQueue[cfg.ledCount]; @@ -75,8 +79,9 @@ void cSeduThread::Action() { if (!sedu.isOpen()) { - if (last > time(0)-30) + if (last > time(0)-10) { + // we are here on sedu interface trouble and on grab-plugin interface trouble! waitCondition.TimedWait(mutex, 1000); // wait time in ms continue; } @@ -142,18 +147,27 @@ void cSeduThread::Action() int cSeduThread::grabImage() { + static cPlugin* softHdPlugin = 0; + + if (!softHdPlugin) + { + softHdPlugin = cPluginManager::GetPlugin("softhddevice"); + + if (!softHdPlugin) + softHdPlugin = cPluginManager::GetPlugin("softhdcuvid"); + + int softHdGrabService = (softHdPlugin && softHdPlugin->Service(ATMO1_GRAB_SERVICE, 0)); + + if (!softHdGrabService) + return error("Can't find grab service neither at softhddevice nor at softhdcuvid " + "- aborting grab, retrying in 10 seconds!"); + } + SoftHDDevice_AtmoGrabService_v1_1_t req; free(image); image = 0; - cPlugin* softHdPlugin = cPluginManager::GetPlugin("softhddevice"); - int softHdGrabService = (softHdPlugin && softHdPlugin->Service(ATMO1_GRAB_SERVICE, 0)); - - if (!softHdGrabService) - return error("Can't find softhddevice %s, aborting grab, retrying in 10 seconds!", - softHdPlugin ? "service" : "plugin"); - // grab image at sofhddevice req.width = cfg.grabWidth; |