Skip to content

Commit 5d60b3f

Browse files
committed
Add support DVB-T/T2 and Multi PLP for GXAPI.
1 parent 668349d commit 5d60b3f

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

src/dvb.c

+26
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,8 @@ void dvb_set_demux_source(adapter *ad)
413413
return;
414414
}
415415

416+
LOG("GXAPI MUXTS: source %d, ts select %d, stream mode %d\n", (opts.ts_config >> 2) & 0x03, (opts.ts_config >> 1) & 0x01, opts.ts_config & 0x01);
417+
416418
demux.source = (opts.ts_config >> 2) & 0x03; /* DEMUX_TS1 */
417419
demux.ts_select = (opts.ts_config >> 1) & 0x01; /* FRONTEND */
418420
demux.stream_mode = opts.ts_config & 0x01; /* DEMUX_PARALLEL */
@@ -893,6 +895,9 @@ int dvb_tune(int aid, transponder *tp)
893895
int iProp = 0;
894896
adapter *ad = get_adapter(aid);
895897
int fd_frontend;
898+
#ifdef GXAPI
899+
int workmode = DVBS2_NORMAL;
900+
#endif
896901

897902
int freq = tp->freq;
898903
struct dtv_property p_cmd[20];
@@ -994,10 +999,31 @@ int dvb_tune(int aid, transponder *tp)
994999
fep.u.ofdm.bandwidth = BANDWIDTH_6_MHZ;
9951000
else if (tp->bw == 7000000)
9961001
fep.u.ofdm.bandwidth = BANDWIDTH_7_MHZ;
1002+
#ifdef GXAPI
1003+
if(tp->sys == SYS_DVBT) {
1004+
workmode = DVBT_NORMAL;
1005+
if ((ioctl(fd_frontend, FE_SET_FRONTEND_TUNE_MODE, workmode)) == -1)
1006+
LOG("FE_SET_FRONTEND_TUNE_MODE failed for fd %d: %s", fd_frontend, strerror(errno));
1007+
} else {
1008+
workmode = DVBT_AUTO_MODE;
1009+
if ((ioctl(fd_frontend, FE_SET_FRONTEND_TUNE_MODE, workmode)) == -1)
1010+
LOG("FE_SET_FRONTEND_TUNE_MODE failed for fd %d: %s", fd_frontend, strerror(errno));
1011+
}
9971012

1013+
if (tp->plp_isi >= 0) {
1014+
fep.u.ofdm.code_rate_HP = tp->plp_isi & 0xFF;
1015+
fep.u.ofdm.constellation = 0xff;
1016+
fep.u.ofdm.code_rate_LP = 0;
1017+
} else {
1018+
fep.u.ofdm.code_rate_HP = 0;
1019+
fep.u.ofdm.constellation = 0;
1020+
fep.u.ofdm.code_rate_LP = 0;
1021+
}
1022+
#else
9981023
fep.u.ofdm.code_rate_HP = tp->fec;
9991024
fep.u.ofdm.code_rate_LP = tp->fec;
10001025
fep.u.ofdm.constellation = tp->mtype;
1026+
#endif
10011027
fep.u.ofdm.transmission_mode = tp->tmode;
10021028
fep.u.ofdm.guard_interval = tp->gi;
10031029
fep.u.ofdm.hierarchy_information = HIERARCHY_AUTO;

src/dvb.h

+17
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,23 @@
3737
#endif
3838
#endif
3939

40+
#ifdef GXAPI
41+
typedef enum _FRONTEND_MODE
42+
{
43+
DVBS2_NORMAL,
44+
DVBS2_BLIND,
45+
DVBT_AUTO_MODE,
46+
DVBT_NORMAL,
47+
DVBT2_BASE,
48+
DVBT2_LITE,
49+
DVBT2_BASE_LITE,
50+
DVBC_J83A,
51+
DVBC_J83B,
52+
DTMB_C,
53+
DTMB,
54+
} FRONTEND_MODE;
55+
#endif
56+
4057
#if defined(DISABLE_LINUXDVB)
4158
typedef enum fe_delivery_system
4259
{

src/minisatip.c

-1
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,6 @@ static char gxlocalip[MAX_HOST];
548548

549549
static char *gx_getlocalip(void)
550550
{
551-
int i = 0;
552551
char opt[32] = { 0, }, str[256] = { 0, };
553552
char buf[LINE_MAX] = { 0, };
554553
FILE *fp;

0 commit comments

Comments
 (0)