summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorZaheer Abbas Merali <zaheerabbas@merali.org>2008-01-25 17:35:46 +0000
committerZaheer Abbas Merali <zaheerabbas@merali.org>2008-01-25 17:35:46 +0000
commitef421fee72539e6202c8535687f15da2c3d4d1a7 (patch)
treecaed3bb3dc13afb1d09aa4978aae4d3ecb15f70c /sys
parentb65d97e2e1194dd017b596b8d16bd8181d54f92a (diff)
downloadgst-plugins-bad-ef421fee72539e6202c8535687f15da2c3d4d1a7.tar.gz
gst-plugins-bad-ef421fee72539e6202c8535687f15da2c3d4d1a7.tar.bz2
gst-plugins-bad-ef421fee72539e6202c8535687f15da2c3d4d1a7.zip
sys/dvb/gstdvbsrc.c: Open frontend in NULL->READY so caps about dvb adapter can be seen by the app.
Original commit message from CVS: * sys/dvb/gstdvbsrc.c: Open frontend in NULL->READY so caps about dvb adapter can be seen by the app.
Diffstat (limited to 'sys')
-rw-r--r--sys/dvb/gstdvbsrc.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/sys/dvb/gstdvbsrc.c b/sys/dvb/gstdvbsrc.c
index 032cbd2b..9144d12d 100644
--- a/sys/dvb/gstdvbsrc.c
+++ b/sys/dvb/gstdvbsrc.c
@@ -271,6 +271,9 @@ static GstFlowReturn gst_dvbsrc_create (GstPushSrc * element,
static gboolean gst_dvbsrc_start (GstBaseSrc * bsrc);
static gboolean gst_dvbsrc_stop (GstBaseSrc * bsrc);
+static GstStateChangeReturn gst_dvbsrc_change_state (GstElement * element,
+ GstStateChange transition);
+
static gboolean gst_dvbsrc_unlock (GstBaseSrc * bsrc);
static gboolean gst_dvbsrc_is_seekable (GstBaseSrc * bsrc);
static gboolean gst_dvbsrc_get_size (GstBaseSrc * src, guint64 * size);
@@ -330,6 +333,7 @@ gst_dvbsrc_class_init (GstDvbSrcClass * klass)
gobject_class->get_property = gst_dvbsrc_get_property;
gobject_class->finalize = gst_dvbsrc_finalize;
+ gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_dvbsrc_change_state);
gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_dvbsrc_start);
gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_dvbsrc_stop);
gstbasesrc_class->unlock = GST_DEBUG_FUNCPTR (gst_dvbsrc_unlock);
@@ -679,7 +683,6 @@ gst_dvbsrc_close_devices (GstDvbSrc * object)
return TRUE;
}
-/* TODO: should open the frontend at NULL to READY to inform app the caps */
static gboolean
gst_dvbsrc_open_frontend (GstDvbSrc * object)
{
@@ -962,6 +965,31 @@ gst_dvbsrc_create (GstPushSrc * element, GstBuffer ** buf)
}
+static GstStateChangeReturn
+gst_dvbsrc_change_state (GstElement * element, GstStateChange transition)
+{
+ GstDvbSrc *src;
+ GstStateChangeReturn ret;
+
+ src = GST_DVBSRC (element);
+ ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
+
+ switch (transition) {
+ case GST_STATE_CHANGE_NULL_TO_READY:
+ /* open frontend then close it again, just so caps sent */
+ gst_dvbsrc_open_frontend (src);
+ if (src->fd_frontend) {
+ close (src->fd_frontend);
+ }
+ break;
+ default:
+ break;
+ }
+
+ return ret;
+}
+
+
static gboolean
gst_dvbsrc_start (GstBaseSrc * bsrc)
{