MythTV  master
remoteencoder.cpp
Go to the documentation of this file.
1 #include <unistd.h>
2 
3 #include <QStringList>
4 
5 #include "remoteencoder.h"
6 #include "programinfo.h"
7 #include "mythdate.h"
8 #include "mythcorecontext.h"
9 #include "signalmonitor.h"
10 #include "mythdb.h"
11 #include "mythsocket.h"
12 #include "mythlogging.h"
13 
14 using namespace std;
15 
16 #define LOC QString("RemoteEncoder(%1): ").arg(m_recordernum)
17 
18 #define MAX_SIZE_CHECK 500 // in ms
19 
21 {
22  if (m_controlSock)
23  {
24  m_controlSock->DecrRef();
25  m_controlSock = nullptr;
26  }
27 }
28 
30 {
31  if (!m_controlSock)
32  {
33  LOG(VB_NETWORK, LOG_DEBUG, "RemoteEncoder::Setup(): Connecting...");
34 
35  QString ann = QString("ANN Playback %1 %2")
36  .arg(gCoreContext->GetHostName()).arg(static_cast<int>(false));
37 
38  m_controlSock = gCoreContext->ConnectCommandSocket(
39  m_remotehost, m_remoteport, ann);
40 
41  if (m_controlSock)
42  {
43  LOG(VB_NETWORK, LOG_DEBUG, "RemoteEncoder::Setup(): Connected");
44  }
45  else
46  {
47  LOG(VB_GENERAL, LOG_ERR,
48  "RemoteEncoder::Setup(): Failed to connect to backend");
49  }
50  }
51  else
52  {
53  LOG(VB_NETWORK, LOG_DEBUG, "RemoteEncoder::Setup(): Already connected");
54  }
55  return m_controlSock;
56 }
57 
59 {
60  return (m_recordernum >= 0);
61 }
62 
64 {
65  return m_recordernum;
66 }
67 
69  QStringList &strlist, uint min_reply_length)
70 {
71  QMutexLocker locker(&m_lock);
72  if (!m_controlSock)
73  Setup();
74 
75  m_backendError = false;
76 
77  if (!m_controlSock)
78  {
79  LOG(VB_GENERAL, LOG_ERR, "RemoteEncoder::SendReceiveStringList(): "
80  "Failed to reconnect with backend.");
81  m_backendError = true;
82  return false;
83  }
84 
85  if (!m_controlSock->WriteStringList(strlist))
86  {
87  LOG(VB_GENERAL, LOG_ERR, "RemoteEncoder::SendReceiveStringList(): "
88  "Failed to write data.");
89  m_backendError = true;
90  }
91 
92  if (!m_backendError &&
93  !m_controlSock->ReadStringList(strlist, MythSocket::kShortTimeout))
94  {
95  LOG(VB_GENERAL, LOG_ERR,
96  "RemoteEncoder::SendReceiveStringList(): No response.");
97  m_backendError = true;
98  }
99 
100  if (!m_backendError &&
101  min_reply_length && ((uint)strlist.size() < min_reply_length))
102  {
103  LOG(VB_GENERAL, LOG_ERR,
104  "RemoteEncoder::SendReceiveStringList(): Response too short");
105  m_backendError = true;
106  }
107 
108  if (m_backendError)
109  {
110  m_controlSock->DecrRef();
111  m_controlSock = nullptr;
112  return false;
113  }
114 
115  return true;
116 }
117 
119 {
120  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum) );
121  strlist << "IS_RECORDING";
122 
123  bool ret = SendReceiveStringList(strlist, 1);
124  if (!ret)
125  {
126  if (ok)
127  *ok = false;
128 
129  return false;
130  }
131 
132  if (ok)
133  *ok = true;
134 
135  return strlist[0].toInt() != 0;
136 }
137 
139 {
140  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum) );
141  strlist << "GET_RECORDING";
142 
143  if (SendReceiveStringList(strlist))
144  {
145  auto *proginfo = new ProgramInfo(strlist);
146  if (proginfo->GetChanID())
147  return proginfo;
148  delete proginfo;
149  }
150 
151  return nullptr;
152 }
153 
161 {
162  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum));
163  strlist << "GET_FRAMERATE";
164 
165  bool ok = false;
166  float retval = 30.0F;
167 
168  if (SendReceiveStringList(strlist, 1))
169  {
170  retval = strlist[0].toFloat(&ok);
171 
172  if (!ok)
173  {
174  LOG(VB_GENERAL, LOG_ERR, LOC +
175  QString("GetFrameRate() failed to parse response '%1'")
176  .arg(strlist[0]));
177  }
178  }
179  else
180  {
181  LOG(VB_GENERAL, LOG_ERR, LOC +
182  "GetFrameRate(): SendReceiveStringList() failed");
183  }
184 
185  return (ok) ? retval : 30.0F;
186 }
187 
196 {
197  if (m_lastTimeCheck.isRunning() && m_lastTimeCheck.elapsed() < MAX_SIZE_CHECK)
198  {
199  return m_cachedFramesWritten;
200  }
201 
202  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum));
203  strlist << "GET_FRAMES_WRITTEN";
204 
205  if (!SendReceiveStringList(strlist, 1))
206  {
207  LOG(VB_GENERAL, LOG_ERR, LOC + "GetFramesWritten() -- network error");
208  }
209  else
210  {
211  m_cachedFramesWritten = strlist[0].toLongLong();
212  m_lastTimeCheck.restart();
213  }
214 
215  return m_cachedFramesWritten;
216 }
217 
225 {
226  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum));
227  strlist << "GET_FILE_POSITION";
228 
229  if (SendReceiveStringList(strlist, 1))
230  return strlist[0].toLongLong();
231 
232  return -1;
233 }
234 
240 {
241  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum));
242  strlist << "GET_MAX_BITRATE";
243 
244  if (SendReceiveStringList(strlist, 1))
245  return strlist[0].toLongLong();
246 
247  return 20200000LL; // Peek bit rate for HD-PVR
248 }
249 
257 int64_t RemoteEncoder::GetKeyframePosition(uint64_t desired)
258 {
259  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum) );
260  strlist << "GET_KEYFRAME_POS";
261  strlist << QString::number(desired);
262 
263  if (SendReceiveStringList(strlist, 1))
264  return strlist[0].toLongLong();
265 
266  return -1;
267 }
268 
269 void RemoteEncoder::FillPositionMap(int64_t start, int64_t end,
270  frm_pos_map_t &positionMap)
271 {
272  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum));
273  strlist << "FILL_POSITION_MAP";
274  strlist << QString::number(start);
275  strlist << QString::number(end);
276 
277  if (!SendReceiveStringList(strlist))
278  return;
279 
280  for (auto it = strlist.cbegin(); it != strlist.cend(); ++it)
281  {
282  bool ok = false;
283  uint64_t index = (*it).toLongLong(&ok);
284  if (++it == strlist.end() || !ok)
285  break;
286 
287  uint64_t pos = (*it).toLongLong(&ok);
288  if (!ok)
289  break;
290 
291  positionMap[index] = pos;
292  }
293 }
294 
295 void RemoteEncoder::FillDurationMap(int64_t start, int64_t end,
296  frm_pos_map_t &durationMap)
297 {
298  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum));
299  strlist << "FILL_DURATION_MAP";
300  strlist << QString::number(start);
301  strlist << QString::number(end);
302 
303  if (!SendReceiveStringList(strlist))
304  return;
305 
306  for (auto it = strlist.cbegin(); it != strlist.cend(); ++it)
307  {
308  bool ok = false;
309  uint64_t index = (*it).toLongLong(&ok);
310  if (++it == strlist.end() || !ok)
311  break;
312 
313  uint64_t pos = (*it).toLongLong(&ok);
314  if (!ok)
315  break;
316 
317  durationMap[index] = pos;
318  }
319 }
320 
322 {
323  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum));
324  strlist << "CANCEL_NEXT_RECORDING";
325  strlist << QString::number((cancel) ? 1 : 0);
326 
327  SendReceiveStringList(strlist);
328 }
329 
331 {
332  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum));
333  strlist << "FRONTEND_READY";
334 
335  SendReceiveStringList(strlist);
336 }
337 
343 {
344  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum) );
345  strlist << "STOP_PLAYING";
346 
347  SendReceiveStringList(strlist);
348 }
349 
355 void RemoteEncoder::SpawnLiveTV(const QString& chainId, bool pip, const QString& startchan)
356 {
357  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum));
358  strlist << "SPAWN_LIVETV";
359  strlist << chainId;
360  strlist << QString::number((int)pip);
361  strlist << startchan;
362 
363  SendReceiveStringList(strlist);
364 }
365 
372 {
373  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum) );
374  strlist << "STOP_LIVETV";
375 
376  SendReceiveStringList(strlist);
377 }
378 
385 {
386  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum) );
387  strlist << "PAUSE";
388 
389  if (SendReceiveStringList(strlist))
390  m_lastinput = "";
391 }
392 
394 {
395  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum) );
396  strlist << "FINISH_RECORDING";
397 
398  SendReceiveStringList(strlist);
399 }
400 
402 {
403  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum) );
404  strlist << "SET_LIVE_RECORDING";
405  strlist << QString::number(static_cast<int>(recording));
406 
407  SendReceiveStringList(strlist);
408 }
409 
411 {
412  if (!m_lastinput.isEmpty())
413  return m_lastinput;
414 
415  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum) );
416  strlist << "GET_INPUT";
417 
418  if (SendReceiveStringList(strlist, 1))
419  {
420  m_lastinput = strlist[0];
421  return m_lastinput;
422  }
423 
424  return "Error";
425 }
426 
427 QString RemoteEncoder::SetInput(const QString& input)
428 {
429  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum) );
430  strlist << "SET_INPUT";
431  strlist << input;
432 
433  if (SendReceiveStringList(strlist, 1))
434  {
435  m_lastchannel = "";
436  m_lastinput = "";
437  return strlist[0];
438  }
439 
440  return (m_lastinput.isEmpty()) ? "Error" : m_lastinput;
441 }
442 
443 void RemoteEncoder::ToggleChannelFavorite(const QString& changroupname)
444 {
445  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum) );
446  strlist << "TOGGLE_CHANNEL_FAVORITE";
447  strlist << changroupname;
448 
449  SendReceiveStringList(strlist);
450 }
451 
452 void RemoteEncoder::ChangeChannel(int channeldirection)
453 {
454  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum) );
455  strlist << "CHANGE_CHANNEL";
456  strlist << QString::number(channeldirection);
457 
458  if (!SendReceiveStringList(strlist))
459  return;
460 
461  m_lastchannel = "";
462  m_lastinput = "";
463 }
464 
465 void RemoteEncoder::SetChannel(const QString& channel)
466 {
467  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum) );
468  strlist << "SET_CHANNEL";
469  strlist << channel;
470 
471  if (!SendReceiveStringList(strlist))
472  return;
473 
474  m_lastchannel = "";
475  m_lastinput = "";
476 }
477 
494 int RemoteEncoder::SetSignalMonitoringRate(int rate, bool notifyFrontend)
495 {
496  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum) );
497  strlist << "SET_SIGNAL_MONITORING_RATE";
498  strlist << QString::number(rate);
499  strlist << QString::number((int)notifyFrontend);
500 
501  if (SendReceiveStringList(strlist, 1))
502  return strlist[0].toInt();
503 
504  return 0;
505 }
506 
508 {
509  QMutexLocker locker(&m_lock);
510 
511  QMap<QString,uint>::const_iterator it = m_cachedTimeout.find(input);
512  if (it != m_cachedTimeout.end())
513  return *it;
514 
515  uint cardid = m_recordernum;
516  uint timeout = 0xffffffff;
518  query.prepare(
519  "SELECT channel_timeout, cardtype "
520  "FROM capturecard "
521  "WHERE capturecard.inputname = :INNAME AND "
522  " capturecard.cardid = :CARDID");
523  query.bindValue(":INNAME", input);
524  query.bindValue(":CARDID", cardid);
525  if (!query.exec() || !query.isActive())
526  MythDB::DBError("Getting timeout", query);
527  else if (query.next() &&
528  SignalMonitor::IsRequired(query.value(1).toString()))
529  timeout = max(query.value(0).toInt(), 500);
530 
531 #if 0
532  LOG(VB_PLAYBACK, LOG_DEBUG, "RemoteEncoder: " +
533  QString("GetSignalLockTimeout(%1): Set lock timeout to %2 ms")
534  .arg(cardid).arg(timeout));
535 #endif
536  m_cachedTimeout[input] = timeout;
537  return timeout;
538 }
539 
540 
542 {
543  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum) );
544 
545  if (kPictureAttribute_Contrast == attr)
546  strlist << "GET_CONTRAST";
547  else if (kPictureAttribute_Brightness == attr)
548  strlist << "GET_BRIGHTNESS";
549  else if (kPictureAttribute_Colour == attr)
550  strlist << "GET_COLOUR";
551  else if (kPictureAttribute_Hue == attr)
552  strlist << "GET_HUE";
553  else
554  return -1;
555 
556  if (SendReceiveStringList(strlist, 1))
557  return strlist[0].toInt();
558 
559  return -1;
560 }
561 
570  PictureAdjustType type, PictureAttribute attr, bool up)
571 {
572  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum) );
573 
574  if (kPictureAttribute_Contrast == attr)
575  strlist << "CHANGE_CONTRAST";
576  else if (kPictureAttribute_Brightness == attr)
577  strlist << "CHANGE_BRIGHTNESS";
578  else if (kPictureAttribute_Colour == attr)
579  strlist << "CHANGE_COLOUR";
580  else if (kPictureAttribute_Hue == attr)
581  strlist << "CHANGE_HUE";
582  else
583  return -1;
584 
585  strlist << QString::number(type);
586  strlist << QString::number((int)up);
587 
588  if (SendReceiveStringList(strlist, 1))
589  return strlist[0].toInt();
590 
591  return -1;
592 }
593 
595 {
596  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum) );
597  strlist << "CHANGE_DEINTERLACER";
598  strlist << QString::number(deint_mode);
599 
600  SendReceiveStringList(strlist);
601 }
602 
613 {
614  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum) );
615  strlist << "CHECK_CHANNEL";
616  strlist << channel;
617 
618  if (SendReceiveStringList(strlist, 1))
619  return strlist[0].toInt() != 0;
620 
621  return false;
622 }
623 
633 bool RemoteEncoder::ShouldSwitchToAnotherCard(const QString& channelid)
634 {
635  // this function returns true if the channelid is not a valid
636  // channel on the current recorder. It queries to server in order
637  // to determine this.
638  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum) );
639  strlist << "SHOULD_SWITCH_CARD";
640  strlist << channelid;
641 
642  if (SendReceiveStringList(strlist, 1))
643  return strlist[0].toInt() != 0;
644 
645  return false;
646 }
647 
655  const QString &prefix,
656  uint &complete_valid_channel_on_rec,
657  bool &is_extra_char_useful,
658  QString &needed_spacer)
659 {
660  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum) );
661  strlist << "CHECK_CHANNEL_PREFIX";
662  strlist << prefix;
663 
664  if (!SendReceiveStringList(strlist, 4))
665  return false;
666 
667  complete_valid_channel_on_rec = strlist[1].toInt();
668  is_extra_char_useful = (strlist[2].toInt() != 0);
669  needed_spacer = (strlist[3] == "X") ? "" : strlist[3];
670 
671  return strlist[0].toInt() != 0;
672 }
673 
674 static QString cleanup(const QString &str)
675 {
676  if (str == " ")
677  return "";
678  return str;
679 }
680 
681 static QString make_safe(const QString &str)
682 {
683  if (str.isEmpty())
684  return " ";
685  return str;
686 }
687 
694 void RemoteEncoder::GetNextProgram(int direction,
695  QString &title, QString &subtitle,
696  QString &desc, QString &category,
697  QString &starttime, QString &endtime,
698  QString &callsign, QString &iconpath,
699  QString &channelname, QString &chanid,
700  QString &seriesid, QString &programid)
701 {
702  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum) );
703  strlist << "GET_NEXT_PROGRAM_INFO";
704  strlist << channelname;
705  strlist << chanid;
706  strlist << QString::number(direction);
707  strlist << starttime;
708 
709  if (!SendReceiveStringList(strlist, 12))
710  return;
711 
712  title = cleanup(strlist[0]);
713  subtitle = cleanup(strlist[1]);
714  desc = cleanup(strlist[2]);
715  category = cleanup(strlist[3]);
716  starttime = cleanup(strlist[4]);
717  endtime = cleanup(strlist[5]);
718  callsign = cleanup(strlist[6]);
719  iconpath = cleanup(strlist[7]);
720  channelname = cleanup(strlist[8]);
721  chanid = cleanup(strlist[9]);
722  seriesid = cleanup(strlist[10]);
723  programid = cleanup(strlist[11]);
724 }
725 
727 {
728  QStringList strlist( QString("QUERY_RECORDER %1").arg(m_recordernum));
729  strlist << "GET_CHANNEL_INFO";
730  strlist << QString::number(chanid);
731 
732  if (!SendReceiveStringList(strlist, 6))
733  return;
734 
735  infoMap["chanid"] = cleanup(strlist[0]);
736  infoMap["sourceid"] = cleanup(strlist[1]);
737  infoMap["callsign"] = cleanup(strlist[2]);
738  infoMap["channum"] = cleanup(strlist[3]);
739  infoMap["channame"] = cleanup(strlist[4]);
740  infoMap["XMLTV"] = cleanup(strlist[5]);
741 
742  infoMap["oldchannum"] = infoMap["channum"];
743 }
744 
746 {
747  QStringList strlist( "SET_CHANNEL_INFO" );
748  strlist << make_safe(infoMap["chanid"]);
749  strlist << make_safe(infoMap["sourceid"]);
750  strlist << make_safe(infoMap["oldchannum"]);
751  strlist << make_safe(infoMap["callsign"]);
752  strlist << make_safe(infoMap["channum"]);
753  strlist << make_safe(infoMap["channame"]);
754  strlist << make_safe(infoMap["XMLTV"]);
755 
756  if (SendReceiveStringList(strlist, 1))
757  return strlist[0].toInt() != 0;
758 
759  return false;
760 }
MSqlQuery::isActive
bool isActive(void) const
Definition: mythdbcon.h:204
MSqlQuery::next
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:783
MSqlQuery
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:126
RemoteEncoder::FinishRecording
void FinishRecording(void)
Definition: remoteencoder.cpp:393
channel
QDomElement channel
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:498
RemoteEncoder::SetChannelInfo
bool SetChannelInfo(const InfoMap &infoMap)
Definition: remoteencoder.cpp:745
hardwareprofile.smolt.timeout
float timeout
Definition: smolt.py:103
RemoteEncoder::GetRecording
ProgramInfo * GetRecording(void)
Definition: remoteencoder.cpp:138
RemoteEncoder::GetRecorderNumber
int GetRecorderNumber(void) const
Definition: remoteencoder.cpp:63
mythdb.h
RemoteEncoder::ToggleChannelFavorite
void ToggleChannelFavorite(const QString &changroupname)
Definition: remoteencoder.cpp:443
PictureAdjustType
PictureAdjustType
Definition: tv.h:121
RemoteEncoder::FillDurationMap
void FillDurationMap(int64_t start, int64_t end, frm_pos_map_t &durationMap)
Definition: remoteencoder.cpp:295
title
QString title
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:633
RemoteEncoder::FrontendReady
void FrontendReady(void)
Definition: remoteencoder.cpp:330
MAX_SIZE_CHECK
#define MAX_SIZE_CHECK
Definition: remoteencoder.cpp:18
RemoteEncoder::CancelNextRecording
void CancelNextRecording(bool cancel)
Definition: remoteencoder.cpp:321
MSqlQuery::value
QVariant value(int i) const
Definition: mythdbcon.h:198
arg
arg(title).arg(filename).arg(doDelete))
kPictureAttribute_Contrast
@ kPictureAttribute_Contrast
Definition: videoouttypes.h:92
signalmonitor.h
RemoteEncoder::GetNextProgram
void GetNextProgram(int direction, QString &title, QString &subtitle, QString &desc, QString &category, QString &starttime, QString &endtime, QString &callsign, QString &iconpath, QString &channelname, QString &chanid, QString &seriesid, QString &programid)
Returns information about the program that would be seen if we changed the channel using ChangeChanne...
Definition: remoteencoder.cpp:694
MSqlQuery::exec
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:603
category
QString category
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:1419
RemoteEncoder::GetFramesWritten
long long GetFramesWritten(void)
Returns number of frames written to disk by TVRec's RecorderBase instance.
Definition: remoteencoder.cpp:195
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
RemoteEncoder::IsValidRecorder
bool IsValidRecorder(void) const
Definition: remoteencoder.cpp:58
RemoteEncoder::ChangePictureAttribute
int ChangePictureAttribute(PictureAdjustType type, PictureAttribute attr, bool up)
Changes brightness/contrast/colour/hue of a recording.
Definition: remoteencoder.cpp:569
RemoteEncoder::SetSignalMonitoringRate
int SetSignalMonitoringRate(int rate, bool notifyFrontend=true)
Sets the signal monitoring rate.
Definition: remoteencoder.cpp:494
RemoteEncoder::ShouldSwitchToAnotherCard
bool ShouldSwitchToAnotherCard(const QString &channelid)
Checks if named channel exists on current tuner, or another tuner. This only works on local recorders...
Definition: remoteencoder.cpp:633
hardwareprofile.distros.mythtv_data.data_mythtv.prefix
string prefix
Definition: data_mythtv.py:40
RemoteEncoder::Setup
bool Setup(void)
Definition: remoteencoder.cpp:29
InfoMap
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
SignalMonitor::IsRequired
static bool IsRequired(const QString &cardtype)
Returns true iff the card type supports signal monitoring.
Definition: signalmonitor.h:312
RemoteEncoder::IsRecording
bool IsRecording(bool *ok=nullptr)
Definition: remoteencoder.cpp:118
mythdate.h
programinfo.h
mythlogging.h
RemoteEncoder::GetMaxBitrate
long long GetMaxBitrate()
Returns the maximum bits per second this recorder can produce.
Definition: remoteencoder.cpp:239
MythSocket::kShortTimeout
static const uint kShortTimeout
Definition: mythsocket.h:71
RemoteEncoder::GetFrameRate
float GetFrameRate(void)
Returns recordering frame rate set by nvr.
Definition: remoteencoder.cpp:160
RemoteEncoder::SpawnLiveTV
void SpawnLiveTV(const QString &chainid, bool pip, const QString &startchan)
Tells TVRec to Spawn a "Live TV" recorder.
Definition: remoteencoder.cpp:355
MSqlQuery::InitCon
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:535
RemoteEncoder::GetInput
QString GetInput(void)
Definition: remoteencoder.cpp:410
RemoteEncoder::SendReceiveStringList
bool SendReceiveStringList(QStringList &strlist, uint min_reply_length=0)
Definition: remoteencoder.cpp:68
MythDB::DBError
static void DBError(const QString &where, const MSqlQuery &query)
Definition: mythdb.cpp:179
RemoteEncoder::ChangeChannel
void ChangeChannel(int channeldirection)
Definition: remoteencoder.cpp:452
RemoteEncoder::SetLiveRecording
void SetLiveRecording(bool recording)
Definition: remoteencoder.cpp:401
RemoteEncoder::GetSignalLockTimeout
uint GetSignalLockTimeout(const QString &input)
Definition: remoteencoder.cpp:507
kPictureAttribute_Brightness
@ kPictureAttribute_Brightness
Definition: videoouttypes.h:91
uint
unsigned int uint
Definition: compat.h:140
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:57
cleanup
static QString cleanup(const QString &str)
Definition: remoteencoder.cpp:674
RemoteEncoder::CheckChannelPrefix
bool CheckChannelPrefix(const QString &prefix, uint &complete_valid_channel_on_rec, bool &is_extra_char_useful, QString &needed_spacer)
Checks a prefix against the channels in the DB.
Definition: remoteencoder.cpp:654
frm_pos_map_t
QMap< long long, long long > frm_pos_map_t
Frame # -> File offset map.
Definition: programtypes.h:46
PictureAttribute
PictureAttribute
Definition: videoouttypes.h:88
LOC
#define LOC
Definition: remoteencoder.cpp:16
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:68
MythCoreContext::ConnectCommandSocket
MythSocket * ConnectCommandSocket(const QString &hostname, int port, const QString &announcement, bool *proto_mismatch=nullptr, int maxConnTry=-1, int setup_timeout=-1)
Definition: mythcorecontext.cpp:445
RemoteEncoder::SetChannel
void SetChannel(const QString &channel)
Definition: remoteencoder.cpp:465
mythcorecontext.h
MSqlQuery::bindValue
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:864
RemoteEncoder::StopLiveTV
void StopLiveTV(void)
Tells TVRec to stop a "Live TV" recorder.
Definition: remoteencoder.cpp:371
RemoteEncoder::GetChannelInfo
void GetChannelInfo(InfoMap &infoMap, uint chanid=0)
Definition: remoteencoder.cpp:726
RemoteEncoder::FillPositionMap
void FillPositionMap(int64_t start, int64_t end, frm_pos_map_t &positionMap)
Definition: remoteencoder.cpp:269
make_safe
static QString make_safe(const QString &str)
Definition: remoteencoder.cpp:681
remoteencoder.h
RemoteEncoder::SetInput
QString SetInput(const QString &input)
Definition: remoteencoder.cpp:427
RemoteEncoder::CheckChannel
bool CheckChannel(const QString &channel)
Checks if named channel exists on current tuner.
Definition: remoteencoder.cpp:612
RemoteEncoder::GetFilePosition
long long GetFilePosition(void)
Returns total number of bytes written by TVRec's RingBuffer.
Definition: remoteencoder.cpp:224
MythCoreContext::GetHostName
QString GetHostName(void)
Definition: mythcorecontext.cpp:856
RemoteEncoder::GetPictureAttribute
int GetPictureAttribute(PictureAttribute attr)
Definition: remoteencoder.cpp:541
RemoteEncoder::PauseRecorder
void PauseRecorder(void)
Tells TVRec to pause a recorder, used for channel and input changes.
Definition: remoteencoder.cpp:384
mythsocket.h
query
MSqlQuery query(MSqlQuery::InitCon())
kPictureAttribute_Hue
@ kPictureAttribute_Hue
Definition: videoouttypes.h:94
RemoteEncoder::ChangeDeinterlacer
void ChangeDeinterlacer(int deint_mode)
Definition: remoteencoder.cpp:594
RemoteEncoder::GetKeyframePosition
int64_t GetKeyframePosition(uint64_t desired)
Returns byte position in RingBuffer of a keyframe.
Definition: remoteencoder.cpp:257
RemoteEncoder::StopPlaying
void StopPlaying(void)
Tells TVRec to stop streaming a recording to the frontend.
Definition: remoteencoder.cpp:342
RemoteEncoder::~RemoteEncoder
~RemoteEncoder(void)
Definition: remoteencoder.cpp:20
MSqlQuery::prepare
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:808
kPictureAttribute_Colour
@ kPictureAttribute_Colour
Definition: videoouttypes.h:93