[vlc-commits] access: dtv: retrieve device limits
Francois Cartegnie
git at videolan.org
Tue May 10 14:51:47 CEST 2016
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri May 6 16:37:02 2016 +0200| [4d7bc96e0d4123078e726ec53112726f0646562b] | committer: Francois Cartegnie
access: dtv: retrieve device limits
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4d7bc96e0d4123078e726ec53112726f0646562b
---
modules/access/dtv/bdagraph.cpp | 12 ++++++++++++
modules/access/dtv/dtv.h | 19 +++++++++++++++++++
modules/access/dtv/linux.c | 18 ++++++++++++++++++
3 files changed, 49 insertions(+)
diff --git a/modules/access/dtv/bdagraph.cpp b/modules/access/dtv/bdagraph.cpp
index fc5e05c..26caec0 100644
--- a/modules/access/dtv/bdagraph.cpp
+++ b/modules/access/dtv/bdagraph.cpp
@@ -198,6 +198,18 @@ int dvb_tune (dvb_device_t *d)
return d->module->SubmitTuneRequest ();
}
+int dvb_fill_device_caps( dvb_device_t *d, unsigned *min, unsigned *max, unsigned *step )
+{
+
+ return -1;
+}
+
+int dvb_get_symbolrates_range( dvb_device_t *d, unsigned *min, unsigned *max, unsigned *step )
+{
+
+ return -1;
+}
+
bool dvb_set_ca_pmt (dvb_device_t *, en50221_capmt_info_t *)
{
return false;
diff --git a/modules/access/dtv/dtv.h b/modules/access/dtv/dtv.h
index 81e48c4..8dfb11b 100644
--- a/modules/access/dtv/dtv.h
+++ b/modules/access/dtv/dtv.h
@@ -62,6 +62,25 @@ bool dvb_set_ca_pmt (dvb_device_t *, en50221_capmt_info_t *);
int dvb_set_inversion (dvb_device_t *, int);
int dvb_tune (dvb_device_t *);
+typedef struct
+{
+ struct
+ {
+ unsigned min;
+ unsigned max;
+ unsigned step;
+ } frequency;
+ struct
+ {
+ unsigned min;
+ unsigned max;
+ unsigned step;
+ } symbolrate;
+ bool b_can_cam_auto;
+} dvb_device_caps_t;
+
+int dvb_fill_device_caps( dvb_device_t *, dvb_device_caps_t * );
+
#define VLC_FEC(a,b) (((a) << 16u) | (b))
#define VLC_FEC_AUTO 0xFFFFFFFF
#define VLC_GUARD(a,b) (((a) << 16u) | (b))
diff --git a/modules/access/dtv/linux.c b/modules/access/dtv/linux.c
index 1d50a64..6e21e72 100644
--- a/modules/access/dtv/linux.c
+++ b/modules/access/dtv/linux.c
@@ -704,6 +704,24 @@ int dvb_tune (dvb_device_t *d)
return dvb_set_prop (d, DTV_TUNE, 0 /* dummy */);
}
+int dvb_fill_device_caps(dvb_device_t *d, dvb_device_caps_t *caps)
+{
+ struct dvb_frontend_info info;
+ if (ioctl (d->frontend, FE_GET_INFO, &info) < 0)
+ {
+ msg_Err (d->obj, "cannot get frontend info: %s",
+ vlc_strerror_c(errno));
+ return -1;
+ }
+
+ caps->frequency.min = info.frequency_min;
+ caps->frequency.max = info.frequency_max;
+ caps->symbolrate.min = info.symbol_rate_min;
+ caps->symbolrate.max = info.symbol_rate_max;
+ caps->b_can_cam_auto = ( info.caps & FE_CAN_QAM_AUTO );
+
+ return 0;
+}
/*** DVB-C ***/
int dvb_set_dvbc (dvb_device_t *d, uint32_t freq, const char *modstr,
More information about the vlc-commits
mailing list