2000-12-28 22:12:02 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
|
|
|
|
* 2000 Wim Taymans <wtay@chello.be>
|
|
|
|
*
|
|
|
|
* gstprops.h: Header for properties subsystem
|
2000-12-07 18:37:56 +00:00
|
|
|
*
|
|
|
|
* 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_PROPS_H__
|
|
|
|
#define __GST_PROPS_H__
|
|
|
|
|
2001-10-17 10:21:27 +00:00
|
|
|
#include <gst/gstconfig.h>
|
2001-01-18 11:16:53 +00:00
|
|
|
|
2001-10-17 10:21:27 +00:00
|
|
|
#include <glib.h>
|
2000-12-28 22:12:02 +00:00
|
|
|
|
2000-12-07 18:37:56 +00:00
|
|
|
typedef struct _GstProps GstProps;
|
|
|
|
|
|
|
|
typedef enum {
|
2001-04-14 18:56:37 +00:00
|
|
|
GST_PROPS_END_ID = 0,
|
|
|
|
GST_PROPS_LIST_ID,
|
|
|
|
GST_PROPS_INT_ID,
|
|
|
|
GST_PROPS_INT_RANGE_ID,
|
|
|
|
GST_PROPS_FLOAT_ID,
|
|
|
|
GST_PROPS_FLOAT_RANGE_ID,
|
|
|
|
GST_PROPS_FOURCC_ID,
|
|
|
|
GST_PROPS_BOOL_ID,
|
|
|
|
GST_PROPS_STRING_ID,
|
|
|
|
GST_PROPS_LAST_ID = GST_PROPS_END_ID + 16,
|
2000-12-07 18:37:56 +00:00
|
|
|
} GstPropsId;
|
|
|
|
|
2001-03-30 23:56:07 +00:00
|
|
|
#define GST_MAKE_FOURCC(a,b,c,d) ((a)|(b)<<8|(c)<<16|(d)<<24)
|
added GST_STR_FOURCC, which takes strings like "YUY2" instead of 'Y','U','Y','2'. better, I think <g>
Original commit message from CVS:
added GST_STR_FOURCC, which takes strings like "YUY2" instead of 'Y','U','Y','2'. better, I think <g>
2001-04-22 01:32:44 +00:00
|
|
|
#define GST_STR_FOURCC(f) (((f)[0])|((f)[1]<<8)|((f)[2]<<16)|((f)[3]<<24))
|
2001-03-30 23:56:07 +00:00
|
|
|
|
2001-03-18 02:42:30 +00:00
|
|
|
#define GST_PROPS_LIST(a...) GST_PROPS_LIST_ID,##a,NULL
|
2001-04-14 18:56:37 +00:00
|
|
|
#define GST_PROPS_INT(a) GST_PROPS_INT_ID,(a)
|
|
|
|
#define GST_PROPS_INT_RANGE(a,b) GST_PROPS_INT_RANGE_ID,(a),(b)
|
|
|
|
#define GST_PROPS_FLOAT(a) GST_PROPS_FLOAT_ID,(a)
|
|
|
|
#define GST_PROPS_FLOAT_RANGE(a,b) GST_PROPS_FLOAT_RANGE_ID,(a),(b)
|
|
|
|
#define GST_PROPS_FOURCC(a) GST_PROPS_FOURCC_ID,(a)
|
|
|
|
#define GST_PROPS_BOOLEAN(a) GST_PROPS_BOOL_ID,(a)
|
2001-03-24 17:22:03 +00:00
|
|
|
#define GST_PROPS_STRING(a) GST_PROPS_STRING_ID,(a)
|
2000-12-07 18:37:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
struct _GstProps {
|
2001-03-20 18:29:00 +00:00
|
|
|
gint refcount;
|
2001-03-24 17:22:03 +00:00
|
|
|
GMutex *lock;
|
2001-03-20 18:29:00 +00:00
|
|
|
|
2001-01-03 20:21:22 +00:00
|
|
|
GList *properties; /* real properties for this property */
|
2000-12-07 18:37:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* initialize the subsystem */
|
|
|
|
void _gst_props_initialize (void);
|
|
|
|
|
2001-04-14 18:56:37 +00:00
|
|
|
GstProps* gst_props_new (const gchar *firstname, ...);
|
|
|
|
GstProps* gst_props_newv (const gchar *firstname, va_list var_args);
|
2000-12-19 16:36:10 +00:00
|
|
|
|
2001-03-20 18:29:00 +00:00
|
|
|
void gst_props_unref (GstProps *props);
|
|
|
|
void gst_props_ref (GstProps *props);
|
|
|
|
void gst_props_destroy (GstProps *props);
|
|
|
|
|
|
|
|
GstProps* gst_props_copy (GstProps *props);
|
|
|
|
GstProps* gst_props_copy_on_write (GstProps *props);
|
|
|
|
|
2000-12-19 16:36:10 +00:00
|
|
|
GstProps* gst_props_merge (GstProps *props, GstProps *tomerge);
|
|
|
|
|
2000-12-28 21:42:23 +00:00
|
|
|
gboolean gst_props_check_compatibility (GstProps *fromprops, GstProps *toprops);
|
2000-12-07 18:37:56 +00:00
|
|
|
|
2001-04-14 18:56:37 +00:00
|
|
|
GstProps* gst_props_set (GstProps *props, const gchar *name, ...);
|
2001-03-18 02:42:30 +00:00
|
|
|
|
|
|
|
gint gst_props_get_int (GstProps *props, const gchar *name);
|
2001-04-28 18:56:10 +00:00
|
|
|
gfloat gst_props_get_float (GstProps *props, const gchar *name);
|
2001-03-18 02:42:30 +00:00
|
|
|
gulong gst_props_get_fourcc_int (GstProps *props, const gchar *name);
|
|
|
|
gboolean gst_props_get_boolean (GstProps *props, const gchar *name);
|
2001-03-24 17:22:03 +00:00
|
|
|
const gchar* gst_props_get_string (GstProps *props, const gchar *name);
|
2001-03-18 02:42:30 +00:00
|
|
|
|
2001-10-17 10:21:27 +00:00
|
|
|
#ifndef GST_DISABLE_LOADSAVE
|
2000-12-11 00:04:25 +00:00
|
|
|
xmlNodePtr gst_props_save_thyself (GstProps *props, xmlNodePtr parent);
|
|
|
|
GstProps* gst_props_load_thyself (xmlNodePtr parent);
|
2001-10-17 10:21:27 +00:00
|
|
|
#endif
|
2000-12-11 00:04:25 +00:00
|
|
|
|
2000-12-07 18:37:56 +00:00
|
|
|
#endif /* __GST_PROPS_H__ */
|