void DebugCheckState(void)
{

#ifdef __WINDOWS__
	char buf[1024];
	DWORD size = sizeof(buf);

	LSTATUS err = RegGetValueA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Silicondust\\HDHomeRun", "DebugFilename", RRF_RT_REG_SZ, NULL, (PVOID) buf, &size);
	if (err != 0) {
		buf[0] = '\0';
	}

	DebugFilename = buf;

	size = sizeof(DebugExpireTime);
	err = RegGetValueA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Silicondust\\HDHomeRun", "DebugEnabled", RRF_RT_REG_QWORD, NULL, (PVOID) & DebugExpireTime, &size);
	if (err != 0) {
		DebugExpireTime = 0;
	}
#endif

	if (DebugFilename.empty()) {
		hdhomerun_debug_set_filename(dbg, NULL);
	} else {
		hdhomerun_debug_set_filename(dbg, DebugFilename.c_str());
	}

	if (DebugExpireTime > (unsigned long long)time(NULL)) {
		hdhomerun_debug_enable(dbg);
	} else {
		hdhomerun_debug_disable(dbg);
	}
}
Beispiel #2
0
void tvhdhomerun_init ( void )
{
  hdhomerun_debug_obj = hdhomerun_debug_create();

  hdhomerun_debug_set_filename(hdhomerun_debug_obj, "/tmp/tvheadend_hdhomerun_errors.log");
  hdhomerun_debug_enable(hdhomerun_debug_obj);
  TAILQ_INIT(&tvhdhomerun_discoveries);
  tvhdhomerun_device_discovery();
}
Beispiel #3
0
void tvhdhomerun_init ( void )
{
  hdhomerun_debug_obj = hdhomerun_debug_create();
  const char *s = getenv("TVHEADEND_HDHOMERUN_DEBUG");

  if (s != NULL && *s) {
    hdhomerun_debug_set_filename(hdhomerun_debug_obj, s);
    hdhomerun_debug_enable(hdhomerun_debug_obj);
  }
  idclass_register(&tvhdhomerun_device_class);
  idclass_register(&tvhdhomerun_frontend_dvbt_class);
  idclass_register(&tvhdhomerun_frontend_dvbc_class);
  idclass_register(&tvhdhomerun_frontend_atsc_t_class);
  idclass_register(&tvhdhomerun_frontend_atsc_c_class);
  TAILQ_INIT(&tvhdhomerun_discoveries);
  pthread_mutex_init(&tvhdhomerun_discovery_lock, NULL);
  tvh_cond_init(&tvhdhomerun_discovery_cond);
  tvhthread_create(&tvhdhomerun_discovery_tid, NULL,
                   tvhdhomerun_device_discovery_thread,
                   NULL, "hdhm-disc");
}