17#include "libmythbase/mythconfig.h"
82 if (
"ERROR_OPEN" == name)
83 return INPUT_TYPES::ERROR_OPEN;
84 if (
"ERROR_UNKNOWN" == name)
85 return INPUT_TYPES::ERROR_UNKNOWN;
86 if (
"ERROR_PROBE" == name)
87 return INPUT_TYPES::ERROR_PROBE;
89 return INPUT_TYPES::QPSK;
91 return INPUT_TYPES::DVBS;
93 return INPUT_TYPES::QAM;
95 return INPUT_TYPES::DVBC;
97 return INPUT_TYPES::OFDM;
99 return INPUT_TYPES::DVBT;
101 return INPUT_TYPES::ATSC;
103 return INPUT_TYPES::V4L;
105 return INPUT_TYPES::MPEG;
106 if (
"FIREWIRE" == name)
107 return INPUT_TYPES::FIREWIRE;
108 if (
"HDHOMERUN" == name)
109 return INPUT_TYPES::HDHOMERUN;
110 if (
"FREEBOX" == name)
111 return INPUT_TYPES::FREEBOX;
113 return INPUT_TYPES::HDPVR;
114 if (
"DVB_S2" == name)
115 return INPUT_TYPES::DVBS2;
116 if (
"IMPORT" == name)
117 return INPUT_TYPES::IMPORT;
119 return INPUT_TYPES::DEMO;
121 return INPUT_TYPES::ASI;
123 return INPUT_TYPES::CETON;
124 if (
"EXTERNAL" == name)
125 return INPUT_TYPES::EXTERNAL;
127 return INPUT_TYPES::VBOX;
128 if (
"DVB_T2" == name)
129 return INPUT_TYPES::DVBT2;
130 if (
"V4L2ENC" == name)
131 return INPUT_TYPES::V4L2ENC;
133 return INPUT_TYPES::SATIP;
134 return INPUT_TYPES::ERROR_UNKNOWN;
140 (rawtype !=
"DVB") && (rawtype !=
"FIREWIRE") &&
141 (rawtype !=
"HDHOMERUN") && (rawtype !=
"FREEBOX") &&
142 (rawtype !=
"IMPORT") && (rawtype !=
"DEMO") &&
143 (rawtype !=
"ASI") && (rawtype !=
"CETON") &&
144 (rawtype !=
"VBOX") && (rawtype !=
"SATIP");
147 static bool IsV4L(
const QString &rawtype)
149 return (rawtype ==
"V4L" || rawtype ==
"MPEG" ||
150 rawtype ==
"HDPVR" || rawtype ==
"GO7007" ||
151 rawtype ==
"MJPEG" || rawtype ==
"V4L2ENC");
156 return (!IsEncoder(rawtype) || rawtype ==
"HDPVR" ||
157 rawtype ==
"EXTERNAL");
163 (rawtype ==
"FIREWIRE") || (rawtype ==
"HDPVR") ||
164 (rawtype ==
"IMPORT") || (rawtype ==
"DEMO") ||
165 (rawtype ==
"GO7007") || (rawtype ==
"MJPEG");
167 static QString GetScanableInputTypes(
void);
169 static bool IsCableCardPresent(
uint inputid,
170 const QString &inputType);
175 (rawtype ==
"DVB") || (rawtype ==
"HDHOMERUN") ||
176 (rawtype ==
"SATIP");
182 (rawtype ==
"DVB") || (rawtype ==
"HDHOMERUN") ||
183 (rawtype ==
"ASI") || (rawtype ==
"FREEBOX") ||
184 (rawtype ==
"CETON") || (rawtype ==
"EXTERNAL") ||
185 (rawtype ==
"VBOX") || (rawtype ==
"V4L2ENC") ||
186 (rawtype ==
"SATIP");
189 static bool HasTuner(
const QString &rawtype,
const QString & device);
190 static bool IsTunerShared(
uint inputidA,
uint inputidB);
195 (rawtype ==
"DVB") || (rawtype ==
"HDHOMERUN") ||
196 (rawtype ==
"ASI") || (rawtype ==
"CETON") ||
197 (rawtype ==
"EXTERNAL") || (rawtype ==
"SATIP");
203 (rawtype ==
"V4L") || (rawtype ==
"V4L2ENC" ||
210 (rawtype ==
"FIREWIRE") || (rawtype ==
"HDPVR") ||
211 (rawtype ==
"EXTERNAL") || (rawtype ==
"V4L2ENC");
217 (rawtype ==
"FIREWIRE") || (rawtype ==
"HDHOMERUN") ||
218 (rawtype ==
"FREEBOX") || (rawtype ==
"ASI") ||
219 (rawtype ==
"IMPORT") || (rawtype ==
"DEMO") ||
220 (rawtype ==
"CETON") || (rawtype ==
"EXTERNAL") ||
221 (rawtype ==
"VBOX") || (rawtype ==
"SATIP");
226 return !(rawtype ==
"FREEBOX" || rawtype ==
"VBOX");
230 static bool IsVBoxPresent(
uint inputid);
233 static bool IsSatIPPresent(
uint inputid);
238 static int CreateCaptureCard(
const QString &videodevice,
239 const QString &audiodevice,
240 const QString &vbidevice,
241 const QString &inputtype,
246 bool dvb_wait_for_seqstart,
249 uint dvb_diseqc_type,
251 const QString &firewire_model,
252 uint firewire_connection,
253 std::chrono::milliseconds signal_timeout,
254 std::chrono::milliseconds channel_timeout,
255 uint dvb_tuning_delay,
263 static bool DeleteInput(
uint inputid);
264 static bool DeleteAllInputs(
void);
265 static std::vector<uint> GetInputList(
void);
266 static std::vector<uint> GetSchedInputList(
void);
267 static std::vector<uint> GetLiveTVInputList(
void);
272 std::vector<uint> list = GetInputIDs(videodevice);
278 static std::vector<uint> GetInputIDs(
const QString& videodevice = QString(),
279 const QString& rawtype = QString(),
280 const QString& inputname = QString(),
283 static uint GetChildInputCount(
uint inputid);
284 static std::vector<uint> GetChildInputIDs(
uint inputid);
286 static bool IsInputTypePresent(
const QString &rawtype,
288 static InputTypes GetInputTypes(
void);
289 static QStringList GetInputTypeNames(
uint sourceid);
291 static QStringList GetVideoDevices(
const QString &rawtype,
314 {
return set_on_input(col, inputid, QString::number(val)); }
319 static bool SetStartChannel(
uint inputid,
320 const QString &channum);
323 static int CreateCardInput(
uint inputid,
325 const QString &inputname,
326 const QString &externalcommand,
327 const QString &changer_device,
328 const QString &changer_model,
330 const QString &tunechan,
331 const QString &startchan,
332 const QString &displayname,
341 static std::vector<uint> GetInputIDs(
uint sourceid);
342 static bool GetInputInfo(
InputInfo &input,
343 std::vector<uint> *groupids =
nullptr);
344 static QList<InputInfo> GetAllInputInfo(
bool virtTuners);
345 static QString GetInputName(
uint inputid);
346 static QString GetStartChannel(
uint inputid);
347 static QString GetDisplayName(
uint inputid);
348 static bool IsUniqueDisplayName(
const QString &name,
349 uint exclude_inputid);
350 static uint GetSourceID(
uint inputid);
353 static uint CreateInputGroup(
const QString &name);
354 static uint CreateDeviceInputGroup(
uint inputid,
357 const QString &device);
358 static uint GetDeviceInputGroup(
uint inputid);
359 static bool LinkInputGroup(
uint inputid,
uint inputgroupid);
360 static bool UnlinkInputGroup(
uint inputid,
uint inputgroupid);
361 static std::vector<uint> GetInputGroups(
uint inputid);
362 static std::vector<uint> GetGroupInputIDs(
uint inputgroupid);
363 static std::vector<uint> GetConflictingInputs(
uint inputid);
365 static QString GetDeviceLabel(
const QString &inputtype,
366 const QString &videodevice);
367 static QString GetDeviceLabel(
uint inputid);
369 static QString ProbeSubTypeName(
uint inputid);
371 static QStringList ProbeVideoInputs(
const QString& device,
372 const QString& inputtype = QString());
373 static QStringList ProbeAudioInputs(
const QString& device,
374 const QString& inputtype = QString());
375 static void GetDeviceInputNames(
const QString &device,
376 const QString &inputtype,
377 QStringList &inputs);
380 static QStringList ProbeVideoDevices(
const QString &rawtype);
381 static void ClearVideoDeviceCache();
384 static uint CloneCard(
uint src_inputid,
uint dst_inputid);
385 static bool InputSetMaxRecordings(
uint parentid,
386 uint max_recordings);
387 static uint AddChildInput(
uint parentid);
388 static QString GetFirewireChangerNode(
uint inputid);
389 static QString GetFirewireChangerModel(
uint inputid);
392 static bool GetTimeouts(
uint inputid,
393 std::chrono::milliseconds &signal_timeout,
394 std::chrono::milliseconds &channel_timeout);
396 const QString &inputname);
398 static bool IsInNeedOfExternalInputConf(
uint inputid);
399 static uint GetQuickTuning(
uint inputid,
const QString &input_name);
404 {
return "DVB" == GetRawInputType(inputid); }
405 static bool IsDVBInputType(
const QString &inputType);
406 static QStringList ProbeDeliverySystems(
const QString &device);
407 static QStringList ProbeDeliverySystems(
int fd_frontend);
408 static QString ProbeDefaultDeliverySystem(
const QString &device);
409 static QString ProbeDVBType(
const QString &device);
410 static QString ProbeDVBFrontendName(
const QString &device);
411 static bool HasDVBCRCBug(
const QString &device);
412 static std::chrono::milliseconds GetMinSignalMonitoringDelay(
const QString &device);
416 static DTVTunerType ProbeTunerType(
const QString &device);
423 static int SetDefaultDeliverySystem(
uint inputid,
int fd);
424 static int SetDeliverySystem(
uint inputid);
426 static int SetDeliverySystem(
uint inputid,
int fd);
428 static int OpenVideoDevice(
int inputid);
429 static int OpenVideoDevice(
const QString &device);
431 static InputNames GetConfiguredDVBInputs(
const QString &device);
432 static QStringList CapabilitiesToString(uint64_t capabilities);
435 static bool hasV4L2(
int videofd);
436 static bool GetV4LInfo(
int videofd, QString &input, QString &driver,
437 uint32_t &
version, uint32_t &capabilities);
438 static bool GetV4LInfo(
int videofd, QString &input, QString &driver)
442 return GetV4LInfo(videofd, input, driver, d1, d2);
444 static InputNames ProbeV4LVideoInputs(
int videofd,
bool &ok);
445 static InputNames ProbeV4LAudioInputs(
int videofd,
bool &ok);
448 static bool HDHRdoesDVB(
const QString &device);
449 static bool HDHRdoesDVBC(
const QString &device);
450 static QString GetHDHRdesc(
const QString &device);
453 static QString GetVBoxdesc(
const QString &
id,
const QString &ip,
454 const QString &tunerNo,
const QString &tunerType);
457 static int GetASIDeviceNumber(
const QString &device,
458 QString *
error =
nullptr);
460 static uint GetASIBufferSize(
uint device_num,
461 QString *
error =
nullptr);
462 static uint GetASINumBuffers(
uint device_num,
463 QString *
error =
nullptr);
464 static int GetASIMode(
uint device_num,
465 QString *
error =
nullptr);
466 static bool SetASIMode(
uint device_num,
uint mode,
467 QString *
error =
nullptr);
470 static QStringList ProbeV4LVideoInputs(
const QString& device);
471 static QStringList ProbeV4LAudioInputs(
const QString& device);
472 static QStringList ProbeDVBInputs(
const QString& device);
MTV_PUBLIC bool set_on_input(const QString &to_set, uint inputid, const QString &value)
QMap< int, QString > InputNames
MTV_PUBLIC QString get_on_input(const QString &to_get, uint inputid)
Collection of helper utilities for input DB use.
static bool IsTunerSharingCapable(const QString &rawtype)
static bool IsUnscanable(const QString &rawtype)
static QString GetRawInputType(uint inputid)
static QString GetAudioDevice(uint inputid)
static bool IsTuningAnalog(const QString &rawtype)
INPUT_TYPES
all the different inputs
static bool IsTuningVirtual(const QString &rawtype)
static QString GetDiSEqCPosition(uint inputid)
static bool SetValue(const QString &col, uint inputid, int val)
static int GetValueInt(const QString &col, uint inputid)
static QMap< QString, QStringList > s_videoDeviceCache
static bool IsChannelChangeDiscontinuous(const QString &rawtype)
static uint GetFirstInputID(const QString &videodevice)
Convenience function for GetInputIDs()
static bool IsEITCapable(const QString &rawtype)
static QString GetDeliverySystemFromDB(uint inputid)
static bool TVOnly(uint inputid, const QString &inputname)
static QString GetVideoDevice(uint inputid)
static bool IsV4L(const QString &rawtype)
static bool IgnoreEncrypted(uint inputid, const QString &inputname)
static bool IsEncoder(const QString &rawtype)
static QString GetVBIDevice(uint inputid)
static bool IsTuningDigital(const QString &rawtype)
static QString GetHostname(uint inputid)
static bool IsSingleInputType(const QString &rawtype)
static bool IsDVB(uint inputid)
Returns true if the input is a DVB input.
static bool GetV4LInfo(int videofd, QString &input, QString &driver)
QMap< QString, QString > InputTypes
static bool SetValue(const QString &col, uint inputid, const QString &val)
static bool IsChannelReusable(const QString &rawtype)