gio: allow per feature registration
authorStéphane Cerveau <scerveau@collabora.com>
Fri, 11 Dec 2020 14:12:29 +0000 (15:12 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 16 Mar 2021 17:58:59 +0000 (17:58 +0000)
Split plugin into features including
dynamic types which can be indiviually
registered during a static build.

More details here:

https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/199
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/661

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1029>

16 files changed:
gst/gio/gstgio.c
gst/gio/gstgiobasesink.c
gst/gio/gstgiobasesink.h
gst/gio/gstgiobasesrc.c
gst/gio/gstgiobasesrc.h
gst/gio/gstgioelement.c [new file with mode: 0644]
gst/gio/gstgioelements.h [moved from gst/gio/gstgio.h with 67% similarity]
gst/gio/gstgiosink.c
gst/gio/gstgiosink.h
gst/gio/gstgiosrc.c
gst/gio/gstgiosrc.h
gst/gio/gstgiostreamsink.c
gst/gio/gstgiostreamsink.h
gst/gio/gstgiostreamsrc.c
gst/gio/gstgiostreamsrc.h
gst/gio/meson.build

index 6e45e80..21dc1f6 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2007 Rene Stadler <mail@renestadler.de>
  * Copyright (C) 2007 Sebastian Dröge <sebastian.droege@collabora.co.uk>
- * 
+ *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
  * License as published by the Free Software Foundation; either
 #include "config.h"
 #endif
 
-#include "gstgio.h"
-#include "gstgiosink.h"
-#include "gstgiosrc.h"
-#include "gstgiostreamsink.h"
-#include "gstgiostreamsrc.h"
-
-#include <string.h>
-
-GST_DEBUG_CATEGORY_STATIC (gst_gio_debug);
-#define GST_CAT_DEFAULT gst_gio_debug
-
-/* @func_name: Name of the GIO function, for debugging messages.
- * @err: Error location.  *err may be NULL, but err must be non-NULL.
- * @ret: Flow return location.  May be NULL.  Is set to either #GST_FLOW_ERROR
- * or #GST_FLOW_FLUSHING.
- *
- * Returns: TRUE to indicate a handled error.  Error at given location err will
- * be freed and *err will be set to NULL.  A FALSE return indicates an unhandled
- * error: The err location is unchanged and guaranteed to be != NULL.  ret, if
- * given, is set to GST_FLOW_ERROR.
- */
-gboolean
-gst_gio_error (gpointer element, const gchar * func_name, GError ** err,
-    GstFlowReturn * ret)
-{
-  gboolean handled = TRUE;
-
-  if (ret)
-    *ret = GST_FLOW_ERROR;
-
-  if (GST_GIO_ERROR_MATCHES (*err, CANCELLED)) {
-    GST_DEBUG_OBJECT (element, "blocking I/O call cancelled (%s)", func_name);
-    if (ret)
-      *ret = GST_FLOW_FLUSHING;
-  } else if (*err != NULL) {
-    handled = FALSE;
-  } else {
-    GST_ELEMENT_ERROR (element, LIBRARY, FAILED, (NULL),
-        ("%s call failed without error set", func_name));
-  }
-
-  if (handled)
-    g_clear_error (err);
-
-  return handled;
-}
-
-GstFlowReturn
-gst_gio_seek (gpointer element, GSeekable * stream, guint64 offset,
-    GCancellable * cancel)
-{
-  gboolean success;
-  GstFlowReturn ret;
-  GError *err = NULL;
-
-  GST_LOG_OBJECT (element, "seeking to offset %" G_GINT64_FORMAT, offset);
-
-  success = g_seekable_seek (stream, offset, G_SEEK_SET, cancel, &err);
-
-  if (success)
-    ret = GST_FLOW_OK;
-  else if (!gst_gio_error (element, "g_seekable_seek", &err, &ret)) {
-    GST_ELEMENT_ERROR (element, RESOURCE, SEEK, (NULL),
-        ("Could not seek: %s", err->message));
-    g_clear_error (&err);
-  }
-
-  return ret;
-}
-
-static gpointer
-_internal_get_supported_protocols (gpointer data)
-{
-  const gchar *const *schemes;
-  gchar **our_schemes;
-  guint num;
-  gint i, j;
-
-  schemes = g_vfs_get_supported_uri_schemes (g_vfs_get_default ());
-
-  if (schemes != NULL)
-    num = g_strv_length ((gchar **) schemes);
-  else
-    num = 0;
-
-  if (num == 0) {
-    GST_WARNING ("No GIO supported URI schemes found");
-    return NULL;
-  }
-
-  our_schemes = g_new0 (gchar *, num + 1);
-
-  /* - Filter http/https as we can't support the icy stuff with GIO.
-   *   Use souphttpsrc if you need that.
-   * - Filter cdda as it doesn't support musicbrainz stuff and everything
-   *   else one expects from a cdda source. Use cdparanoiasrc or cdiosrc
-   *   for cdda.
-   */
-  for (i = 0, j = 0; i < num; i++) {
-    if (strcmp (schemes[i], "http") == 0 || strcmp (schemes[i], "https") == 0
-        || strcmp (schemes[i], "cdda") == 0)
-      continue;
-
-    our_schemes[j] = g_strdup (schemes[i]);
-    j++;
-  }
-
-  return our_schemes;
-}
-
-static gchar **
-gst_gio_get_supported_protocols (void)
-{
-  static GOnce once = G_ONCE_INIT;
-
-  g_once (&once, _internal_get_supported_protocols, NULL);
-  return (gchar **) once.retval;
-}
-
-static GstURIType
-gst_gio_uri_handler_get_type_sink (GType type)
-{
-  return GST_URI_SINK;
-}
-
-static GstURIType
-gst_gio_uri_handler_get_type_src (GType type)
-{
-  return GST_URI_SRC;
-}
-
-static const gchar *const *
-gst_gio_uri_handler_get_protocols (GType type)
-{
-  static const gchar *const *protocols = NULL;
-
-  if (!protocols)
-    protocols = (const gchar * const *) gst_gio_get_supported_protocols ();
-
-  return protocols;
-}
-
-static gchar *
-gst_gio_uri_handler_get_uri (GstURIHandler * handler)
-{
-  GstElement *element = GST_ELEMENT (handler);
-  gchar *uri;
-
-  g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
-
-  g_object_get (G_OBJECT (element), "location", &uri, NULL);
-
-  return uri;
-}
-
-static gboolean
-gst_gio_uri_handler_set_uri (GstURIHandler * handler, const gchar * uri,
-    GError ** error)
-{
-  GstElement *element = GST_ELEMENT (handler);
-
-  g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
-
-  if (GST_STATE (element) == GST_STATE_PLAYING ||
-      GST_STATE (element) == GST_STATE_PAUSED) {
-    g_set_error (error, GST_URI_ERROR, GST_URI_ERROR_BAD_STATE,
-        "Changing the 'location' property while the element is running is "
-        "not supported");
-    return FALSE;
-  }
-
-  g_object_set (G_OBJECT (element), "location", uri, NULL);
-  return TRUE;
-}
-
-static void
-gst_gio_uri_handler_init (gpointer g_iface, gpointer iface_data)
-{
-  GstURIHandlerInterface *iface = (GstURIHandlerInterface *) g_iface;
-  gboolean sink = GPOINTER_TO_INT (iface_data); /* See in do_init below. */
-
-  if (sink)
-    iface->get_type = gst_gio_uri_handler_get_type_sink;
-  else
-    iface->get_type = gst_gio_uri_handler_get_type_src;
-  iface->get_protocols = gst_gio_uri_handler_get_protocols;
-  iface->get_uri = gst_gio_uri_handler_get_uri;
-  iface->set_uri = gst_gio_uri_handler_set_uri;
-}
-
-void
-gst_gio_uri_handler_do_init (GType type)
-{
-  GInterfaceInfo uri_handler_info = {
-    gst_gio_uri_handler_init,
-    NULL,
-    NULL
-  };
-
-  /* Store information for uri_handler_init to use for distinguishing the
-   * element types.  This lets us use a single interface implementation for both
-   * classes. */
-  uri_handler_info.interface_data = GINT_TO_POINTER (g_type_is_a (type,
-          GST_TYPE_BASE_SINK));
-
-  g_type_add_interface_static (type, GST_TYPE_URI_HANDLER, &uri_handler_info);
-}
-
-#define GIO_GVFS_MOUNTS_DIR GIO_PREFIX \
-    G_DIR_SEPARATOR_S "share" \
-    G_DIR_SEPARATOR_S "gvfs" \
-    G_DIR_SEPARATOR_S "mounts"
+#include "gstgioelements.h"
 
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  gboolean ret = TRUE;
-
-  GST_DEBUG_CATEGORY_INIT (gst_gio_debug, "gio", 0, "GIO elements");
-
-  gst_plugin_add_dependency_simple (plugin, NULL, GIO_MODULE_DIR, NULL,
-      GST_PLUGIN_DEPENDENCY_FLAG_NONE);
-  gst_plugin_add_dependency_simple (plugin, NULL, GIO_GVFS_MOUNTS_DIR, NULL,
-      GST_PLUGIN_DEPENDENCY_FLAG_NONE);
-
-  /* FIXME: Rank is MARGINAL for now, should be at least SECONDARY+1 in the future
-   * to replace gnomevfssink/src. For testing purposes PRIMARY+1 one makes sense
-   * so it gets autoplugged and preferred over filesrc/sink. */
-
-  ret &= gst_element_register (plugin, "giosink", GST_RANK_SECONDARY,
-      GST_TYPE_GIO_SINK);
-
-  ret &= gst_element_register (plugin, "giosrc", GST_RANK_SECONDARY,
-      GST_TYPE_GIO_SRC);
-
-  ret &= gst_element_register (plugin, "giostreamsink", GST_RANK_NONE,
-      GST_TYPE_GIO_STREAM_SINK);
+  gboolean ret = FALSE;
 
-  ret &= gst_element_register (plugin, "giostreamsrc", GST_RANK_NONE,
-      GST_TYPE_GIO_STREAM_SRC);
+  ret |= GST_ELEMENT_REGISTER (giosink, plugin);
+  ret |= GST_ELEMENT_REGISTER (giosrc, plugin);
+  ret |= GST_ELEMENT_REGISTER (giostreamsink, plugin);
+  ret |= GST_ELEMENT_REGISTER (giostreamsrc, plugin);
 
   return ret;
 }
