Post a message when the cable is unplugged.
authorAndy Wingo <wingo@pobox.com>
Fri, 7 Oct 2005 16:22:59 +0000 (16:22 +0000)
committerAndy Wingo <wingo@pobox.com>
Fri, 7 Oct 2005 16:22:59 +0000 (16:22 +0000)
Original commit message from CVS:
(gst_dv1394src_bus_reset): Post a message when the cable is
unplugged.
(gst_dv1394src_create, gst_dv1394src_unlock): Remove some prints.

ChangeLog
ext/raw1394/gstdv1394src.c

index 6281419..825e3e2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,9 @@
 
        * ext/raw1394/gstdv1394src.c: Make interruptible, so it won't
        block forever in a read().
+       (gst_dv1394src_bus_reset): Post a message when the cable is
+       unplugged.
+       (gst_dv1394src_create, gst_dv1394src_unlock): Remove some prints.
 
        * ext/raw1394/gstdv1394src.c: Clean up for style before doing some
        hacking. The only change should be that the state change stuff was
index c408357..8c1995d 100644 (file)
@@ -73,13 +73,13 @@ enum
   LAST_SIGNAL
 };
 
-#define DEFAULT_PORT           -1
-#define DEFAULT_CHANNEL                63
-#define DEFAULT_CONSECUTIVE    1
-#define DEFAULT_SKIP           0
-#define DEFAULT_DROP_INCOMPLETE        TRUE
-#define DEFAULT_USE_AVC                TRUE
-#define DEFAULT_GUID           0
+#define DEFAULT_PORT    -1
+#define DEFAULT_CHANNEL   63
+#define DEFAULT_CONSECUTIVE 1
+#define DEFAULT_SKIP    0
+#define DEFAULT_DROP_INCOMPLETE TRUE
+#define DEFAULT_USE_AVC   TRUE
+#define DEFAULT_GUID    0
 
 enum
 {
@@ -437,8 +437,23 @@ gst_dv1394src_iso_receive (raw1394handle_t handle, int channel, size_t len,
 static int
 gst_dv1394src_bus_reset (raw1394handle_t handle, unsigned int generation)
 {
-  GST_INFO_OBJECT (GST_DV1394SRC (raw1394_get_userdata (handle)),
-      "have bus reset");
+  GstDV1394Src *src;
+  gint nodecount;
+  GstMessage *message;
+  GstStructure *structure;
+
+  src = GST_DV1394SRC (raw1394_get_userdata (handle));
+
+  GST_INFO_OBJECT (src, "have bus reset");
+
+  nodecount = raw1394_get_nodecount (handle);
+
+  structure = gst_structure_new ("ieee1394-bus-reset", "nodecount", G_TYPE_INT,
+      nodecount, NULL);
+  message = gst_message_new_element (GST_OBJECT (src), structure);
+  gst_element_post_message (GST_ELEMENT (src), message);
+  gst_message_unref (message);
+
   return 0;
 }
 
@@ -473,8 +488,6 @@ gst_dv1394src_create (GstPushSrc * psrc, GstBuffer ** buf)
     if (pollfds[1].revents) {
       char command;
 
-      g_print ("told to stop!\n");
-
       if (pollfds[1].revents & POLLIN)
         READ_COMMAND (dv1394src, command, res);
 
@@ -694,7 +707,6 @@ gst_dv1394src_unlock (GstBaseSrc * bsrc)
 {
   GstDV1394Src *src = GST_DV1394SRC (bsrc);
 
-  g_print ("sending command!\n");
   SEND_COMMAND (src, CONTROL_STOP);
 
   return TRUE;