mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
sys/dvb/gstdvbsrc.c: Post bus message about adapter type and it's capabilities, when opening the frontend.
Original commit message from CVS: * sys/dvb/gstdvbsrc.c: Post bus message about adapter type and it's capabilities, when opening the frontend. After failing to read from the dvr, post a bus message to inform the app.
This commit is contained in:
parent
df581d423f
commit
065297062c
2 changed files with 36 additions and 3 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2008-01-25 Zaheer Abbas Merali <zaheerabbas at merali dot org>
|
||||||
|
|
||||||
|
* sys/dvb/gstdvbsrc.c:
|
||||||
|
Post bus message about adapter type and it's capabilities,
|
||||||
|
when opening the frontend.
|
||||||
|
After failing to read from the dvr, post a bus message to
|
||||||
|
inform the app.
|
||||||
|
|
||||||
2008-01-25 Zaheer Abbas Merali <zaheerabbas at merali dot org>
|
2008-01-25 Zaheer Abbas Merali <zaheerabbas at merali dot org>
|
||||||
|
|
||||||
* gst/mpegtsparse/mpegtspacketizer.c:
|
* gst/mpegtsparse/mpegtspacketizer.c:
|
||||||
|
|
|
@ -679,12 +679,14 @@ gst_dvbsrc_close_devices (GstDvbSrc * object)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TODO: should open the frontend at NULL to READY to inform app the caps */
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_dvbsrc_open_frontend (GstDvbSrc * object)
|
gst_dvbsrc_open_frontend (GstDvbSrc * object)
|
||||||
{
|
{
|
||||||
struct dvb_frontend_info fe_info;
|
struct dvb_frontend_info fe_info;
|
||||||
char *adapter_desc = NULL;
|
char *adapter_desc = NULL;
|
||||||
gchar *frontend_dev;
|
gchar *frontend_dev;
|
||||||
|
GstStructure *adapter_structure;
|
||||||
|
|
||||||
frontend_dev = g_strdup_printf ("/dev/dvb/adapter%d/frontend%d",
|
frontend_dev = g_strdup_printf ("/dev/dvb/adapter%d/frontend%d",
|
||||||
object->adapter_number, object->frontend_number);
|
object->adapter_number, object->frontend_number);
|
||||||
|
@ -723,21 +725,41 @@ gst_dvbsrc_open_frontend (GstDvbSrc * object)
|
||||||
switch (object->adapter_type) {
|
switch (object->adapter_type) {
|
||||||
case FE_QPSK:
|
case FE_QPSK:
|
||||||
adapter_desc = "DVB-S";
|
adapter_desc = "DVB-S";
|
||||||
|
adapter_structure = gst_structure_new ("dvb-adapter",
|
||||||
|
"type", G_TYPE_STRING, adapter_desc,
|
||||||
|
"auto-fec", G_TYPE_BOOLEAN, fe_info.caps & FE_CAN_FEC_AUTO, NULL);
|
||||||
break;
|
break;
|
||||||
case FE_QAM:
|
case FE_QAM:
|
||||||
adapter_desc = "DVB-C";
|
adapter_desc = "DVB-C";
|
||||||
|
adapter_structure = gst_structure_new ("dvb-adapter",
|
||||||
|
"type", G_TYPE_STRING, adapter_desc,
|
||||||
|
"auto-inversion", G_TYPE_BOOLEAN,
|
||||||
|
fe_info.caps & FE_CAN_INVERSION_AUTO, "auto-qam", G_TYPE_BOOLEAN,
|
||||||
|
fe_info.caps & FE_CAN_QAM_AUTO, "auto-fec", G_TYPE_BOOLEAN,
|
||||||
|
fe_info.caps & FE_CAN_FEC_AUTO, NULL);
|
||||||
break;
|
break;
|
||||||
case FE_OFDM:
|
case FE_OFDM:
|
||||||
adapter_desc = "DVB-T";
|
adapter_desc = "DVB-T";
|
||||||
|
adapter_structure = gst_structure_new ("dvb-adapter",
|
||||||
|
"type", G_TYPE_STRING, adapter_desc,
|
||||||
|
"auto-inversion", G_TYPE_BOOLEAN,
|
||||||
|
fe_info.caps & FE_CAN_INVERSION_AUTO, "auto-qam", G_TYPE_BOOLEAN,
|
||||||
|
fe_info.caps & FE_CAN_QAM_AUTO, "auto-transmission-mode",
|
||||||
|
G_TYPE_BOOLEAN, fe_info.caps & FE_CAN_TRANSMISSION_MODE_AUTO,
|
||||||
|
"auto-guard-interval", G_TYPE_BOOLEAN,
|
||||||
|
fe_info.caps & FE_CAN_GUARD_INTERVAL_AUTO, "auto-hierarchy",
|
||||||
|
G_TYPE_BOOLEAN, fe_info.caps % FE_CAN_HIERARCHY_AUTO, "auto-fec",
|
||||||
|
G_TYPE_BOOLEAN, fe_info.caps & FE_CAN_FEC_AUTO, NULL);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
g_error ("Unknown frontend type: %d", object->adapter_type);
|
g_error ("Unknown frontend type: %d", object->adapter_type);
|
||||||
|
adapter_structure = gst_structure_new ("dvb-adapter",
|
||||||
|
"type", G_TYPE_STRING, "unknown", NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*g_signal_emit (G_OBJECT (object), gst_dvbsrc_signals[ADAPTER_TYPE_SIGNAL],
|
|
||||||
0, object->adapter_type); */
|
|
||||||
|
|
||||||
GST_INFO_OBJECT (object, "DVB card: %s ", fe_info.name);
|
GST_INFO_OBJECT (object, "DVB card: %s ", fe_info.name);
|
||||||
|
gst_element_post_message (GST_ELEMENT_CAST (object), gst_message_new_element
|
||||||
|
(GST_OBJECT (object), adapter_structure));
|
||||||
g_free (frontend_dev);
|
g_free (frontend_dev);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -923,6 +945,9 @@ gst_dvbsrc_create (GstPushSrc * element, GstBuffer ** buf)
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
} else {
|
} else {
|
||||||
GST_DEBUG_OBJECT (object, "Failed to read from device");
|
GST_DEBUG_OBJECT (object, "Failed to read from device");
|
||||||
|
gst_element_post_message (GST_ELEMENT_CAST (object),
|
||||||
|
gst_message_new_element (GST_OBJECT (object),
|
||||||
|
gst_structure_empty_new ("dvb-read-failure")));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (object->stats_interval != 0 &&
|
if (object->stats_interval != 0 &&
|
||||||
|
|
Loading…
Reference in a new issue