12 #include <QStringList>
80 if (
"ERROR_OPEN" == name)
81 return INPUT_TYPES::ERROR_OPEN;
82 if (
"ERROR_UNKNOWN" == name)
83 return INPUT_TYPES::ERROR_UNKNOWN;
84 if (
"ERROR_PROBE" == name)
85 return INPUT_TYPES::ERROR_PROBE;
87 return INPUT_TYPES::QPSK;
89 return INPUT_TYPES::DVBS;
91 return INPUT_TYPES::QAM;
93 return INPUT_TYPES::DVBC;
95 return INPUT_TYPES::OFDM;
97 return INPUT_TYPES::DVBT;
99 return INPUT_TYPES::ATSC;
101 return INPUT_TYPES::V4L;
103 return INPUT_TYPES::MPEG;
104 if (
"FIREWIRE" == name)
105 return INPUT_TYPES::FIREWIRE;
106 if (
"HDHOMERUN" == name)
107 return INPUT_TYPES::HDHOMERUN;
108 if (
"FREEBOX" == name)
109 return INPUT_TYPES::FREEBOX;
111 return INPUT_TYPES::HDPVR;
112 if (
"DVB_S2" == name)
113 return INPUT_TYPES::DVBS2;
114 if (
"IMPORT" == name)
115 return INPUT_TYPES::IMPORT;
117 return INPUT_TYPES::DEMO;
119 return INPUT_TYPES::ASI;
121 return INPUT_TYPES::CETON;
122 if (
"EXTERNAL" == name)
123 return INPUT_TYPES::EXTERNAL;
125 return INPUT_TYPES::VBOX;
126 if (
"DVB_T2" == name)
127 return INPUT_TYPES::DVBT2;
128 if (
"V4L2ENC" == name)
129 return INPUT_TYPES::V4L2ENC;
131 return INPUT_TYPES::SATIP;
132 return INPUT_TYPES::ERROR_UNKNOWN;
138 (rawtype !=
"DVB") && (rawtype !=
"FIREWIRE") &&
139 (rawtype !=
"HDHOMERUN") && (rawtype !=
"FREEBOX") &&
140 (rawtype !=
"IMPORT") && (rawtype !=
"DEMO") &&
141 (rawtype !=
"ASI") && (rawtype !=
"CETON") &&
142 (rawtype !=
"VBOX") && (rawtype !=
"SATIP");
145 static bool IsV4L(
const QString &rawtype)
147 return (rawtype ==
"V4L" || rawtype ==
"MPEG" ||
148 rawtype ==
"HDPVR" || rawtype ==
"GO7007" ||
149 rawtype ==
"MJPEG" || rawtype ==
"V4L2ENC");
154 return (!IsEncoder(rawtype) || rawtype ==
"HDPVR" ||
155 rawtype ==
"EXTERNAL");
161 (rawtype ==
"FIREWIRE") || (rawtype ==
"HDPVR") ||
162 (rawtype ==
"IMPORT") || (rawtype ==
"DEMO") ||
163 (rawtype ==
"GO7007") || (rawtype ==
"MJPEG");
165 static QString GetScanableInputTypes(
void);
167 static bool IsCableCardPresent(
uint inputid,
168 const QString &inputType);
173 (rawtype ==
"DVB") || (rawtype ==
"HDHOMERUN") ||
174 (rawtype ==
"SATIP");
180 (rawtype ==
"DVB") || (rawtype ==
"HDHOMERUN") ||
181 (rawtype ==
"ASI") || (rawtype ==
"FREEBOX") ||
182 (rawtype ==
"CETON") || (rawtype ==
"EXTERNAL") ||
183 (rawtype ==
"VBOX") || (rawtype ==
"V4L2ENC") ||
184 (rawtype ==
"SATIP");
187 static bool HasTuner(
const QString &rawtype,
const QString & device);
188 static bool IsTunerShared(
uint inputidA,
uint inputidB);
193 (rawtype ==
"DVB") || (rawtype ==
"HDHOMERUN") ||
194 (rawtype ==
"ASI") || (rawtype ==
"CETON") ||
195 (rawtype ==
"EXTERNAL") || (rawtype ==
"SATIP");
201 (rawtype ==
"V4L") || (rawtype ==
"V4L2ENC" ||
208 (rawtype ==
"FIREWIRE") || (rawtype ==
"HDPVR") ||
209 (rawtype ==
"EXTERNAL") || (rawtype ==
"V4L2ENC");
215 (rawtype ==
"FIREWIRE") || (rawtype ==
"HDHOMERUN") ||
216 (rawtype ==
"FREEBOX") || (rawtype ==
"ASI") ||
217 (rawtype ==
"IMPORT") || (rawtype ==
"DEMO") ||
218 (rawtype ==
"CETON") || (rawtype ==
"EXTERNAL") ||
219 (rawtype ==
"VBOX") || (rawtype ==
"SATIP");
224 return !(rawtype ==
"FREEBOX" || rawtype ==
"VBOX");
228 static bool IsVBoxPresent(
uint inputid);
231 static bool IsSatIPPresent(
uint inputid);
236 static int CreateCaptureCard(
const QString &videodevice,
237 const QString &audiodevice,
238 const QString &vbidevice,
239 const QString &inputtype,
244 bool dvb_wait_for_seqstart,
247 uint dvb_diseqc_type,
249 const QString &firewire_model,
250 uint firewire_connection,
251 std::chrono::milliseconds signal_timeout,
252 std::chrono::milliseconds channel_timeout,
253 uint dvb_tuning_delay,
261 static bool DeleteInput(
uint inputid);
262 static bool DeleteAllInputs(
void);
263 static std::vector<uint> GetInputList(
void);
264 static std::vector<uint> GetSchedInputList(
void);
265 static std::vector<uint> GetLiveTVInputList(
void);
270 std::vector<uint> list = GetInputIDs(videodevice);
276 static std::vector<uint> GetInputIDs(
const QString& videodevice = QString(),
277 const QString& rawtype = QString(),
278 const QString& inputname = QString(),
281 static uint GetChildInputCount(
uint inputid);
282 static std::vector<uint> GetChildInputIDs(
uint inputid);
284 static bool IsInputTypePresent(
const QString &rawtype,
286 static InputTypes GetInputTypes(
void);
287 static QStringList GetInputTypeNames(
uint sourceid);
289 static QStringList GetVideoDevices(
const QString &rawtype,
312 {
return set_on_input(col, inputid, QString::number(val)); }
317 static bool SetStartChannel(
uint inputid,
318 const QString &channum);
321 static int CreateCardInput(
uint inputid,
323 const QString &inputname,
324 const QString &externalcommand,
325 const QString &changer_device,
326 const QString &changer_model,
328 const QString &tunechan,
329 const QString &startchan,
330 const QString &displayname,
339 static std::vector<uint> GetInputIDs(
uint sourceid);
340 static bool GetInputInfo(
InputInfo &input,
341 std::vector<uint> *groupids =
nullptr);
342 static QList<InputInfo> GetAllInputInfo(
bool virtTuners);
343 static QString GetInputName(
uint inputid);
344 static QString GetStartChannel(
uint inputid);
345 static QString GetDisplayName(
uint inputid);
346 static bool IsUniqueDisplayName(
const QString &name,
347 uint exclude_inputid);
348 static uint GetSourceID(
uint inputid);
351 static uint CreateInputGroup(
const QString &name);
352 static uint CreateDeviceInputGroup(
uint inputid,
355 const QString &device);
356 static uint GetDeviceInputGroup(
uint inputid);
357 static bool LinkInputGroup(
uint inputid,
uint inputgroupid);
358 static bool UnlinkInputGroup(
uint inputid,
uint inputgroupid);
359 static std::vector<uint> GetInputGroups(
uint inputid);
360 static std::vector<uint> GetGroupInputIDs(
uint inputgroupid);
361 static std::vector<uint> GetConflictingInputs(
uint inputid);
363 static QString GetDeviceLabel(
const QString &inputtype,
364 const QString &videodevice);
365 static QString GetDeviceLabel(
uint inputid);
367 static QString ProbeSubTypeName(
uint inputid);
369 static QStringList ProbeVideoInputs(
const QString& device,
370 const QString& inputtype = QString());
371 static QStringList ProbeAudioInputs(
const QString& device,
372 const QString& inputtype = QString());
373 static void GetDeviceInputNames(
const QString &device,
374 const QString &inputtype,
375 QStringList &inputs);
378 static QStringList ProbeVideoDevices(
const QString &rawtype);
379 static void ClearVideoDeviceCache();
382 static uint CloneCard(
uint src_inputid,
uint dst_inputid);
383 static bool InputSetMaxRecordings(
uint parentid,
384 uint max_recordings);
385 static uint AddChildInput(
uint parentid);
386 static QString GetFirewireChangerNode(
uint inputid);
387 static QString GetFirewireChangerModel(
uint inputid);
390 static bool GetTimeouts(
uint inputid,
391 std::chrono::milliseconds &signal_timeout,
392 std::chrono::milliseconds &channel_timeout);
393 static bool IgnoreEncrypted(
uint inputid,
394 const QString &inputname);
395 static bool TVOnly(
uint inputid,
const QString &inputname);
396 static bool IsInNeedOfExternalInputConf(
uint inputid);
397 static uint GetQuickTuning(
uint inputid,
const QString &input_name);
402 {
return "DVB" == GetRawInputType(inputid); }
403 static bool IsDVBInputType(
const QString &inputType);
404 static QStringList ProbeDeliverySystems(
const QString &device);
405 static QStringList ProbeDeliverySystems(
int fd_frontend);
406 static QString ProbeDefaultDeliverySystem(
const QString &device);
407 static QString ProbeDVBType(
const QString &device);
408 static QString ProbeDVBFrontendName(
const QString &device);
409 static bool HasDVBCRCBug(
const QString &device);
410 static std::chrono::milliseconds GetMinSignalMonitoringDelay(
const QString &device);
414 static DTVTunerType ProbeTunerType(
const QString &device);
421 static int SetDefaultDeliverySystem(
uint inputid,
int fd);
422 static int SetDeliverySystem(
uint inputid);
424 static int SetDeliverySystem(
uint inputid,
int fd);
426 static int OpenVideoDevice(
int inputid);
427 static int OpenVideoDevice(
const QString &device);
429 static InputNames GetConfiguredDVBInputs(
const QString &device);
430 static QStringList CapabilitiesToString(uint64_t capabilities);
433 static bool hasV4L2(
int videofd);
434 static bool GetV4LInfo(
int videofd, QString &input, QString &driver,
435 uint32_t &
version, uint32_t &capabilities);
436 static bool GetV4LInfo(
int videofd, QString &input, QString &driver)
440 return GetV4LInfo(videofd, input, driver, d1, d2);
442 static InputNames ProbeV4LVideoInputs(
int videofd,
bool &ok);
443 static InputNames ProbeV4LAudioInputs(
int videofd,
bool &ok);
446 static bool HDHRdoesDVB(
const QString &device);
447 static bool HDHRdoesDVBC(
const QString &device);
448 static QString GetHDHRdesc(
const QString &device);
451 static QString GetVBoxdesc(
const QString &
id,
const QString &ip,
452 const QString &tunerNo,
const QString &tunerType);
455 static int GetASIDeviceNumber(
const QString &device,
456 QString *
error =
nullptr);
458 static uint GetASIBufferSize(
uint device_num,
459 QString *
error =
nullptr);
460 static uint GetASINumBuffers(
uint device_num,
461 QString *
error =
nullptr);
462 static int GetASIMode(
uint device_num,
463 QString *
error =
nullptr);
464 static bool SetASIMode(
uint device_num,
uint mode,
465 QString *
error =
nullptr);
468 static QStringList ProbeV4LVideoInputs(
const QString& device);
469 static QStringList ProbeV4LAudioInputs(
const QString& device);
470 static QStringList ProbeDVBInputs(
const QString& device);