#define BENCHMARK_FPS
+
+// Global useful functions
+
//ULLONG htonll(ULLONG a);
//ULLONG ntohll(ULLONG a);
void MILLISLEEP(ULONG a);
long long getTimeMS();
+#include <string>
+#include <chrono>
+#include <iomanip>
+std::string tp2str(const std::chrono::time_point<std::chrono::system_clock>& tp);
+
+
int getClockRealTime(struct timespec *tp);
//#define WINDOWS_LEGACY
#ifdef DVBSDEBUG
-
-// DBG
#include <stdio.h>
-#include <string>
-#include <chrono>
-#include <iomanip>
-
-std::string tp2str(const std::chrono::time_point<std::chrono::system_clock>& tp)
-{
- auto tms = std::chrono::time_point_cast<std::chrono::milliseconds>(tp);
- std::chrono::milliseconds e = tms.time_since_epoch();
- long long c = e.count();
- time_t tt = c / 1000;
- int ttm = c % 1000;
- auto stm = std::localtime(&tt);
- std::stringstream ss;
- ss << std::put_time(stm, "%T") << "." << std::setfill('0') << std::setw(3) << ttm;
- return ss.str();
-}
-
#endif
-
-
-
+#include "defines.h"
#include "demuxer.h"
#include "osdreceiver.h"
#include "video.h"
i1 = inputLinux->init();
if (!i1) { delete inputLinux; inputLinux = NULL; }
- inputCEC = new InputCEC();
- i2 = inputCEC->init();
- if (!i2) { delete inputCEC; inputCEC = NULL; }
+// inputCEC = new InputCEC();
+// i2 = inputCEC->init();
+// if (!i2) { delete inputCEC; inputCEC = NULL; }
#endif
inputUDP = new InputUDP();
#include <stdlib.h>
#include <string.h>
#include <signal.h>
+
+#include <thread>
+#include <string>
+#include <chrono>
+#include <iomanip>
+
#ifndef WIN32
-#include <unistd.h>
-#include <endian.h>
+ #include <unistd.h>
+ #include <endian.h>
#endif
-#include <thread>
#include "defines.h"
#ifdef HANDLE_VT_SWITCHING
-#include <signal.h>
-#include <sys/ioctl.h>
-#include <linux/vt.h>
+ #include <sys/ioctl.h>
+ #include <linux/vt.h>
#endif
+
#include "log.h"
#include "timers.h"
#include "vdr.h"
#include "boxstack.h"
#include "command.h"
+#include "inputman.h"
+#include "wol.h"
+#include "vsleeptimer.h"
#ifdef VOMP_PLATTFORM_NMT
-
-#include "lednmt.h"
-#include "osddirectfb.h"
-#include "audionmt.h"
-#include "videonmt.h"
-
+ #include "lednmt.h"
+ #include "osddirectfb.h"
+ #include "audionmt.h"
+ #include "videonmt.h"
#endif
#ifdef VOMP_PLATFORM_RASPBERRY
-
-#include "ledraspberry.h"
-#include "osdopenvg.h"
-#include "audioomx.h"
-#include "videoomx.h"
-
+ #include "ledraspberry.h"
+ #include "osdopenvg.h"
+ #include "audioomx.h"
+ #include "videoomx.h"
#endif
-#include "inputman.h"
-#include "wol.h"
-#include "vsleeptimer.h"
#ifndef WIN32 // FIXME do we need any if WIN32 stuff in here? windows has own winmain file
delete sleeptimer;
logger->log("Core", Log::NOTICE, "Sleeptimer module shut down");
}
+
#ifdef HANDLE_VT_SWITCHING
ioctl(fdtty, VT_UNLOCKSWITCH, 1);
close(fdtty);
if (a > b) return a;
else return b;
}
+
+std::string tp2str(const std::chrono::time_point<std::chrono::system_clock>& tp)
+{
+ auto tms = std::chrono::time_point_cast<std::chrono::milliseconds>(tp);
+ std::chrono::milliseconds e = tms.time_since_epoch();
+ long long c = e.count();
+ time_t tt = c / 1000;
+ int ttm = c % 1000;
+ auto stm = std::localtime(&tt);
+ std::stringstream ss;
+ ss << std::put_time(stm, "%T") << "." << std::setfill('0') << std::setw(3) << ttm;
+ return ss.str();
+}
{
std::chrono::system_clock::time_point fireTime = std::chrono::system_clock::now();
fireTime += std::chrono::seconds(requestedSecs);
- //fireTime += std::chrono::nanoseconds(requestedNSecs);
- fireTime += std::chrono::duration_cast<std::chrono::seconds>(std::chrono::nanoseconds(requestedNSecs));
-
+ fireTime += std::chrono::nanoseconds(requestedNSecs);
return setTimerC(client, clientReference, fireTime);
}
bool Timers::setTimerT(TimerReceiver* client, int clientReference, long int requestedTime, long int requestedTimeNSecs)
{
std::chrono::system_clock::time_point fireTime = std::chrono::system_clock::from_time_t(requestedTime);
- //fireTime += std::chrono::nanoseconds(requestedTimeNSecs);
- fireTime += std::chrono::duration_cast<std::chrono::seconds>(std::chrono::nanoseconds(requestedTimeNSecs));
-
+ fireTime += std::chrono::nanoseconds(requestedTimeNSecs);
return setTimerC(client, clientReference, fireTime);
}
boxstack->update(this, &barRegion);
- if (action_in != -1) {
- timers->cancelTimer(this, 1);
+ if (action_in != -1)
+ {
+ timers->cancelTimer(this, 1);
+ if ((playerState == PlayerVideoRec::S_FFWD) || (playerState == PlayerVideoRec::S_FBWD))
+ barScanHold = true;
+ else
+ barScanHold = false;
- if ((playerState == PlayerVideoRec::S_FFWD) || (playerState == PlayerVideoRec::S_FBWD)) barScanHold = true;
- else barScanHold = false;
+ if (!barGenHold && !barScanHold && !barVasHold)
+ timers->setTimerD(this, 1, 4);
- if (!barGenHold && !barScanHold && !barVasHold) timers->setTimerD(this, 1, 4);
+ Log::getInstance()->log("VVideoRec", Log::DEBUG, "player state: %i", playerState);
- timers->setTimerD(this, 2, 0, 200000000);
+ if ((playerState == PlayerVideoRec::S_PAUSE_P) || (playerState == PlayerVideoRec::S_PAUSE_I))
+ timers->cancelTimer(this, 2);
+ else
+ timers->setTimerD(this, 2, 0, 200'000'000);
}
}
#else
doBar(-1);
#endif
- timers->setTimerD(this, 2, 0, 200000000);
+ timers->setTimerD(this, 2, 0, 200'000'000);
break;
}
}