mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-02 21:48:55 +00:00
sys/dvb/gstdvbsrc.c: Actually use the code-rate-hp parameter for DVB-S.
Original commit message from CVS: * sys/dvb/gstdvbsrc.c: Actually use the code-rate-hp parameter for DVB-S. It turns out setting to AUTO does not always work ( especially in diseq situations). Set by default to FEC_AUTO.
This commit is contained in:
parent
da7548509c
commit
137951c769
2 changed files with 61 additions and 26 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2007-10-23 Zaheer Abbas Merali <zaheerabbas at merali dot org>
|
||||||
|
|
||||||
|
* sys/dvb/gstdvbsrc.c:
|
||||||
|
Actually use the code-rate-hp parameter for DVB-S.
|
||||||
|
It turns out setting to AUTO does not always work (
|
||||||
|
especially in diseq situations). Set by default to
|
||||||
|
FEC_AUTO.
|
||||||
|
|
||||||
2007-10-22 Julien MOUTTE <julien@moutte.net>
|
2007-10-22 Julien MOUTTE <julien@moutte.net>
|
||||||
|
|
||||||
* gst/flv/gstflvparse.c: (gst_flv_parse_tag_audio),
|
* gst/flv/gstflvparse.c: (gst_flv_parse_tag_audio),
|
||||||
|
|
|
@ -391,8 +391,8 @@ gst_dvbsrc_class_init (GstDvbSrcClass * klass)
|
||||||
g_object_class_install_property (gobject_class, ARG_DVBSRC_CODE_RATE_HP,
|
g_object_class_install_property (gobject_class, ARG_DVBSRC_CODE_RATE_HP,
|
||||||
g_param_spec_enum ("code-rate-hp",
|
g_param_spec_enum ("code-rate-hp",
|
||||||
"code-rate-hp",
|
"code-rate-hp",
|
||||||
"High Priority Code Rate (DVB-T)",
|
"High Priority Code Rate (DVB-T and DVB-S)",
|
||||||
GST_TYPE_DVBSRC_CODE_RATE, 1, G_PARAM_READWRITE));
|
GST_TYPE_DVBSRC_CODE_RATE, FEC_AUTO, G_PARAM_READWRITE));
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class, ARG_DVBSRC_CODE_RATE_LP,
|
g_object_class_install_property (gobject_class, ARG_DVBSRC_CODE_RATE_LP,
|
||||||
g_param_spec_enum ("code-rate-lp",
|
g_param_spec_enum ("code-rate-lp",
|
||||||
|
@ -468,7 +468,7 @@ gst_dvbsrc_init (GstDvbSrc * object, GstDvbSrcClass * klass)
|
||||||
object->sym_rate = DEFAULT_SYMBOL_RATE;
|
object->sym_rate = DEFAULT_SYMBOL_RATE;
|
||||||
object->diseqc_src = DEFAULT_DISEQC_SRC;
|
object->diseqc_src = DEFAULT_DISEQC_SRC;
|
||||||
object->send_diseqc = FALSE;
|
object->send_diseqc = FALSE;
|
||||||
|
object->code_rate_hp = FEC_AUTO;
|
||||||
object->tune_mutex = g_mutex_new ();
|
object->tune_mutex = g_mutex_new ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -865,7 +865,7 @@ read_device (int fd, int adapter_number, int frontend_number, int size)
|
||||||
} else
|
} else
|
||||||
count = count + tmp;
|
count = count + tmp;
|
||||||
} else {
|
} else {
|
||||||
fprintf (stderr, "revents = %d\n", pfd[0].revents);
|
GST_LOG ("revents = %d\n", pfd[0].revents);
|
||||||
}
|
}
|
||||||
} else if (ret_val == 0) { // poll timeout
|
} else if (ret_val == 0) { // poll timeout
|
||||||
attempts += 1;
|
attempts += 1;
|
||||||
|
@ -940,7 +940,10 @@ gst_dvbsrc_start (GstBaseSrc * bsrc)
|
||||||
GstDvbSrc *src = GST_DVBSRC (bsrc);
|
GstDvbSrc *src = GST_DVBSRC (bsrc);
|
||||||
|
|
||||||
gst_dvbsrc_open_frontend (src);
|
gst_dvbsrc_open_frontend (src);
|
||||||
gst_dvbsrc_tune (src);
|
if (!gst_dvbsrc_tune (src)) {
|
||||||
|
GST_ERROR_OBJECT (src, "Not able to lock on to the dvb channel");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
if (!gst_dvbsrc_frontend_status (src)) {
|
if (!gst_dvbsrc_frontend_status (src)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -1049,27 +1052,39 @@ static void
|
||||||
diseqc_send_msg (int fd, fe_sec_voltage_t v, struct diseqc_cmd *cmd,
|
diseqc_send_msg (int fd, fe_sec_voltage_t v, struct diseqc_cmd *cmd,
|
||||||
fe_sec_tone_mode_t t, fe_sec_mini_cmd_t b)
|
fe_sec_tone_mode_t t, fe_sec_mini_cmd_t b)
|
||||||
{
|
{
|
||||||
if (ioctl (fd, FE_SET_TONE, SEC_TONE_OFF) == -1)
|
if (ioctl (fd, FE_SET_TONE, SEC_TONE_OFF) == -1) {
|
||||||
perror ("FE_SET_TONE failed");
|
GST_ERROR ("Setting tone to off failed");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (ioctl (fd, FE_SET_VOLTAGE, v) == -1)
|
if (ioctl (fd, FE_SET_VOLTAGE, v) == -1) {
|
||||||
perror ("FE_SET_VOLTAGE failed");
|
GST_ERROR ("Setting voltage failed");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
usleep (15 * 1000);
|
||||||
|
GST_LOG ("diseqc: 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n", cmd->cmd.msg[0],
|
||||||
|
cmd->cmd.msg[1], cmd->cmd.msg[2], cmd->cmd.msg[3], cmd->cmd.msg[4],
|
||||||
|
cmd->cmd.msg[5]);
|
||||||
|
if (ioctl (fd, FE_DISEQC_SEND_MASTER_CMD, &cmd->cmd) == -1) {
|
||||||
|
GST_ERROR ("Sending diseqc command failed");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//usleep (cmd->wait * 1000);
|
||||||
|
usleep (15 * 1000);
|
||||||
|
|
||||||
|
if (ioctl (fd, FE_DISEQC_SEND_BURST, b) == -1) {
|
||||||
|
GST_ERROR ("Sending burst failed");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
usleep (15 * 1000);
|
usleep (15 * 1000);
|
||||||
|
|
||||||
if (ioctl (fd, FE_DISEQC_SEND_MASTER_CMD, &cmd->cmd) == -1)
|
if (ioctl (fd, FE_SET_TONE, t) == -1) {
|
||||||
perror ("FE_DISEQC_SEND_MASTER_CMD failed");
|
GST_ERROR ("Setting tone failed");
|
||||||
|
return;
|
||||||
usleep (cmd->wait * 1000);
|
}
|
||||||
usleep (15 * 1000);
|
|
||||||
|
|
||||||
if (ioctl (fd, FE_DISEQC_SEND_BURST, b) == -1)
|
|
||||||
perror ("FE_DISEQC_SEND_BURST failed");
|
|
||||||
|
|
||||||
usleep (15 * 1000);
|
|
||||||
|
|
||||||
if (ioctl (fd, FE_SET_TONE, t) == -1)
|
|
||||||
perror ("FE_SET_TONE failed");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1089,7 +1104,7 @@ diseqc (int secfd, int sat_no, int voltage, int tone)
|
||||||
(voltage == SEC_VOLTAGE_13 ? 0 : 2));
|
(voltage == SEC_VOLTAGE_13 ? 0 : 2));
|
||||||
|
|
||||||
diseqc_send_msg (secfd, voltage, &cmd, tone,
|
diseqc_send_msg (secfd, voltage, &cmd, tone,
|
||||||
(sat_no / 4) % 2 ? SEC_MINI_B : SEC_MINI_A);
|
sat_no % 2 ? SEC_MINI_B : SEC_MINI_A);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1099,6 +1114,8 @@ gst_dvbsrc_tune (GstDvbSrc * object)
|
||||||
{
|
{
|
||||||
struct dvb_frontend_parameters feparams;
|
struct dvb_frontend_parameters feparams;
|
||||||
fe_sec_voltage_t voltage;
|
fe_sec_voltage_t voltage;
|
||||||
|
int i;
|
||||||
|
fe_status_t status;
|
||||||
|
|
||||||
unsigned int freq = object->freq;
|
unsigned int freq = object->freq;
|
||||||
unsigned int sym_rate = object->sym_rate * 1000;
|
unsigned int sym_rate = object->sym_rate * 1000;
|
||||||
|
@ -1143,7 +1160,7 @@ gst_dvbsrc_tune (GstDvbSrc * object)
|
||||||
|
|
||||||
feparams.inversion = INVERSION_AUTO;
|
feparams.inversion = INVERSION_AUTO;
|
||||||
feparams.u.qpsk.symbol_rate = sym_rate;
|
feparams.u.qpsk.symbol_rate = sym_rate;
|
||||||
feparams.u.qpsk.fec_inner = FEC_AUTO;
|
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;
|
||||||
|
@ -1193,12 +1210,22 @@ gst_dvbsrc_tune (GstDvbSrc * object)
|
||||||
|
|
||||||
}
|
}
|
||||||
usleep (100000);
|
usleep (100000);
|
||||||
|
|
||||||
/* now tune the frontend */
|
/* now tune the frontend */
|
||||||
if (ioctl (object->fd_frontend, FE_SET_FRONTEND, &feparams) < 0) {
|
if (ioctl (object->fd_frontend, FE_SET_FRONTEND, &feparams) < 0) {
|
||||||
g_warning ("Error tuning channel: %s", strerror (errno));
|
g_warning ("Error tuning channel: %s", strerror (errno));
|
||||||
}
|
}
|
||||||
|
for (i = 0; i < 15; i++) {
|
||||||
|
usleep (100000);
|
||||||
|
if (ioctl (object->fd_frontend, FE_READ_STATUS, &status) == -1) {
|
||||||
|
perror ("FE_READ_STATUS");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (status & FE_HAS_LOCK) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!(status & FE_HAS_LOCK))
|
||||||
|
return FALSE;
|
||||||
/* set pid filters */
|
/* set pid filters */
|
||||||
gst_dvbsrc_set_pes_filters (object);
|
gst_dvbsrc_set_pes_filters (object);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue