summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2013-02-15 17:10:04 +0100
committerWim Taymans <wim.taymans@collabora.co.uk>2013-02-15 17:16:09 +0100
commiteed0b09f84e2ca1f7bbf1a14e3f63122c4a2c249 (patch)
treed6e332fac08db393b3b5eecb7b10d85bd02e94b3
parent558c7c651ace8b07bb5991d79b049b74084a5e6d (diff)
cache: add file objectcache-element
Add an object that will encapsulate the on-disk representation of the data and define the API to access it.
-rw-r--r--gst/cache/Makefile.am1
-rw-r--r--gst/cache/gstcachefile.c43
-rw-r--r--gst/cache/gstcachefile.h63
3 files changed, 107 insertions, 0 deletions
diff --git a/gst/cache/Makefile.am b/gst/cache/Makefile.am
index c9d7f0e30..da1d97bc2 100644
--- a/gst/cache/Makefile.am
+++ b/gst/cache/Makefile.am
@@ -2,6 +2,7 @@ plugin_LTLIBRARIES = libgstcache.la
libgstcache_la_SOURCES = \
gstcache.c \
+ gstcachefile.c \
gstcachesink.c \
gstcachesrc.c
diff --git a/gst/cache/gstcachefile.c b/gst/cache/gstcachefile.c
new file mode 100644
index 000000000..33fb1cba1
--- /dev/null
+++ b/gst/cache/gstcachefile.c
@@ -0,0 +1,43 @@
+/* GStreamer
+ * Copyright (C) <2013> Wim Taymans <wim.taymans@gmail.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.
+ */
+
+#include "gstcachefile.h"
+
+struct _GstCacheFilePrivate
+{
+};
+
+#define GST_CACHE_FILE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_CACHE_FILE, \
+ GstCacheFilePrivate))
+
+#define gst_cache_file_parent_class parent_class
+G_DEFINE_TYPE (GstCacheFile, gst_cache_file, GST_TYPE_OBJECT);
+
+static void
+gst_cache_file_class_init (GstCacheFileClass * klass)
+{
+ g_type_class_add_private (klass, sizeof (GstCacheFilePrivate));
+}
+
+static void
+gst_cache_file_init (GstCacheFile * cache)
+{
+ cache->priv = GST_CACHE_FILE_GET_PRIVATE (clock);
+}
diff --git a/gst/cache/gstcachefile.h b/gst/cache/gstcachefile.h
new file mode 100644
index 000000000..a5a01d437
--- /dev/null
+++ b/gst/cache/gstcachefile.h
@@ -0,0 +1,63 @@
+/* GStreamer
+ * Copyright (C) <2013> Wim Taymans <wim.taymans@gmail.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.
+ */
+
+#ifndef __GST_CACHE_FILE_H__
+#define __GST_CACHE_FILE_H__
+
+#include <gst/gst.h>
+
+G_BEGIN_DECLS
+
+#define GST_TYPE_CACHE_FILE \
+ (gst_cache_file_get_type())
+#define GST_CACHE_FILE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_CACHE_FILE,GstCacheFile))
+#define GST_CACHE_FILE_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_CACHE_FILE,GstCacheFileClass))
+#define GST_IS_CACHE_FILE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_CACHE_FILE))
+#define GST_IS_CACHE_FILE_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_CACHE_FILE))
+
+typedef struct _GstCacheFile GstCacheFile;
+typedef struct _GstCacheFileClass GstCacheFileClass;
+typedef struct _GstCacheFilePrivate GstCacheFilePrivate;
+
+struct _GstCacheFile
+{
+ GstObject parent;
+
+ GstCacheFilePrivate *priv;
+};
+
+struct _GstCacheFileClass
+{
+ GstObjectClass parent_class;
+};
+
+GType gst_cache_file_get_type (void);
+
+GstCacheFile * gst_cache_file_open (gchar *tmpl, int flags, int mode,
+ GError **error);
+void gst_cache_file_close (GstCacheFile *cache);
+
+
+G_END_DECLS
+
+#endif /* __GST_CACHE_FILE_H__ */