gstreamer 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +201 -3
- data/ext/gstreamer/extconf.rb +10 -10
- data/ext/gstreamer/misc.c +16 -15
- data/ext/gstreamer/rbgst-bin.c +75 -83
- data/ext/gstreamer/rbgst-buffer.c +91 -91
- data/ext/gstreamer/rbgst-bus.c +21 -21
- data/ext/gstreamer/rbgst-caps.c +98 -91
- data/ext/gstreamer/rbgst-child-proxy.c +19 -18
- data/ext/gstreamer/rbgst-clock.c +34 -32
- data/ext/gstreamer/rbgst-element-factory.c +79 -85
- data/ext/gstreamer/rbgst-element.c +245 -210
- data/ext/gstreamer/rbgst-event.c +18 -18
- data/ext/gstreamer/rbgst-ghost-pad.c +24 -21
- data/ext/gstreamer/rbgst-index-factory.c +31 -29
- data/ext/gstreamer/rbgst-install-plugins-context.c +86 -0
- data/ext/gstreamer/rbgst-install-plugins-return.c +45 -0
- data/ext/gstreamer/rbgst-install-plugins.c +45 -111
- data/ext/gstreamer/rbgst-message.c +15 -16
- data/ext/gstreamer/rbgst-mini-object.c +37 -37
- data/ext/gstreamer/rbgst-object.c +29 -26
- data/ext/gstreamer/rbgst-pad-template.c +36 -35
- data/ext/gstreamer/rbgst-pad.c +96 -96
- data/ext/gstreamer/rbgst-pipeline.c +32 -31
- data/ext/gstreamer/rbgst-plugin-feature.c +47 -48
- data/ext/gstreamer/rbgst-plugin.c +62 -64
- data/ext/gstreamer/rbgst-private.c +14 -15
- data/ext/gstreamer/rbgst-private.h +76 -16
- data/ext/gstreamer/rbgst-query.c +22 -20
- data/ext/gstreamer/rbgst-seek.c +22 -19
- data/ext/gstreamer/rbgst-static-caps.c +26 -24
- data/ext/gstreamer/rbgst-static-pad-template.c +27 -26
- data/ext/gstreamer/rbgst-structure.c +61 -59
- data/ext/gstreamer/rbgst-system-clock.c +23 -20
- data/ext/gstreamer/rbgst-type-find-factory.c +44 -43
- data/ext/gstreamer/rbgst-value.c +40 -28
- data/ext/gstreamer/rbgst-x-overlay.c +32 -31
- data/ext/gstreamer/rbgst.c +78 -128
- data/ext/gstreamer/rbgst.h +16 -16
- data/ext/gstreamer/rbgstclockentry.c +46 -43
- data/ext/gstreamer/rbgstformat.c +64 -61
- data/ext/gstreamer/rbgstindex.c +67 -64
- data/ext/gstreamer/rbgstindexentry.c +31 -28
- data/ext/gstreamer/rbgstparse.c +32 -29
- data/ext/gstreamer/rbgstquerytype.c +64 -61
- data/ext/gstreamer/rbgstregistry.c +79 -76
- data/ext/gstreamer/rbgsttag.c +34 -32
- data/ext/gstreamer/rbgsttagsetter.c +22 -19
- data/ext/gstreamer/rbgstxml.c +78 -75
- data/lib/gst.rb +15 -1
- data/test/test_buffer.rb +5 -2
- data/test/test_element.rb +7 -9
- data/test/test_value.rb +2 -2
- metadata +11 -11
- data/ChangeLog +0 -1202
- data/test/test_clock.rb +0 -7
data/ext/gstreamer/rbgstparse.c
CHANGED
@@ -1,24 +1,27 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
1
2
|
/*
|
2
|
-
*
|
3
|
+
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
+
* Copyright (C) 2003, 2004 Laurent Sansonetti <lrz@gnome.org>
|
3
5
|
*
|
4
|
-
*
|
6
|
+
* This library is free software; you can redistribute it and/or
|
7
|
+
* modify it under the terms of the GNU Lesser General Public
|
8
|
+
* License as published by the Free Software Foundation; either
|
9
|
+
* version 2.1 of the License, or (at your option) any later version.
|
5
10
|
*
|
6
|
-
*
|
7
|
-
*
|
8
|
-
*
|
9
|
-
*
|
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
|
+
* Lesser General Public License for more details.
|
10
15
|
*
|
11
|
-
*
|
12
|
-
*
|
13
|
-
*
|
14
|
-
*
|
15
|
-
*
|
16
|
-
* You should have received a copy of the GNU Lesser General Public
|
17
|
-
* License along with Ruby/GStreamer; if not, write to the Free Software
|
18
|
-
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
16
|
+
* You should have received a copy of the GNU Lesser General Public
|
17
|
+
* License along with this library; if not, write to the Free Software
|
18
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19
|
+
* MA 02110-1301 USA
|
19
20
|
*/
|
20
21
|
|
21
|
-
#include "rbgst.h"
|
22
|
+
#include "rbgst-private.h"
|
23
|
+
|
24
|
+
#define RG_TARGET_NAMESPACE mParse
|
22
25
|
|
23
26
|
/* Module: Gst::Parse
|
24
27
|
* Parses command-line syntax into a pipeline.
|
@@ -36,30 +39,30 @@
|
|
36
39
|
* an exception on failure.
|
37
40
|
*/
|
38
41
|
static VALUE
|
39
|
-
|
42
|
+
rg_m_launch (VALUE self, VALUE command)
|
40
43
|
{
|
41
44
|
#if !defined(GST_DISABLE_PARSE)
|
42
|
-
|
43
|
-
|
45
|
+
GError *error;
|
46
|
+
GstBin *bin;
|
44
47
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
48
|
+
error = NULL;
|
49
|
+
bin = (GstBin*)gst_parse_launch (RVAL2CSTR (command), &error);
|
50
|
+
if (bin != NULL)
|
51
|
+
return RGST_BIN_NEW (bin);
|
49
52
|
RAISE_GERROR(error);
|
50
53
|
#else
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
+
rb_raise (rb_eRuntimeError,
|
55
|
+
"This function has been disabled "
|
56
|
+
"when GStreamer was compiled");
|
54
57
|
#endif
|
55
|
-
|
58
|
+
return Qnil;
|
56
59
|
}
|
57
60
|
|
58
61
|
void
|
59
|
-
Init_gst_parse (
|
62
|
+
Init_gst_parse (VALUE mGst)
|
60
63
|
{
|
61
|
-
|
62
|
-
|
64
|
+
VALUE RG_TARGET_NAMESPACE = rb_define_module_under (mGst, "Parse");
|
65
|
+
RG_DEF_MODFUNC(launch, 1);
|
63
66
|
|
64
67
|
G_DEF_ERROR(GST_PARSE_ERROR, "ParseError", mGst, rb_eRuntimeError,
|
65
68
|
GST_TYPE_PARSE_ERROR);
|
@@ -1,24 +1,27 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
1
2
|
/*
|
2
|
-
*
|
3
|
+
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
+
* Copyright (C) 2003, 2004 Laurent Sansonetti <lrz@gnome.org>
|
3
5
|
*
|
4
|
-
*
|
6
|
+
* This library is free software; you can redistribute it and/or
|
7
|
+
* modify it under the terms of the GNU Lesser General Public
|
8
|
+
* License as published by the Free Software Foundation; either
|
9
|
+
* version 2.1 of the License, or (at your option) any later version.
|
5
10
|
*
|
6
|
-
*
|
7
|
-
*
|
8
|
-
*
|
9
|
-
*
|
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
|
+
* Lesser General Public License for more details.
|
10
15
|
*
|
11
|
-
*
|
12
|
-
*
|
13
|
-
*
|
14
|
-
*
|
15
|
-
*
|
16
|
-
* You should have received a copy of the GNU Lesser General Public
|
17
|
-
* License along with Ruby/GStreamer; if not, write to the Free Software
|
18
|
-
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
16
|
+
* You should have received a copy of the GNU Lesser General Public
|
17
|
+
* License along with this library; if not, write to the Free Software
|
18
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19
|
+
* MA 02110-1301 USA
|
19
20
|
*/
|
20
21
|
|
21
|
-
#include "rbgst.h"
|
22
|
+
#include "rbgst-private.h"
|
23
|
+
|
24
|
+
#define RG_TARGET_NAMESPACE cQueryType
|
22
25
|
|
23
26
|
/* Class: Gst::QueryType
|
24
27
|
* Dynamically register new query types.
|
@@ -27,22 +30,22 @@
|
|
27
30
|
static GstQueryType *
|
28
31
|
query_type_copy (const GstQueryType* query_type)
|
29
32
|
{
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
33
|
+
GstQueryType *new_query_type;
|
34
|
+
g_return_val_if_fail (query_type != NULL, NULL);
|
35
|
+
new_query_type = g_new (GstQueryType, 1);
|
36
|
+
*new_query_type = *query_type;
|
37
|
+
return new_query_type;
|
35
38
|
}
|
36
39
|
|
37
40
|
GType
|
38
41
|
gst_query_type_get_type2 (void)
|
39
42
|
{
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
43
|
+
static GType our_type = 0;
|
44
|
+
if (our_type == 0)
|
45
|
+
our_type = g_boxed_type_register_static ("GstQueryTypeClass",
|
46
|
+
(GBoxedCopyFunc)query_type_copy,
|
47
|
+
(GBoxedFreeFunc)g_free);
|
48
|
+
return our_type;
|
46
49
|
}
|
47
50
|
|
48
51
|
/*
|
@@ -53,12 +56,12 @@ gst_query_type_get_type2 (void)
|
|
53
56
|
* given nick, or nil if this query was not registered.
|
54
57
|
*/
|
55
58
|
static VALUE
|
56
|
-
|
59
|
+
rg_s_find (VALUE self, VALUE nick)
|
57
60
|
{
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
61
|
+
GstQueryType type = gst_query_type_get_by_nick (RVAL2CSTR (nick));
|
62
|
+
return type != GST_QUERY_NONE
|
63
|
+
? RGST_QUERY_TYPE_NEW (&type)
|
64
|
+
: Qnil;
|
62
65
|
}
|
63
66
|
|
64
67
|
/*
|
@@ -70,7 +73,7 @@ rb_gst_querytype_find (VALUE self, VALUE nick)
|
|
70
73
|
* Returns: always nil.
|
71
74
|
*/
|
72
75
|
static VALUE
|
73
|
-
|
76
|
+
rg_s_each (VALUE self)
|
74
77
|
{
|
75
78
|
GstIterator *iter;
|
76
79
|
gpointer value;
|
@@ -88,30 +91,30 @@ rb_gst_querytype_each (VALUE self)
|
|
88
91
|
* Returns: the type id of this query type (see Gst::QueryType::Type).
|
89
92
|
*/
|
90
93
|
static VALUE
|
91
|
-
|
94
|
+
rg_type_id (VALUE self)
|
92
95
|
{
|
93
|
-
|
94
|
-
|
96
|
+
GstQueryType *querytype = RGST_QUERY_TYPE (self);
|
97
|
+
return INT2FIX (*querytype);
|
95
98
|
}
|
96
99
|
|
97
100
|
/* Method: nick
|
98
101
|
* Returns: the short nick of the query type.
|
99
102
|
*/
|
100
103
|
static VALUE
|
101
|
-
|
104
|
+
rg_nick (VALUE self)
|
102
105
|
{
|
103
|
-
|
104
|
-
|
106
|
+
GstQueryType *querytype = RGST_QUERY_TYPE (self);
|
107
|
+
return CSTR2RVAL (gst_query_type_get_details (*querytype)->nick);
|
105
108
|
}
|
106
109
|
|
107
110
|
/* Method: description
|
108
111
|
* Returns: a longer description of the query type.
|
109
112
|
*/
|
110
113
|
static VALUE
|
111
|
-
|
114
|
+
rg_description (VALUE self)
|
112
115
|
{
|
113
|
-
|
114
|
-
|
116
|
+
GstQueryType *querytype = RGST_QUERY_TYPE (self);
|
117
|
+
return CSTR2RVAL (gst_query_type_get_details (*querytype)->description);
|
115
118
|
}
|
116
119
|
|
117
120
|
/*
|
@@ -124,36 +127,36 @@ rb_gst_querytype_get_description (VALUE self)
|
|
124
127
|
* Returns: true on success, false on failure.
|
125
128
|
*/
|
126
129
|
static VALUE
|
127
|
-
|
130
|
+
rg_operator_is_equal (VALUE self, VALUE other_query)
|
128
131
|
{
|
129
|
-
|
130
|
-
|
132
|
+
GstQueryType *q1, *q2;
|
133
|
+
const gchar *n1, *n2;
|
131
134
|
|
132
|
-
|
133
|
-
|
135
|
+
if (NIL_P (other_query))
|
136
|
+
return Qfalse;
|
134
137
|
|
135
|
-
|
136
|
-
|
138
|
+
q1 = RGST_QUERY_TYPE (self);
|
139
|
+
q2 = RGST_QUERY_TYPE (other_query);
|
137
140
|
|
138
|
-
|
139
|
-
|
141
|
+
n1 = gst_query_type_get_details (*q1)->nick;
|
142
|
+
n2 = gst_query_type_get_details (*q2)->nick;
|
140
143
|
|
141
|
-
|
144
|
+
return CBOOL2RVAL( strcmp (n1, n2) == 0);
|
142
145
|
}
|
143
146
|
|
144
147
|
void
|
145
|
-
Init_gst_querytype (
|
148
|
+
Init_gst_querytype (VALUE mGst)
|
146
149
|
{
|
147
|
-
|
150
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS (GST_TYPE_QUERY_TYPE2, "QueryType", mGst);
|
148
151
|
|
149
|
-
|
150
|
-
|
152
|
+
RG_DEF_SMETHOD(each, 0);
|
153
|
+
RG_DEF_SMETHOD(find, 1);
|
151
154
|
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
155
|
+
RG_DEF_METHOD(type_id, 0);
|
156
|
+
RG_DEF_METHOD(nick, 0);
|
157
|
+
RG_DEF_METHOD(description, 0);
|
158
|
+
RG_DEF_METHOD_OPERATOR("==", is_equal, 1);
|
156
159
|
|
157
|
-
|
158
|
-
|
160
|
+
G_DEF_CLASS (GST_TYPE_QUERY_TYPE, "Type", RG_TARGET_NAMESPACE);
|
161
|
+
G_DEF_CONSTANTS (RG_TARGET_NAMESPACE, GST_TYPE_QUERY_TYPE, "GST_QUERY_");
|
159
162
|
}
|
@@ -1,37 +1,40 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
1
2
|
/*
|
2
|
-
*
|
3
|
+
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
+
* Copyright (C) 2003, 2004 Laurent Sansonetti <lrz@gnome.org>
|
3
5
|
*
|
4
|
-
*
|
6
|
+
* This library is free software; you can redistribute it and/or
|
7
|
+
* modify it under the terms of the GNU Lesser General Public
|
8
|
+
* License as published by the Free Software Foundation; either
|
9
|
+
* version 2.1 of the License, or (at your option) any later version.
|
5
10
|
*
|
6
|
-
*
|
7
|
-
*
|
8
|
-
*
|
9
|
-
*
|
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
|
+
* Lesser General Public License for more details.
|
10
15
|
*
|
11
|
-
*
|
12
|
-
*
|
13
|
-
*
|
14
|
-
*
|
15
|
-
*
|
16
|
-
* You should have received a copy of the GNU Lesser General Public
|
17
|
-
* License along with Ruby/GStreamer; if not, write to the Free Software
|
18
|
-
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
16
|
+
* You should have received a copy of the GNU Lesser General Public
|
17
|
+
* License along with this library; if not, write to the Free Software
|
18
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19
|
+
* MA 02110-1301 USA
|
19
20
|
*/
|
20
21
|
|
21
|
-
#include "rbgst.h"
|
22
|
+
#include "rbgst-private.h"
|
23
|
+
|
24
|
+
#define RG_TARGET_NAMESPACE cRegistry
|
22
25
|
|
23
26
|
/* Class: Gst::Registry
|
24
27
|
* Abstract class for managing plugins.
|
25
28
|
*/
|
26
29
|
|
27
30
|
static VALUE
|
28
|
-
|
31
|
+
rg_s_default(VALUE self)
|
29
32
|
{
|
30
33
|
return RGST_REGISTRY_NEW(gst_registry_get_default());
|
31
34
|
}
|
32
35
|
|
33
36
|
static VALUE
|
34
|
-
|
37
|
+
rg_s_update(VALUE self)
|
35
38
|
{
|
36
39
|
return CBOOL2RVAL(gst_update_registry());
|
37
40
|
}
|
@@ -44,7 +47,7 @@ rb_gst_update_registry(VALUE self)
|
|
44
47
|
* Returns: an array of Gst::Plugin objects.
|
45
48
|
*/
|
46
49
|
static VALUE
|
47
|
-
|
50
|
+
rg_plugins(VALUE self)
|
48
51
|
{
|
49
52
|
GList *list, *node;
|
50
53
|
VALUE arr;
|
@@ -70,9 +73,9 @@ rb_gst_registry_get_plugins(VALUE self)
|
|
70
73
|
* Returns: always nil.
|
71
74
|
*/
|
72
75
|
static VALUE
|
73
|
-
|
76
|
+
rg_each_plugin (VALUE self)
|
74
77
|
{
|
75
|
-
|
78
|
+
return rb_ary_yield (rg_plugins (self));
|
76
79
|
}
|
77
80
|
|
78
81
|
/*
|
@@ -87,7 +90,7 @@ rb_gst_registry_each_plugin (VALUE self)
|
|
87
90
|
* Returns: an array of Gst::PluginFeature objects.
|
88
91
|
*/
|
89
92
|
static VALUE
|
90
|
-
|
93
|
+
rg_get_features(VALUE self, VALUE type_or_plugin_name)
|
91
94
|
{
|
92
95
|
GList *list, *node;
|
93
96
|
GType gtype;
|
@@ -125,9 +128,9 @@ rb_gst_registry_get_features(VALUE self, VALUE type_or_plugin_name)
|
|
125
128
|
* Returns: always nil.
|
126
129
|
*/
|
127
130
|
static VALUE
|
128
|
-
|
131
|
+
rg_each_feature (VALUE self, VALUE type)
|
129
132
|
{
|
130
|
-
|
133
|
+
return rb_ary_yield (rg_get_features (self, type));
|
131
134
|
}
|
132
135
|
|
133
136
|
/*
|
@@ -138,18 +141,18 @@ rb_gst_registry_each_feature (VALUE self, VALUE type)
|
|
138
141
|
* Returns: an array of strings.
|
139
142
|
*/
|
140
143
|
static VALUE
|
141
|
-
|
144
|
+
rg_paths (VALUE self)
|
142
145
|
{
|
143
|
-
|
144
|
-
|
146
|
+
GList *list;
|
147
|
+
VALUE arr;
|
145
148
|
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
149
|
+
arr = rb_ary_new ();
|
150
|
+
for (list = gst_registry_get_path_list (RGST_REGISTRY (self));
|
151
|
+
list != NULL;
|
152
|
+
list = g_list_next (list))
|
153
|
+
rb_ary_push (arr, CSTR2RVAL ((gchar *) list->data));
|
154
|
+
g_list_free (list);
|
155
|
+
return arr;
|
153
156
|
}
|
154
157
|
|
155
158
|
/*
|
@@ -161,9 +164,9 @@ rb_gst_registry_get_paths (VALUE self)
|
|
161
164
|
* Returns: always nil.
|
162
165
|
*/
|
163
166
|
static VALUE
|
164
|
-
|
167
|
+
rg_each_path (VALUE self)
|
165
168
|
{
|
166
|
-
|
169
|
+
return rb_ary_yield (rg_paths (self));
|
167
170
|
}
|
168
171
|
|
169
172
|
/*
|
@@ -177,7 +180,7 @@ rb_gst_registry_each_path (VALUE self)
|
|
177
180
|
* Returns: nil.
|
178
181
|
*/
|
179
182
|
static VALUE
|
180
|
-
|
183
|
+
rg_add_path(VALUE self, VALUE path)
|
181
184
|
{
|
182
185
|
gst_registry_add_path(RGST_REGISTRY(self), RVAL2CSTR(path));
|
183
186
|
return Qnil;
|
@@ -192,7 +195,7 @@ rb_gst_registry_add_path(VALUE self, VALUE path)
|
|
192
195
|
* Returns: true on success, false otherwise.
|
193
196
|
*/
|
194
197
|
static VALUE
|
195
|
-
|
198
|
+
rg_add_plugin(VALUE self, VALUE plugin)
|
196
199
|
{
|
197
200
|
return CBOOL2RVAL(gst_registry_add_plugin(RGST_REGISTRY (self),
|
198
201
|
RGST_PLUGIN (plugin)));
|
@@ -207,11 +210,11 @@ rb_gst_registry_add_plugin(VALUE self, VALUE plugin)
|
|
207
210
|
* Returns: self.
|
208
211
|
*/
|
209
212
|
static VALUE
|
210
|
-
|
213
|
+
rg_remove_plugin (VALUE self, VALUE plugin)
|
211
214
|
{
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
+
gst_registry_remove_plugin (RGST_REGISTRY (self),
|
216
|
+
RGST_PLUGIN (plugin));
|
217
|
+
return self;
|
215
218
|
}
|
216
219
|
|
217
220
|
/*
|
@@ -224,13 +227,13 @@ rb_gst_registry_remove_plugin (VALUE self, VALUE plugin)
|
|
224
227
|
* otherwise returns nil.
|
225
228
|
*/
|
226
229
|
static VALUE
|
227
|
-
|
230
|
+
rg_find_plugin (VALUE self, VALUE name)
|
228
231
|
{
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
232
|
+
GstPlugin *plugin = gst_registry_find_plugin (RGST_REGISTRY (self),
|
233
|
+
RVAL2CSTR (name));
|
234
|
+
return plugin != NULL
|
235
|
+
? RGST_PLUGIN_NEW (plugin)
|
236
|
+
: Qnil;
|
234
237
|
}
|
235
238
|
|
236
239
|
/*
|
@@ -247,39 +250,39 @@ rb_gst_registry_find_plugin (VALUE self, VALUE name)
|
|
247
250
|
* named plugin feature is not found.
|
248
251
|
*/
|
249
252
|
static VALUE
|
250
|
-
|
253
|
+
rg_find_feature(VALUE self, VALUE name, VALUE type)
|
251
254
|
{
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
255
|
+
GstPluginFeature *feature;
|
256
|
+
GType gtype;
|
257
|
+
|
258
|
+
gtype = CLASS2GTYPE (type);
|
259
|
+
if (!is_valid_pluginfeature_type (gtype))
|
260
|
+
rb_raise (rb_eArgError, "Invalid feature type.");
|
261
|
+
feature = gst_registry_find_feature (RGST_REGISTRY (self),
|
262
|
+
RVAL2CSTR (name),
|
263
|
+
gtype);
|
264
|
+
return feature != NULL
|
265
|
+
? instanciate_pluginfeature (feature)
|
266
|
+
: Qnil;
|
264
267
|
}
|
265
268
|
|
266
269
|
void
|
267
|
-
Init_gst_registry (
|
270
|
+
Init_gst_registry (VALUE mGst)
|
268
271
|
{
|
269
|
-
|
272
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS (GST_TYPE_REGISTRY, "Registry", mGst);
|
273
|
+
|
274
|
+
RG_DEF_SMETHOD(default, 0);
|
275
|
+
RG_DEF_SMETHOD(update, 0);
|
270
276
|
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
rb_define_method(c, "remove_plugin", rb_gst_registry_remove_plugin, 1);
|
283
|
-
rb_define_method(c, "find_plugin", rb_gst_registry_find_plugin, 1);
|
284
|
-
rb_define_method(c, "find_feature", rb_gst_registry_find_feature, 2);
|
277
|
+
RG_DEF_METHOD(plugins, 0);
|
278
|
+
RG_DEF_METHOD(each_plugin, 0);
|
279
|
+
RG_DEF_METHOD(get_features, 1);
|
280
|
+
RG_DEF_METHOD(each_feature, 1);
|
281
|
+
RG_DEF_METHOD(paths, 0);
|
282
|
+
RG_DEF_METHOD(each_path, 0);
|
283
|
+
RG_DEF_METHOD(add_path, 1);
|
284
|
+
RG_DEF_METHOD(add_plugin, 1);
|
285
|
+
RG_DEF_METHOD(remove_plugin, 1);
|
286
|
+
RG_DEF_METHOD(find_plugin, 1);
|
287
|
+
RG_DEF_METHOD(find_feature, 2);
|
285
288
|
}
|