index 6a8f5b1..52fd1d7 100644 (file)
@@ -24,6 +24,7 @@
 #endif
 
 #include "gstgiobasesink.h"
+#include "gstgioelements.h"
 
 GST_DEBUG_CATEGORY_STATIC (gst_gio_base_sink_debug);
 #define GST_CAT_DEFAULT gst_gio_base_sink_debug
index 7ab4968..5a404a3 100644 (file)
@@ -22,8 +22,9 @@
 #ifndef __GST_GIO_BASE_SINK_H__
 #define __GST_GIO_BASE_SINK_H__
 
-#include "gstgio.h"
 
+#include <gst/gst.h>
+#include <gio/gio.h>
 #include <gst/base/gstbasesink.h>
 
 G_BEGIN_DECLS
index 10d1cf1..7e967bb 100644 (file)
@@ -24,8 +24,7 @@
 #endif
 
 #include "gstgiobasesrc.h"
-
-#include <gst/base/gsttypefindhelper.h>
+#include "gstgioelements.h"
 
 GST_DEBUG_CATEGORY_STATIC (gst_gio_base_src_debug);
 #define GST_CAT_DEFAULT gst_gio_base_src_debug
index 390d832..75a8b5f 100644 (file)
@@ -22,8 +22,8 @@
 #ifndef __GST_GIO_BASE_SRC_H__
 #define __GST_GIO_BASE_SRC_H__
 
