Add the preset interface (Fixes #396779). Do some doc cleanups along.

Original commit message from CVS:
* docs/gst/gstreamer-docs.sgml:
* docs/gst/gstreamer-sections.txt:
* docs/gst/gstreamer.types.in:
* gst/Makefile.am:
* gst/gst.h:
* gst/gstpreset.c:
* gst/gstpreset.h:
Add the preset interface (Fixes #396779). Do some doc cleanups along.
This commit is contained in:
Stefan Kost 2007-11-17 16:43:12 +00:00
parent c558588f7c
commit 819c9f4e2a
8 changed files with 1195 additions and 7 deletions

View file

@ -1,3 +1,14 @@
2007-11-17 Stefan Kost <ensonic@users.sf.net>
* docs/gst/gstreamer-docs.sgml:
* docs/gst/gstreamer-sections.txt:
* docs/gst/gstreamer.types.in:
* gst/Makefile.am:
* gst/gst.h:
* gst/gstpreset.c:
* gst/gstpreset.h:
Add the preset interface (Fixes #396779). Do some doc cleanups along.
2007-11-16 Jan Schmidt <jan.schmidt@sun.com>
* configure.ac:

View file

@ -35,6 +35,7 @@
<!ENTITY GstPipeline SYSTEM "xml/gstpipeline.xml">
<!ENTITY GstPlugin SYSTEM "xml/gstplugin.xml">
<!ENTITY GstPluginFeature SYSTEM "xml/gstpluginfeature.xml">
<!ENTITY GstPreset SYSTEM "xml/gstpreset.xml">
<!ENTITY GstQuery SYSTEM "xml/gstquery.xml">
<!ENTITY GstRegistry SYSTEM "xml/gstregistry.xml">
<!ENTITY GstSegment SYSTEM "xml/gstsegment.xml">
@ -138,6 +139,7 @@ Windows. It is released under the GNU Library General Public License
&GstPipeline;
&GstPlugin;
&GstPluginFeature;
&GstPreset;
&GstQuery;
&GstRegistry;
&GstSegment;

View file

@ -1599,6 +1599,28 @@ gst_rank_get_type
</SECTION>
<SECTION>
<FILE>gstpreset</FILE>
<TITLE>GstPreset</TITLE>
GstPreset
gst_preset_get_preset_names
gst_preset_load_preset
gst_preset_save_preset
gst_preset_rename_preset
gst_preset_delete_preset
gst_preset_set_meta
gst_preset_get_meta
gst_preset_create_preset
<SUBSECTION Standard>
GstPresetInterface
GST_PRESET
GST_IS_PRESET
GST_TYPE_PRESET
GST_PRESET_GET_INTERFACE
gst_preset_get_type
</SECTION>
<SECTION>
<FILE>gstquery</FILE>
<TITLE>GstQuery</TITLE>
@ -1608,7 +1630,6 @@ GST_QUERY_TYPE
GST_QUERY_TYPE_NAME
GstQueryTypeDefinition
gst_query_type_get_name
gst_query_type_to_quark
gst_query_type_register

View file

@ -10,6 +10,7 @@
gst_bin_get_type
gst_bus_get_type
gst_child_proxy_get_type
gst_clock_get_type
gst_element_factory_get_type
gst_element_get_type
@ -17,22 +18,26 @@ gst_ghost_pad_get_type
gst_implements_interface_get_type
@GST_INDEX_DOC_TYPES@gst_index_factory_get_type
@GST_INDEX_DOC_TYPES@gst_index_get_type
gst_registry_get_type
% these are not GObject derived types !
% gst_mini_object_get_type
% gst_message_get_type
gst_object_get_type
gst_pad_get_type
gst_pad_template_get_type
gst_pipeline_get_type
gst_plugin_feature_get_type
gst_preset_get_type
gst_registry_get_type
gst_system_clock_get_type
gst_tag_setter_get_type
gst_task_get_type
gst_type_find_factory_get_type
gst_uri_handler_get_type
@GST_LOADSAVE_DOC_TYPES@gst_xml_get_type
% these are not GObject derived types !
% gst_buffer_get_type
% gst_mini_object_get_type
% gst_message_get_type
% gst_query_get_type
% base classes
#include <gst/base/gstadapter.h>

View file

@ -102,6 +102,7 @@ libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \
gstpipeline.c \
gstplugin.c \
gstpluginfeature.c \
gstpreset.c \
gstquark.c \
gstquery.c \
gstregistry.c \
@ -185,6 +186,7 @@ gst_headers = \
gstpipeline.h \
gstplugin.h \
gstpluginfeature.h \
gstpreset.h \
gstquery.h \
gstsegment.h \
gststructure.h \

View file

@ -54,6 +54,7 @@
#include <gst/gstparamspecs.h>
#include <gst/gstpipeline.h>
#include <gst/gstplugin.h>
#include <gst/gstpreset.h>
#include <gst/gstquery.h>
#include <gst/gstregistry.h>
#include <gst/gstsegment.h>

1064
gst/gstpreset.c Normal file

File diff suppressed because it is too large Load diff

82
gst/gstpreset.h Normal file
View file

@ -0,0 +1,82 @@
/* GStreamer
* Copyright (C) 2006 Stefan Kost <ensonic@users.sf.net>
*
* gstpreset.h: helper interface header for element presets
*
* 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_PRESET_H__
#define __GST_PRESET_H__
#include <glib-object.h>
#include <gst/gst.h>
#include <gst/controller/gstcontroller.h>
G_BEGIN_DECLS
#define GST_TYPE_PRESET (gst_preset_get_type())
#define GST_PRESET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PRESET, GstPreset))
#define GST_IS_PRESET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PRESET))
#define GST_PRESET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GST_TYPE_PRESET, GstPresetInterface))
typedef struct _GstPreset GstPreset; /* dummy object */
typedef struct _GstPresetInterface GstPresetInterface;
struct _GstPresetInterface
{
GTypeInterface parent;
GList* (*get_preset_names) (GstPreset *self);
gboolean (*load_preset) (GstPreset *self, const gchar *name);
gboolean (*save_preset) (GstPreset *self, const gchar *name);
gboolean (*rename_preset) (GstPreset *self, const gchar *old_name, const gchar *new_name);
gboolean (*delete_preset) (GstPreset *self, const gchar *name);
gboolean (*set_meta) (GstPreset *self,const gchar *name, const gchar *tag, gchar *value);
gboolean (*get_meta) (GstPreset *self,const gchar *name, const gchar *tag, gchar **value);
void (*create_preset) (GstPreset *self);
/* @todo:
*
* need a presets-changed signal, to notify of changes in preset list
*
* need a way to sync class instances, we want to keep only one list for all
* instances of a type and if the list changes, we trigger the signal for all
* instance
*/
};
GType gst_preset_get_type(void);
GList* gst_preset_get_preset_names (GstPreset *self);
gboolean gst_preset_load_preset (GstPreset *self, const gchar *name);
gboolean gst_preset_save_preset (GstPreset *self, const gchar *name);
gboolean gst_preset_rename_preset (GstPreset *self, const gchar *old_name, const gchar *new_name);
gboolean gst_preset_delete_preset (GstPreset *self, const gchar *name);
gboolean gst_preset_set_meta (GstPreset *self,const gchar *name, const gchar *tag, gchar *value);
gboolean gst_preset_get_meta (GstPreset *self,const gchar *name, const gchar *tag, gchar **value);
void gst_preset_create_preset (GstPreset *self);
G_END_DECLS
#endif /* __GST_PRESET_H__ */