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 <gst/gst.h>
29 #include <ges/ges-types.h>
30 #include <ges/ges-asset.h>
31 
32 G_BEGIN_DECLS
33 
34 /* GESExtractable interface declarations */
35 #define GES_TYPE_EXTRACTABLE                (ges_extractable_get_type ())
36 #define GES_EXTRACTABLE(obj)                (G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_EXTRACTABLE, GESExtractable))
37 #define GES_IS_EXTRACTABLE(obj)             (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GES_TYPE_EXTRACTABLE))
38 #define GES_EXTRACTABLE_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GES_TYPE_EXTRACTABLE, GESExtractableInterface))
39 
40 GES_API
41 GType ges_extractable_get_type (void);
42 
43 /**
44  * GESExtractableCheckId:
45  * @type: The #GType to check @id for:
46  * @id: The id to check
47  * @error: An error that can be set if needed
48  *
49  * Returns: The ID to use for the asset or %NULL if @id is not valid
50  */
51 
52 typedef gchar* (*GESExtractableCheckId) (GType type, const gchar *id,
53     GError **error);
54 
55 /**
56  * GESExtractable:
57  */
58 struct _GESExtractableInterface
59 {
60   GTypeInterface parent;
61 
62   GType asset_type;
63 
64   GESExtractableCheckId check_id;
65   gboolean can_update_asset;
66 
67   void (*set_asset)                  (GESExtractable *self,
68                                          GESAsset *asset);
69 
70   gboolean (*set_asset_full)         (GESExtractable *self,
71                                       GESAsset *asset);
72 
73   GParameter *(*get_parameters_from_id) (const gchar *id,
74                                          guint *n_params);
75 
76   gchar * (*get_id)                     (GESExtractable *self);
77 
78   GType (*get_real_extractable_type)    (GType wanted_type,
79                                          const gchar *id);
80 
81   gboolean (*register_metas)            (GESExtractableInterface *self,
82                                          GObjectClass *klass,
83                                          GESAsset *asset);
84 
85   gpointer _ges_reserved[GES_PADDING];
86 };
87 
88 GES_API
89 GESAsset* ges_extractable_get_asset      (GESExtractable *self);
90 GES_API
91 gboolean ges_extractable_set_asset              (GESExtractable *self,
92                                                 GESAsset *asset);
93 
94 GES_API
95 gchar * ges_extractable_get_id                 (GESExtractable *self);
96 
97 G_END_DECLS
98 #endif /* _GES_EXTRACTABLE_ */
99