-#include "gstgio.h"
-
+#include <gst/gst.h>
+#include <gio/gio.h>
 #include <gst/base/gstbasesrc.h>
 
 G_BEGIN_DECLS
diff --git a/gst/gio/gstgioelement.c b/gst/gio/gstgioelement.c
new file mode 100644 (file)
index 0000000..3ec7b5b
--- /dev/null
@@ -0,0 +1,248 @@
+/* GStreamer
+ *
+ * Copyright (C) 2007 Rene Stadler <mail@renestadler.de>
+ * Copyright (C) 2007 Sebastian Dröge <sebastian.droege@collabora.co.uk>
+ * Copyright (C) 2020 Huawei Technologies Co., Ltd.
+ *   @Author: Stéphane Cerveau <scerveau@collabora.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "gstgioelements.h"
+
+GST_DEBUG_CATEGORY_STATIC (gst_gio_debug);
+#define GST_CAT_DEFAULT gst_gio_debug
+
+/* @func_name: Name of the GIO function, for debugging messages.
+ * @err: Error location.  *err may be NULL, but err must be non-NULL.
+ * @ret: Flow return location.  May be NULL.  Is set to either #GST_FLOW_ERROR
+ * or #GST_FLOW_FLUSHING.
+ *
+ * Returns: TRUE to indicate a handled error.  Error at given location err will
+ * be freed and *err will be set to NULL.  A FALSE return indicates an unhandled
+ * error: The err location is unchanged and guaranteed to be != NULL.  ret, if
+ * given, is set to GST_FLOW_ERROR.
+ */
+gboolean
+gst_gio_error (gpointer element, const gchar * func_name, GError ** err,
+    GstFlowReturn * ret)
+{
+  gboolean handled = TRUE;
+
+  if (ret)
+    *ret = GST_FLOW_ERROR;
+
+  if (GST_GIO_ERROR_MATCHES (*err, CANCELLED)) {
+    GST_DEBUG_OBJECT (element, "blocking I/O call cancelled (%s)", func_name);
+    if (ret)
+      *ret = GST_FLOW_FLUSHING;
+  } else if (*err != NULL) {
+    handled = FALSE;
+  } else {
+    GST_ELEMENT_ERROR (element, LIBRARY, FAILED, (NULL),
+        ("%s call failed without error set", func_name));
+  }
+
+  if (handled)
+    g_clear_error (err);
+
+  return handled;
+}
+
+GstFlowReturn
+gst_gio_seek (gpointer element, GSeekable * stream, guint64 offset,
+    GCancellable * cancel)
+{
+  gboolean success;
+  GstFlowReturn ret;
+  GError *err = NULL;
+
+  GST_LOG_OBJECT (element, "seeking to offset %" G_GINT64_FORMAT, offset);
+
+  success = g_seekable_seek (stream, offset, G_SEEK_SET, cancel, &err);
+
+  if (success)
+    ret = GST_FLOW_OK;
+  else if (!gst_gio_error (element, "g_seekable_seek", &err, &ret)) {
+    GST_ELEMENT_ERROR (element, RESOURCE, SEEK, (NULL),
+        ("Could not seek: %s", err->message));
+    g_clear_error (&err);
+  }
+
+  return ret;
+}
+
+static gpointer
+_internal_get_supported_protocols (gpointer data)
+{
+  const gchar *const *schemes;
+  gchar **our_schemes;
+  guint num;
+  gint i, j;
+
+  schemes = g_vfs_get_supported_uri_schemes (g_vfs_get_default ());
+
+  if (schemes != NULL)
+    num = g_strv_length ((gchar **) schemes);
+  else
+    num = 0;
+
+  if (num == 0) {
+    GST_WARNING ("No GIO supported URI schemes found");
+    return NULL;
+  }
+
+  our_schemes = g_new0 (gchar *, num + 1);
+
+  /* - Filter http/https as we can't support the icy stuff with GIO.
+   *   Use souphttpsrc if you need that.
+   * - Filter cdda as it doesn't support musicbrainz stuff and everything
+   *   else one expects from a cdda source. Use cdparanoiasrc or cdiosrc
+   *   for cdda.
+   */
+  for (i = 0, j = 0; i < num; i++) {
+    if (strcmp (schemes[i], "http") == 0 || strcmp (schemes[i], "https") == 0
+        || strcmp (schemes[i], "cdda") == 0)
+      continue;
+
+    our_schemes[j] = g_strdup (schemes[i]);
+    j++;
+  }
+
+  return our_schemes;
+}
+
+static gchar **
+gst_gio_get_supported_protocols (void)
+{
+  static GOnce once = G_ONCE_INIT;
+
+  g_once (&once, _internal_get_supported_protocols, NULL);
+  return (gchar **) once.retval;
+}
+
+static GstURIType
+gst_gio_uri_handler_get_type_sink (GType type)
+{
+  return GST_URI_SINK;
+}
+
+static GstURIType
+gst_gio_uri_handler_get_type_src (GType type)
+{
+  return GST_URI_SRC;
+}
+
+static const gchar *const *
+gst_gio_uri_handler_get_protocols (GType type)
+{
+  static const gchar *const *protocols = NULL;
+
+  if (!protocols)
+    protocols = (const gchar * const *) gst_gio_get_supported_protocols ();
+
+  return protocols;
+}
+
+static gchar *
+gst_gio_uri_handler_get_uri (GstURIHandler * handler)
+{
+  GstElement *element = GST_ELEMENT (handler);
+  gchar *uri;
+
+  g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
+
+  g_object_get (G_OBJECT (element), "location", &uri, NULL);
+
+  return uri;
+}
+
+static gboolean
+gst_gio_uri_handler_set_uri (GstURIHandler * handler, const gchar * uri,
+    GError ** error)
+{
+  GstElement *element = GST_ELEMENT (handler);
+
+  g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
+
+  if (GST_STATE (element) == GST_STATE_PLAYING ||
+      GST_STATE (element) == GST_STATE_PAUSED) {
+    g_set_error (error, GST_URI_ERROR, GST_URI_ERROR_BAD_STATE,
+        "Changing the 'location' property while the element is running is "
+        "not supported");
+    return FALSE;
+  }
+
+  g_object_set (G_OBJECT (element), "location", uri, NULL);
+  return TRUE;
+}
+
+static void
+gst_gio_uri_handler_init (gpointer g_iface, gpointer iface_data)
+{
+  GstURIHandlerInterface *iface = (GstURIHandlerInterface *) g_iface;
+  gboolean sink = GPOINTER_TO_INT (iface_data); /* See in do_init below. */
+
+  if (sink)
+    iface->get_type = gst_gio_uri_handler_get_type_sink;
+  else
+    iface->get_type = gst_gio_uri_handler_get_type_src;
+  iface->get_protocols = gst_gio_uri_handler_get_protocols;
+  iface->get_uri = gst_gio_uri_handler_get_uri;
+  iface->set_uri = gst_gio_uri_handler_set_uri;
+}
+
+void
+gst_gio_uri_handler_do_init (GType type)
+{
+  GInterfaceInfo uri_handler_info = {
+    gst_gio_uri_handler_init,
+    NULL,
+    NULL
+  };
+
+  /* Store information for uri_handler_init to use for distinguishing the
+   * element types.  This lets us use a single interface implementation for both
+   * classes. */
+  uri_handler_info.interface_data = GINT_TO_POINTER (g_type_is_a (type,
+          GST_TYPE_BASE_SINK));
+
+  g_type_add_interface_static (type, GST_TYPE_URI_HANDLER, &uri_handler_info);
+}
+
+#define GIO_GVFS_MOUNTS_DIR GIO_PREFIX \
+    G_DIR_SEPARATOR_S "share" \
+    G_DIR_SEPARATOR_S "gvfs" \
+    G_DIR_SEPARATOR_S "mounts"
+
+void
+gio_element_init (GstPlugin * plugin)
+{
+  static gsize res = FALSE;
+
+  if (g_once_init_enter (&res)) {
+    GST_DEBUG_CATEGORY_INIT (gst_gio_debug, "gio", 0, "GIO elements");
+
+    gst_plugin_add_dependency_simple (plugin, NULL, GIO_MODULE_DIR, NULL,
+        GST_PLUGIN_DEPENDENCY_FLAG_NONE);
+    gst_plugin_add_dependency_simple (plugin, NULL, GIO_GVFS_MOUNTS_DIR, NULL,
+        GST_PLUGIN_DEPENDENCY_FLAG_NONE);
+    g_once_init_leave (&res, TRUE);
+  }
+}
similarity index 67%
rename from gst/gio/gstgio.h
rename to gst/gio/gstgioelements.h
index ab27600..97eaabb 100644 (file)
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Library General Public License for more details.
  *
  * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
