sys/dvb/gstdvbsrc.c: Add initial support for multiproto driver (not yet merged into v4l-dvb mainline yet).

Original commit message from CVS:
* sys/dvb/gstdvbsrc.c:
Add initial support for multiproto driver (not yet merged into
v4l-dvb mainline yet).
Only works for DVB-S not DVB-S2, DVB-T, DVB-C or other.
This commit is contained in:
Zaheer Abbas Merali 2008-02-23 11:56:41 +00:00
parent 7ff5e77f81
commit 0445c66a1e
3 changed files with 35 additions and 9 deletions

View file

@ -1,3 +1,10 @@
2008-02-23 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/dvb/gstdvbsrc.c:
Add initial support for multiproto driver (not yet merged into
v4l-dvb mainline yet).
Only works for DVB-S not DVB-S2, DVB-T, DVB-C or other.
2008-02-22 Tim-Philipp Müller <tim at centricular dot net> 2008-02-22 Tim-Philipp Müller <tim at centricular dot net>
* docs/plugins/inspect/plugin-alsaspdif.xml: * docs/plugins/inspect/plugin-alsaspdif.xml:

2
common

@ -1 +1 @@
Subproject commit 135628f16d422584d3454fb9c9805e7be25760a1 Subproject commit bd6ec57040fe3fa93e21ca440dfe494e3ee18555

View file

