4#include "libmythbase/mythconfig.h"
7#include <linux/videodev2.h>
22 explicit V4L2util(
const QString& dev_name);
23 V4L2util(
const QString& dev_name,
const QString& vbi_dev_name);
26 bool Open(
const QString& dev_name,
const QString& vbi_dev_name =
"");
28 int FD(
void)
const {
return m_fd; }
31 bool IsOpen(
void)
const {
return m_fd >= 0; }
35 bool GetFormats(QStringList&
formats);
36 bool GetVideoStandard(QString& name)
const;
37 int GetSignalStrength(
void)
const;
38 bool GetResolution(
int& width,
int& height)
const;
39 uint32_t GetCapabilities(
void)
const;
40 QString GetDeviceName(
void)
const;
41 QString GetDriverName(
void)
const;
43 bool HasTuner(
void)
const;
44 bool HasAudioSupport(
void)
const;
45 bool HasStreaming(
void)
const;
46 bool HasSlicedVBI(
void)
const;
47 bool IsEncoder(
void)
const;
48 bool UserAdjustableResolution(
void)
const;
51 QString
CardName(
void)
const {
return m_cardName; }
52 QString
ProfileName(
void)
const {
return "V4L2:" + m_driverName; }
54 int GetStreamType(
void)
const;
55 bool SetStreamType(
int value);
57 bool SetVideoAspect(
int value);
58 bool SetVideoBitrateMode(
int value);
59 bool SetVideoBitrate(
int value);
60 bool SetVideoBitratePeak(
int value);
61 bool SetResolution(uint32_t width, uint32_t height);
63 bool SetAudioInput(
int value);
64 bool SetAudioCodec(
int value);
65 bool SetVolume(
int volume);
66 bool SetLanguageMode(
int mode);
67 bool SetAudioSamplingRate(
int value);
68 bool SetAudioBitrateL2(
int value);
71 bool StartEncoding(
void);
72 bool StopEncoding(
void);
73 bool PauseEncoding(
void);
74 bool ResumeEncoding(
void);
76 static QString StreamTypeDesc(
int value);
80 static bool OpenVBI(
const QString& vbi_dev_name);
83 int GetExtControl(
int request,
const QString& ctrl_desc =
"")
const;
84 bool SetExtControl(
int request,
int value,
const QString& ctrl_desc,
85 const QString& value_desc);
86 bool SetEncoderState(
int mode,
const QString& desc);
89 static void bitmask_toString(QString& result, uint32_t flags,
90 uint32_t mask,
const QString& desc);
91 static QString ctrlflags_toString(uint32_t flags);
92 static QString queryctrl_toString(
int type);
94 void log_qctrl(
struct v4l2_queryctrl& queryctrl,
DriverOption& drv_opt,
96 bool log_control(
struct v4l2_queryctrl& qctrl,
DriverOption& drv_opt,
108 uint32_t m_capabilities {0};
109 bool m_haveQueryExtCtrl {
false};
DriverOption::Options m_options
void log_controls(bool show_menus)
bool operator!(void) const
QString DriverName(void) const
QString ProfileName(void) const
QString CardName(void) const
QMap< category_t, DriverOption > Options
const std::array< const std::string, 8 > formats