Added the excellent mpeg2dec decoder. Not 100% optimized but allready very fast.
[platform/upstream/gstreamer.git] / gst / gstmeta.h
1 /* Gnome-Streamer   
2  * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20
21
22 #ifndef __GST_META_H__
23 #define __GST_META_H__
24
25 #include <glib.h> 
26  
27  
28 #ifdef __cplusplus
29 extern "C" {
30 #endif /* __cplusplus */
31
32
33 #define GST_META(meta) ((GstMeta *)(meta))
34
35
36 #define GST_META_FLAGS(meta) \
37   (GST_META(meta)->flags)
38 #define GST_META_FLAG_IS_SET(meta,flag) \
39   (GST_META_FLAGS(meta) & (flag))
40 #define GST_META_FLAG_SET(meta,flag) \
41   G_STMT_START{ (GST_META_FLAGS(meta) |= (flag)); }G_STMT_END
42 #define GST_META_FLAG_UNSET(meta,flag) \
43   G_STMT_START{ (GST_META_FLAGS(meta) &= ~(flag)); }G_STMT_END
44
45
46 typedef enum {
47   GST_META_FREEABLE             = 1 << 0,
48 } GstMetaFlags;
49
50
51 typedef struct _GstMeta GstMeta;
52
53 struct _GstMeta {
54   /* locking */
55   GMutex *lock;
56
57   /* refcounting */
58 #ifdef HAVE_ATOMIC_H
59   atomic_t refcount;
60 #else
61   int refcount;
62 #endif
63
64   guint16 type;
65   guint16 flags;
66
67   void *data;
68   guint16 size;
69 };
70
71
72 GstMeta*        gst_meta_new_size       (gint size);
73 #define         gst_meta_new(type)      (type *)gst_meta_new_size(sizeof(type))
74
75 /* refcounting */
76 void            gst_meta_ref            (GstMeta *meta);
77 void            gst_meta_unref          (GstMeta *meta);
78
79 #ifdef __cplusplus
80 }
81 #endif /* __cplusplus */
82  
83  
84 #endif /* __GST_BUFFER_H__ */
85