From a22d61007aa7bf539ae735dbab6026d44729fe61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Djalma=20L=C3=BAcio=20Soares=20da=20Silva?= Date: Thu, 31 Oct 2013 13:02:11 -0200 Subject: [PATCH] hdv1394src: Make it possible to select a camera by its GUID The source hdv1394src has the guid property that permits select a camera connected from its GUID number. However when this property is setted the selected camera is not changed. The source continues using the default camera. This problem was solved using the function iec61883_cmp_connect. The reference for the function could be found here: http://www.dennedy.org/libiec61883/API-iec61883-cmp-connect.html The solution came from dvgrab source code. https://bugzilla.gnome.org/show_bug.cgi?id=710415 --- ext/raw1394/gsthdv1394src.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ext/raw1394/gsthdv1394src.c b/ext/raw1394/gsthdv1394src.c index 0bfa485c55..a8a032ad29 100644 --- a/ext/raw1394/gsthdv1394src.c +++ b/ext/raw1394/gsthdv1394src.c @@ -562,6 +562,22 @@ gst_hdv1394src_start (GstBaseSrc * bsrc) raw1394_set_userdata (src->handle, src); raw1394_set_bus_reset_handler (src->handle, gst_hdv1394src_bus_reset); + { + nodeid_t m_node = (src->avc_node | 0xffc0); + int m_channel = -1; + int m_bandwidth = 0; + int m_outputPort = -1; + int m_inputPort = -1; + + m_channel = iec61883_cmp_connect (src->handle, m_node, &m_outputPort, + raw1394_get_local_id (src->handle), &m_inputPort, &m_bandwidth); + + if (m_channel >= 0) { + src->channel = m_channel; + } + } + + if ((src->iec61883mpeg2 = iec61883_mpeg2_recv_init (src->handle, gst_hdv1394src_iec61883_receive, src)) == NULL)