@ -36,6 +36,7 @@
#define _XOPEN_SOURCE 500 #define _XOPEN_SOURCE 500
#include <unistd.h> #include <unistd.h>
#include <linux/dvb/version.h>
#include <linux/dvb/frontend.h> #include <linux/dvb/frontend.h>
#include <linux/dvb/dmx.h> #include <linux/dvb/dmx.h>
@ -1175,7 +1176,11 @@ diseqc (int secfd, int sat_no, int voltage, int tone)
static gboolean static gboolean
gst_dvbsrc_tune (GstDvbSrc * object) gst_dvbsrc_tune (GstDvbSrc * object)
{ {
#if DVB_API_VERSION == 3 && DVB_API_VERSION_MINOR == 3
struct dvbfe_params feparams;
#else
struct dvb_frontend_parameters feparams; struct dvb_frontend_parameters feparams;
#endif
fe_sec_voltage_t voltage; fe_sec_voltage_t voltage;
int i; int i;
fe_status_t status; fe_status_t status;
@ -1202,7 +1207,6 @@ gst_dvbsrc_tune (GstDvbSrc * object)
switch (object->adapter_type) { switch (object->adapter_type) {
case FE_QPSK: case FE_QPSK:
object->tone = SEC_TONE_OFF; object->tone = SEC_TONE_OFF;
if (freq > 2200000) { if (freq > 2200000) {
// this must be an absolute frequency // this must be an absolute frequency
@ -1216,15 +1220,22 @@ gst_dvbsrc_tune (GstDvbSrc * object)
// this is an L-Band frequency // this is an L-Band frequency
feparams.frequency = freq; feparams.frequency = freq;
} }
feparams.inversion = INVERSION_AUTO;
GST_DEBUG_OBJECT (object, "api version %d.%d", DVB_API_VERSION,
DVB_API_VERSION_MINOR);
#if DVB_API_VERSION == 3 && DVB_API_VERSION_MINOR == 3
GST_DEBUG_OBJECT (object, "using multiproto driver");
feparams.delsys.dvbs.symbol_rate = sym_rate;
feparams.delsys.dvbs.fec = object->code_rate_hp;
#else
feparams.u.qpsk.symbol_rate = sym_rate;
feparams.u.qpsk.fec_inner = object->code_rate_hp;
#endif
GST_INFO_OBJECT (object, GST_INFO_OBJECT (object,
"tuning DVB-S to L-Band:%u, Pol:%d, srate=%u, 22kHz=%s", "tuning DVB-S to L-Band:%u, Pol:%d, srate=%u, 22kHz=%s",
feparams.frequency, object->pol, sym_rate, feparams.frequency, object->pol, sym_rate,
object->tone == SEC_TONE_ON ? "on" : "off"); object->tone == SEC_TONE_ON ? "on" : "off");
feparams.inversion = INVERSION_AUTO;
feparams.u.qpsk.symbol_rate = sym_rate;
feparams.u.qpsk.fec_inner = object->code_rate_hp;
if (object->pol == DVB_POL_H) if (object->pol == DVB_POL_H)
voltage = SEC_VOLTAGE_18; voltage = SEC_VOLTAGE_18;
else else
@ -1248,7 +1259,10 @@ gst_dvbsrc_tune (GstDvbSrc * object)
break; break;
case FE_OFDM: case FE_OFDM:
feparams.frequency = freq; feparams.frequency = freq;
#if DVB_API_VERSION == 3 && DVB_API_VERSION_MINOR == 3
#else
feparams.u.ofdm.bandwidth = object->bandwidth; feparams.u.ofdm.bandwidth = object->bandwidth;
feparams.u.ofdm.code_rate_HP = object->code_rate_hp; feparams.u.ofdm.code_rate_HP = object->code_rate_hp;
feparams.u.ofdm.code_rate_LP = object->code_rate_lp; feparams.u.ofdm.code_rate_LP = object->code_rate_lp;
@ -1256,6 +1270,7 @@ gst_dvbsrc_tune (GstDvbSrc * object)
feparams.u.ofdm.transmission_mode = object->transmission_mode; feparams.u.ofdm.transmission_mode = object->transmission_mode;
feparams.u.ofdm.guard_interval = object->guard_interval; feparams.u.ofdm.guard_interval = object->guard_interval;
feparams.u.ofdm.hierarchy_information = object->hierarchy_information; feparams.u.ofdm.hierarchy_information = object->hierarchy_information;
#endif
feparams.inversion = object->inversion; feparams.inversion = object->inversion;
GST_INFO_OBJECT (object, "tuning DVB-T to %d Hz\n", freq); GST_INFO_OBJECT (object, "tuning DVB-T to %d Hz\n", freq);
@ -1264,9 +1279,9 @@ gst_dvbsrc_tune (GstDvbSrc * object)
GST_INFO_OBJECT (object, "Tuning DVB-C to %d, srate=%d", freq, sym_rate); GST_INFO_OBJECT (object, "Tuning DVB-C to %d, srate=%d", freq, sym_rate);
feparams.frequency = freq; feparams.frequency = freq;
feparams.inversion = INVERSION_OFF; feparams.inversion = INVERSION_OFF;
feparams.u.qam.fec_inner = FEC_AUTO; /*feparams.u.qam.fec_inner = FEC_AUTO;
feparams.u.qam.modulation = object->modulation; feparams.u.qam.modulation = object->modulation;
feparams.u.qam.symbol_rate = sym_rate; feparams.u.qam.symbol_rate = sym_rate; */
break; break;
default: default:
g_error ("Unknown frontend type: %d", object->adapter_type); g_error ("Unknown frontend type: %d", object->adapter_type);
@ -1274,7 +1289,11 @@ gst_dvbsrc_tune (GstDvbSrc * object)
} }
usleep (100000); usleep (100000);
/* now tune the frontend */ /* now tune the frontend */
#if DVB_API_VERSION == 3 && DVB_API_VERSION_MINOR == 3
if (ioctl (object->fd_frontend, DVBFE_SET_PARAMS, &feparams) < 0) {
#else
if (ioctl (object->fd_frontend, FE_SET_FRONTEND, &feparams) < 0) { if (ioctl (object->fd_frontend, FE_SET_FRONTEND, &feparams) < 0) {
#endif
g_warning ("Error tuning channel: %s", strerror (errno)); g_warning ("Error tuning channel: %s", strerror (errno));
} }
for (i = 0; i < 15; i++) { for (i = 0; i < 15; i++) {