completion: Update to new gstreamer core helpers
[platform/upstream/gstreamer.git] / ges / ges-extractable.h
1 /* GStreamer Editing Services
2  *
3  * Copyright (C) 2012 Thibault Saunier <thibault.saunier@collabora.com>
4  * Copyright (C) 2012 Volodymyr Rudyi <vladimir.rudoy@gmail.com>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 #ifndef _GES_EXTRACTABLE_
22 #define _GES_EXTRACTABLE_
23
24 typedef struct _GESExtractable GESExtractable;
25
26 #include <glib-object.h>
27 #include <gio/gio.h>
28 #include <ges/ges-types.h>
29 #include <ges/ges-asset.h>
30
31 G_BEGIN_DECLS
32
33 /* GESExtractable interface declarations */
34 #define GES_TYPE_EXTRACTABLE                (ges_extractable_get_type ())
35 #define GES_EXTRACTABLE(obj)                (G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_EXTRACTABLE, GESExtractable))
36 #define GES_IS_EXTRACTABLE(obj)             (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GES_TYPE_EXTRACTABLE))
37 #define GES_EXTRACTABLE_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GES_TYPE_EXTRACTABLE, GESExtractableInterface))
38
39 GType ges_extractable_get_type (void);
40
41 /**
42  * GESExtractableCheckId:
43  * @type: The #GType to check @id for:
44  * @id: The id to check
45  * @error: An error that can be set if needed
46  *
47  * Returns: The ID to use for the asset or %NULL if @id is not valid
48  */
49
50 typedef gchar* (*GESExtractableCheckId) (GType type, const gchar *id,
51     GError **error);
52
53 /**
54  * GESExtractable:
55  */
56 struct _GESExtractableInterface
57 {
58   GTypeInterface parent;
59
60   GType asset_type;
61
62   GESExtractableCheckId check_id;
63   gboolean can_update_asset;
64
65   void (*set_asset)                  (GESExtractable *self,
66                                          GESAsset *asset);
67
68   gboolean (*set_asset_full)         (GESExtractable *self,
69                                       GESAsset *asset);
70
71   GParameter *(*get_parameters_from_id) (const gchar *id,
72                                          guint *n_params);
73
74   gchar * (*get_id)                     (GESExtractable *self);
75
76   GType (*get_real_extractable_type)    (GType wanted_type,
77                                          const gchar *id);
78
79   gboolean (*register_metas)            (GESExtractableInterface *self,
80                                          GObjectClass *klass,
81                                          GESAsset *asset);
82
83   gpointer _ges_reserved[GES_PADDING];
84 };
85
86 GESAsset* ges_extractable_get_asset      (GESExtractable *self);
87 gboolean ges_extractable_set_asset              (GESExtractable *self,
88                                                 GESAsset *asset);
89
90 gchar * ges_extractable_get_id                 (GESExtractable *self);
91
92 G_END_DECLS
93 #endif /* _GES_EXTRACTABLE_ */