- * Boston, MA 02110-1301, USA.
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-#ifndef __GST_GIO_H__
-#define __GST_GIO_H__
+#ifndef __GST_GIO_ELEMENTS_H__
+#define __GST_GIO_ELEMENTS_H__
+
 
 #include <gio/gio.h>
 #include <gst/gst.h>
 
+#include "gstgiobasesink.h"
+
 G_BEGIN_DECLS
 
+G_GNUC_INTERNAL void gio_element_init (GstPlugin * plugin);
+
+GST_ELEMENT_REGISTER_DECLARE (giosink);
+GST_ELEMENT_REGISTER_DECLARE (giosrc);
+GST_ELEMENT_REGISTER_DECLARE (giostreamsink);
+GST_ELEMENT_REGISTER_DECLARE (giostreamsrc);
+
 #define GST_GIO_ERROR_MATCHES(err, code) g_error_matches (err, G_IO_ERROR, G_IO_ERROR_##code)
 
 #define GST_GIO_STREAM_IS_SEEKABLE(stream) (G_IS_SEEKABLE (stream) && g_seekable_can_seek (G_SEEKABLE (stream)))
@@ -39,4 +48,4 @@ void gst_gio_uri_handler_do_init (GType type);
 
 G_END_DECLS
 
-#endif /* __GST_GIO_H__ */
+#endif /* __GST_GIO_ELEMENTS_H__ */
index e94aeb4..6ccce0d 100644 (file)
@@ -78,6 +78,7 @@
 #endif
 
 #include "gstgiosink.h"
