various: fix pad template leaks
[platform/upstream/gstreamer.git] / ext / raw1394 / gsthdv1394src.c
index 14fdb76..33ef11e 100644 (file)
@@ -62,7 +62,7 @@
 
 #define SEND_COMMAND(src, command)          \
 G_STMT_START {                              \
-  int _res; unsigned char c; c = command;   \
+  int G_GNUC_UNUSED _res; unsigned char c; c = command;   \
   _res = write (WRITE_SOCKET(src), &c, 1);  \
 } G_STMT_END
 
@@ -90,12 +90,6 @@ enum
   PROP_DEVICE_NAME
 };
 
-static const GstElementDetails gst_hdv1394src_details =
-GST_ELEMENT_DETAILS ("Firewire (1394) HDV video source",
-    "Source/Video",
-    "Source for MPEG-TS video data from firewire port",
-    "Edward Hervey <bilboed@bilboed.com>");
-
 static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
     GST_PAD_SRC,
     GST_PAD_ALWAYS,
@@ -146,10 +140,12 @@ gst_hdv1394src_base_init (gpointer g_class)
 {
   GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
 
-  gst_element_class_add_pad_template (element_class,
-      gst_static_pad_template_get (&src_factory));
+  gst_element_class_add_static_pad_template (element_class, &src_factory);
 
-  gst_element_class_set_details (element_class, &gst_hdv1394src_details);
+  gst_element_class_set_details_simple (element_class,
+      "Firewire (1394) HDV video source", "Source/Video",
+      "Source for MPEG-TS video data from firewire port",
+      "Edward Hervey <bilboed@bilboed.com>");
 }
 
 static void
@@ -169,18 +165,18 @@ gst_hdv1394src_class_init (GstHDV1394SrcClass * klass)
 
   g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_PORT,
       g_param_spec_int ("port", "Port", "Port number (-1 automatic)",
-          -1, 16, DEFAULT_PORT, G_PARAM_READWRITE));
+          -1, 16, DEFAULT_PORT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
   g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_CHANNEL,
       g_param_spec_int ("channel", "Channel", "Channel number for listening",
-          0, 64, DEFAULT_CHANNEL, G_PARAM_READWRITE));
+          0, 64, DEFAULT_CHANNEL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
   g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_USE_AVC,
       g_param_spec_boolean ("use-avc", "Use AV/C", "Use AV/C VTR control",
-          DEFAULT_USE_AVC, G_PARAM_READWRITE));
+          DEFAULT_USE_AVC, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
   g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_GUID,
       g_param_spec_uint64 ("guid", "GUID",
           "select one of multiple DV devices by its GUID. use a hexadecimal "
           "like 0xhhhhhhhhhhhhhhhh. (0 = no guid)", 0, G_MAXUINT64,
-          DEFAULT_GUID, G_PARAM_READWRITE));
+          DEFAULT_GUID, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
   /**
    * GstHDV1394Src:device-name
    *
@@ -190,7 +186,8 @@ gst_hdv1394src_class_init (GstHDV1394SrcClass * klass)
    **/
   g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_DEVICE_NAME,
       g_param_spec_string ("device-name", "device name",
-          "user-friendly name of the device", "Default", G_PARAM_READABLE));
+          "user-friendly name of the device", "Default",
+          G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
 
   gstbasesrc_class->negotiate = NULL;
   gstbasesrc_class->start = gst_hdv1394src_start;
@@ -796,7 +793,7 @@ gst_hdv1394src_uri_get_type (void)
 static gchar **
 gst_hdv1394src_uri_get_protocols (void)
 {
-  static gchar *protocols[] = { "hdv", NULL };
+  static gchar *protocols[] = { (char *) "hdv", NULL };
 
   return protocols;
 }