gstreamer 1.0.3 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. data/Rakefile +201 -3
  2. data/ext/gstreamer/extconf.rb +10 -10
  3. data/ext/gstreamer/misc.c +16 -15
  4. data/ext/gstreamer/rbgst-bin.c +75 -83
  5. data/ext/gstreamer/rbgst-buffer.c +91 -91
  6. data/ext/gstreamer/rbgst-bus.c +21 -21
  7. data/ext/gstreamer/rbgst-caps.c +98 -91
  8. data/ext/gstreamer/rbgst-child-proxy.c +19 -18
  9. data/ext/gstreamer/rbgst-clock.c +34 -32
  10. data/ext/gstreamer/rbgst-element-factory.c +79 -85
  11. data/ext/gstreamer/rbgst-element.c +245 -210
  12. data/ext/gstreamer/rbgst-event.c +18 -18
  13. data/ext/gstreamer/rbgst-ghost-pad.c +24 -21
  14. data/ext/gstreamer/rbgst-index-factory.c +31 -29
  15. data/ext/gstreamer/rbgst-install-plugins-context.c +86 -0
  16. data/ext/gstreamer/rbgst-install-plugins-return.c +45 -0
  17. data/ext/gstreamer/rbgst-install-plugins.c +45 -111
  18. data/ext/gstreamer/rbgst-message.c +15 -16
  19. data/ext/gstreamer/rbgst-mini-object.c +37 -37
  20. data/ext/gstreamer/rbgst-object.c +29 -26
  21. data/ext/gstreamer/rbgst-pad-template.c +36 -35
  22. data/ext/gstreamer/rbgst-pad.c +96 -96
  23. data/ext/gstreamer/rbgst-pipeline.c +32 -31
  24. data/ext/gstreamer/rbgst-plugin-feature.c +47 -48
  25. data/ext/gstreamer/rbgst-plugin.c +62 -64
  26. data/ext/gstreamer/rbgst-private.c +14 -15
  27. data/ext/gstreamer/rbgst-private.h +76 -16
  28. data/ext/gstreamer/rbgst-query.c +22 -20
  29. data/ext/gstreamer/rbgst-seek.c +22 -19
  30. data/ext/gstreamer/rbgst-static-caps.c +26 -24
  31. data/ext/gstreamer/rbgst-static-pad-template.c +27 -26
  32. data/ext/gstreamer/rbgst-structure.c +61 -59
  33. data/ext/gstreamer/rbgst-system-clock.c +23 -20
  34. data/ext/gstreamer/rbgst-type-find-factory.c +44 -43
  35. data/ext/gstreamer/rbgst-value.c +40 -28
  36. data/ext/gstreamer/rbgst-x-overlay.c +32 -31
  37. data/ext/gstreamer/rbgst.c +78 -128
  38. data/ext/gstreamer/rbgst.h +16 -16
  39. data/ext/gstreamer/rbgstclockentry.c +46 -43
  40. data/ext/gstreamer/rbgstformat.c +64 -61
  41. data/ext/gstreamer/rbgstindex.c +67 -64
  42. data/ext/gstreamer/rbgstindexentry.c +31 -28
  43. data/ext/gstreamer/rbgstparse.c +32 -29
  44. data/ext/gstreamer/rbgstquerytype.c +64 -61
  45. data/ext/gstreamer/rbgstregistry.c +79 -76
  46. data/ext/gstreamer/rbgsttag.c +34 -32
  47. data/ext/gstreamer/rbgsttagsetter.c +22 -19
  48. data/ext/gstreamer/rbgstxml.c +78 -75
  49. data/lib/gst.rb +15 -1
  50. data/test/test_buffer.rb +5 -2
  51. data/test/test_element.rb +7 -9
  52. data/test/test_value.rb +2 -2
  53. metadata +11 -11
  54. data/ChangeLog +0 -1202
  55. data/test/test_clock.rb +0 -7