+#include "gstgioelements.h"
 
 GST_DEBUG_CATEGORY_STATIC (gst_gio_sink_debug);
 #define GST_CAT_DEFAULT gst_gio_sink_debug
@@ -98,6 +99,9 @@ enum
 #define gst_gio_sink_parent_class parent_class
 G_DEFINE_TYPE_WITH_CODE (GstGioSink, gst_gio_sink, GST_TYPE_GIO_BASE_SINK,
     gst_gio_uri_handler_do_init (g_define_type_id));
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (giosink, "giosink",
+    GST_RANK_SECONDARY, GST_TYPE_GIO_SINK, gio_element_init (plugin));
+
 
 static void gst_gio_sink_finalize (GObject * object);
 static void gst_gio_sink_set_property (GObject * object, guint prop_id,
index 671cd57..bb76c73 100644 (file)
@@ -22,7 +22,6 @@
 #ifndef __GST_GIO_SINK_H__
 #define __GST_GIO_SINK_H__
 
-#include "gstgio.h"
 #include "gstgiobasesink.h"
 
 #include <gst/base/gstbasesink.h>
index 2e32baf..646220d 100644 (file)
@@ -74,7 +74,7 @@
 #endif
 
 #include "gstgiosrc.h"
-#include <string.h>
+#include "gstgioelements.h"
 
 GST_DEBUG_CATEGORY_STATIC (gst_gio_src_debug);
 #define GST_CAT_DEFAULT gst_gio_src_debug
@@ -93,6 +93,8 @@ static gint done_waiting_data_signal = 0;
 #define gst_gio_src_parent_class parent_class
 G_DEFINE_TYPE_WITH_CODE (GstGioSrc, gst_gio_src,
     GST_TYPE_GIO_BASE_SRC, gst_gio_uri_handler_do_init (g_define_type_id));
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (giosrc, "giosrc",
+    GST_RANK_SECONDARY, GST_TYPE_GIO_SRC, gio_element_init (plugin));
 
 static void gst_gio_src_finalize (GObject * object);
 
index c136c2e..2c5bab3 100644 (file)
@@ -22,7 +22,6 @@
 #ifndef __GST_GIO_SRC_H__
 #define __GST_GIO_SRC_H__
 
-#include "gstgio.h"
 #include "gstgiobasesrc.h"
 
 #include <gst/base/gstbasesrc.h>
index bac52d7..1c16979 100644 (file)
@@ -60,12 +60,12 @@ out_data = g_memory_ouput_stream_get_data (G_MEMORY_OUTPUT_STREAM (stream));
  * ]|
  *
  */
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 
 #include "gstgiostreamsink.h"