@@ -1,24 +1,27 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
1
2
  /*
2
- * Copyright (C) 2003, 2004 Laurent Sansonetti <lrz@gnome.org>
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2003, 2004 Laurent Sansonetti <lrz@gnome.org>
3
5
  *
4
- * This file is part of Ruby/GStreamer.
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
- * Ruby/GStreamer 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.
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
- * Ruby/GStreamer 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.
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
- rb_gst_parse_launch (VALUE self, VALUE command)
42
+ rg_m_launch (VALUE self, VALUE command)
40
43
  {
41
44
  #if !defined(GST_DISABLE_PARSE)
42
- GError *error;
43
- GstBin *bin;
45
+ GError *error;
46
+ GstBin *bin;
44
47
 
45
- error = NULL;
46
- bin = (GstBin*)gst_parse_launch (RVAL2CSTR (command), &error);
47
- if (bin != NULL)
48
- return RGST_BIN_NEW (bin);
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
- rb_raise (rb_eRuntimeError,
52
- "This function has been disabled "
53
- "when GStreamer was compiled");
54
+ rb_raise (rb_eRuntimeError,
55
+ "This function has been disabled "
56
+ "when GStreamer was compiled");
54
57
  #endif
55
- return Qnil;
58
+ return Qnil;
56
59
  }
57
60
 
58
61
  void
59
- Init_gst_parse (void)
62
+ Init_gst_parse (VALUE mGst)
60
63
  {
61
- VALUE c = rb_define_module_under (mGst, "Parse");
62
- rb_define_module_function (c, "launch", rb_gst_parse_launch, 1);
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
- * Copyright (C) 2003, 2004 Laurent Sansonetti <lrz@gnome.org>
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2003, 2004 Laurent Sansonetti <lrz@gnome.org>
3
5
  *
4
- * This file is part of Ruby/GStreamer.
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
- * Ruby/GStreamer 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.
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
- * Ruby/GStreamer 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.
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
- GstQueryType *new_query_type;
31
- g_return_val_if_fail (query_type != NULL, NULL);
32
- new_query_type = g_new (GstQueryType, 1);
33
- *new_query_type = *query_type;
34
- return new_query_type;
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
- static GType our_type = 0;
41
- if (our_type == 0)
42
- our_type = g_boxed_type_register_static ("GstQueryTypeClass",
43
- (GBoxedCopyFunc)query_type_copy,
44
- (GBoxedFreeFunc)g_free);
45
- return our_type;
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
- rb_gst_querytype_find (VALUE self, VALUE nick)
59
+ rg_s_find (VALUE self, VALUE nick)
57
60
  {
58
- GstQueryType type = gst_query_type_get_by_nick (RVAL2CSTR (nick));
59
- return type != GST_QUERY_NONE
60
- ? RGST_QUERY_TYPE_NEW (&type)
61
- : Qnil;
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
- rb_gst_querytype_each (VALUE self)
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
- rb_gst_querytype_get_type_id (VALUE self)
94
+ rg_type_id (VALUE self)
92
95
  {
93
- GstQueryType *querytype = RGST_QUERY_TYPE (self);
94
- return INT2FIX (*querytype);
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
- rb_gst_querytype_get_nick (VALUE self)
104
+ rg_nick (VALUE self)
102
105
  {
103
- GstQueryType *querytype = RGST_QUERY_TYPE (self);
104
- return CSTR2RVAL (gst_query_type_get_details (*querytype)->nick);
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
- rb_gst_querytype_get_description (VALUE self)
114
+ rg_description (VALUE self)
112
115
  {
113
- GstQueryType *querytype = RGST_QUERY_TYPE (self);
114
- return CSTR2RVAL (gst_query_type_get_details (*querytype)->description);
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
- rb_gst_querytype_is_equal (VALUE self, VALUE other_query)
130
+ rg_operator_is_equal (VALUE self, VALUE other_query)
128
131
  {
129
- GstQueryType *q1, *q2;
130
- const gchar *n1, *n2;
132
+ GstQueryType *q1, *q2;
133
+ const gchar *n1, *n2;
131
134
 
132
- if (NIL_P (other_query))
133
- return Qfalse;
135
+ if (NIL_P (other_query))
136
+ return Qfalse;
134
137
 
135
- q1 = RGST_QUERY_TYPE (self);
136
- q2 = RGST_QUERY_TYPE (other_query);
138
+ q1 = RGST_QUERY_TYPE (self);
139
+ q2 = RGST_QUERY_TYPE (other_query);
137
140
 
138
- n1 = gst_query_type_get_details (*q1)->nick;
139
- n2 = gst_query_type_get_details (*q2)->nick;
141
+ n1 = gst_query_type_get_details (*q1)->nick;
142
+ n2 = gst_query_type_get_details (*q2)->nick;
140
143
 
141
- return CBOOL2RVAL( strcmp (n1, n2) == 0);
144
+ return CBOOL2RVAL( strcmp (n1, n2) == 0);
142
145
  }
143
146
 
144
147
  void
145
- Init_gst_querytype (void)
148
+ Init_gst_querytype (VALUE mGst)
146
149
  {
147
- VALUE c = G_DEF_CLASS (GST_TYPE_QUERY_TYPE2, "QueryType", mGst);
150
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS (GST_TYPE_QUERY_TYPE2, "QueryType", mGst);
148
151
 
149
- rb_define_singleton_method (c, "each", rb_gst_querytype_each, 0);
150
- rb_define_singleton_method (c, "find", rb_gst_querytype_find, 1);
152
+ RG_DEF_SMETHOD(each, 0);
153
+ RG_DEF_SMETHOD(find, 1);
151
154
 
152
- rb_define_method (c, "type_id", rb_gst_querytype_get_type_id, 0);
153
- rb_define_method (c, "nick", rb_gst_querytype_get_nick, 0);
154
- rb_define_method (c, "description", rb_gst_querytype_get_description, 0);
155
- rb_define_method (c, "==", rb_gst_querytype_is_equal, 1);
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
- G_DEF_CLASS (GST_TYPE_QUERY_TYPE, "Type", c);
158
- G_DEF_CONSTANTS (c, GST_TYPE_QUERY_TYPE, "GST_QUERY_");
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
- * Copyright (C) 2003, 2004 Laurent Sansonetti <lrz@gnome.org>
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2003, 2004 Laurent Sansonetti <lrz@gnome.org>
3
5
  *
4
- * This file is part of Ruby/GStreamer.
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
- * Ruby/GStreamer 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.
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
- * Ruby/GStreamer 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.
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
- rb_gst_registry_get_default(VALUE self)
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
- rb_gst_update_registry(VALUE self)
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
- rb_gst_registry_get_plugins(VALUE self)
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
- rb_gst_registry_each_plugin (VALUE self)
76
+ rg_each_plugin (VALUE self)
74
77
  {
75
- return rb_ary_yield (rb_gst_registry_get_plugins (self));
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
- rb_gst_registry_get_features(VALUE self, VALUE type_or_plugin_name)
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
- rb_gst_registry_each_feature (VALUE self, VALUE type)
131
+ rg_each_feature (VALUE self, VALUE type)
129
132
  {
130
- return rb_ary_yield (rb_gst_registry_get_features (self, type));
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
- rb_gst_registry_get_paths (VALUE self)
144
+ rg_paths (VALUE self)
142
145
  {
143
- GList *list;
144
- VALUE arr;
146
+ GList *list;
147
+ VALUE arr;
145
148
 
146
- arr = rb_ary_new ();
147
- for (list = gst_registry_get_path_list (RGST_REGISTRY (self));
148
- list != NULL;
149
- list = g_list_next (list))
150
- rb_ary_push (arr, CSTR2RVAL ((gchar *) list->data));
151
- g_list_free (list);
152
- return arr;
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
- rb_gst_registry_each_path (VALUE self)
167
+ rg_each_path (VALUE self)
165
168
  {
166
- return rb_ary_yield (rb_gst_registry_get_paths (self));
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
- rb_gst_registry_add_path(VALUE self, VALUE path)
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
- rb_gst_registry_add_plugin(VALUE self, VALUE plugin)
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
- rb_gst_registry_remove_plugin (VALUE self, VALUE plugin)
213
+ rg_remove_plugin (VALUE self, VALUE plugin)
211
214
  {
212
- gst_registry_remove_plugin (RGST_REGISTRY (self),
213
- RGST_PLUGIN (plugin));
214
- return self;
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
- rb_gst_registry_find_plugin (VALUE self, VALUE name)
230
+ rg_find_plugin (VALUE self, VALUE name)
228
231
  {
229
- GstPlugin *plugin = gst_registry_find_plugin (RGST_REGISTRY (self),
230
- RVAL2CSTR (name));
231
- return plugin != NULL
232
- ? RGST_PLUGIN_NEW (plugin)
233
- : Qnil;
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
- rb_gst_registry_find_feature(VALUE self, VALUE name, VALUE type)
253
+ rg_find_feature(VALUE self, VALUE name, VALUE type)
251
254
  {
252
- GstPluginFeature *feature;
253
- GType gtype;
254
-
255
- gtype = CLASS2GTYPE (type);
256
- if (!is_valid_pluginfeature_type (gtype))
257
- rb_raise (rb_eArgError, "Invalid feature type.");
258
- feature = gst_registry_find_feature (RGST_REGISTRY (self),
259
- RVAL2CSTR (name),
260
- gtype);
261
- return feature != NULL
262
- ? instanciate_pluginfeature (feature)
263
- : Qnil;
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 (void)
270
+ Init_gst_registry (VALUE mGst)
268
271
  {
269
- VALUE c = G_DEF_CLASS (GST_TYPE_REGISTRY, "Registry", mGst);
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
- rb_define_singleton_method(c, "default", rb_gst_registry_get_default, 0);
272
- rb_define_singleton_method(c, "update", rb_gst_update_registry, 0);
273
-
274
- rb_define_method(c, "plugins", rb_gst_registry_get_plugins, 0);
275
- rb_define_method(c, "each_plugin", rb_gst_registry_each_plugin, 0);
276
- rb_define_method(c, "get_features", rb_gst_registry_get_features, 1);
277
- rb_define_method(c, "each_feature", rb_gst_registry_each_feature, 1);
278
- rb_define_method(c, "paths", rb_gst_registry_get_paths, 0);
279
- rb_define_method(c, "each_path", rb_gst_registry_each_path, 0);
280
- rb_define_method(c, "add_path", rb_gst_registry_add_path, 1);
281
- rb_define_method(c, "add_plugin", rb_gst_registry_add_plugin, 1);
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
  }