+#include "gstgioelements.h"
 
 GST_DEBUG_CATEGORY_STATIC (gst_gio_stream_sink_debug);
 #define GST_CAT_DEFAULT gst_gio_stream_sink_debug
@@ -84,6 +84,8 @@ enum
 
 #define gst_gio_stream_sink_parent_class parent_class
 G_DEFINE_TYPE (GstGioStreamSink, gst_gio_stream_sink, GST_TYPE_GIO_BASE_SINK);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (giostreamsink, "giostreamsink",
+    GST_RANK_NONE, GST_TYPE_GIO_STREAM_SINK, gio_element_init (plugin));
 
 static void gst_gio_stream_sink_finalize (GObject * object);
 static void gst_gio_stream_sink_set_property (GObject * object, guint prop_id,
index 8b41b07..1b62dd5 100644 (file)
@@ -22,7 +22,6 @@
 #ifndef __GST_GIO_STREAM_SINK_H__
 #define __GST_GIO_STREAM_SINK_H__
 
-#include "gstgio.h"
 #include "gstgiobasesink.h"
 
 #include <gst/base/gstbasesink.h>
index 57fb903..3ce81ff 100644 (file)
@@ -66,6 +66,7 @@ g_object_set (G_OBJECT (src), "stream", stream, NULL);
 #endif
 
 #include "gstgiostreamsrc.h"
+#include "gstgioelements.h"
 
 GST_DEBUG_CATEGORY_STATIC (gst_gio_stream_src_debug);
 #define GST_CAT_DEFAULT gst_gio_stream_src_debug
@@ -78,6 +79,8 @@ enum
 
 #define gst_gio_stream_src_parent_class parent_class
 G_DEFINE_TYPE (GstGioStreamSrc, gst_gio_stream_src, GST_TYPE_GIO_BASE_SRC);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (giostreamsrc, "giostreamsrc",
+    GST_RANK_NONE, GST_TYPE_GIO_STREAM_SRC, gio_element_init (plugin));
 
 static void gst_gio_stream_src_finalize (GObject * object);
 static void gst_gio_stream_src_set_property (GObject * object, guint prop_id,
index 5968de6..40714bb 100644 (file)
@@ -22,7 +22,6 @@
 #ifndef __GST_GIO_STREAM_SRC_H__
 #define __GST_GIO_STREAM_SRC_H__
 
-#include "gstgio.h"
 #include "gstgiobasesrc.h"
 
 #include <gst/base/gstbasesrc.h>
index fea4be6..444a4c1 100644 (file)
@@ -1,4 +1,5 @@
 gio_sources = ['gstgio.c',
+  'gstgioelement.c',
   'gstgiobasesink.c',
   'gstgiobasesrc.c',
   'gstgiosink.c',