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 cFormat
22
25
 
23
26
  /* Class: Gst::Format
24
27
  * Dynamically register new formats.
@@ -27,22 +30,22 @@
27
30
  static GstFormat *
28
31
  format_copy (const GstFormat* format)
29
32
  {
30
- GstFormat *new_format;
31
- g_return_val_if_fail (format != NULL, NULL);
32
- new_format = g_new (GstFormat, sizeof (GstFormat));
33
- *new_format = *format;
34
- return new_format;
33
+ GstFormat *new_format;
34
+ g_return_val_if_fail (format != NULL, NULL);
35
+ new_format = g_new (GstFormat, sizeof (GstFormat));
36
+ *new_format = *format;
37
+ return new_format;
35
38
  }
36
39
 
37
40
  GType
38
41
  gst_format_get_type2 (void)
39
42
  {
40
- static GType our_type = 0;
41
- if (our_type == 0)
42
- our_type = g_boxed_type_register_static ("GstFormatClass",
43
- (GBoxedCopyFunc)format_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 ("GstFormatClass",
46
+ (GBoxedCopyFunc)format_copy,
47
+ (GBoxedFreeFunc)g_free);
48
+ return our_type;
46
49
  }
47
50
 
48
51
  /*
@@ -53,12 +56,12 @@ gst_format_get_type2 (void)
53
56
  * given nick, or nil if this query was not registered.
54
57
  */
55
58
  static VALUE
56
- rb_gst_format_find (VALUE self, VALUE nick)
59
+ rg_s_find (VALUE self, VALUE nick)
57
60
  {
58
- GstFormat format = gst_format_get_by_nick (RVAL2CSTR (nick));
59
- return format != GST_FORMAT_UNDEFINED
60
- ? RGST_FORMAT_NEW (&format)
61
- : Qnil;
61
+ GstFormat format = gst_format_get_by_nick (RVAL2CSTR (nick));
62
+ return format != GST_FORMAT_UNDEFINED
63
+ ? RGST_FORMAT_NEW (&format)
64
+ : Qnil;
62
65
  }
63
66
 
64
67
  /*
@@ -70,7 +73,7 @@ rb_gst_format_find (VALUE self, VALUE nick)
70
73
  * Returns: always nil.
71
74
  */
72
75
  static VALUE
73
- rb_gst_format_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_format_each (VALUE self)
88
91
  * Returns: the type id of this format (see Gst::Format::Type).
89
92
  */
90
93
  static VALUE
91
- rb_gst_format_get_type_id (VALUE self)
94
+ rg_type_id (VALUE self)
92
95
  {
93
- GstFormat *format = RGST_FORMAT (self);
94
- return GENUM2RVAL (*format, GST_TYPE_FORMAT);
96
+ GstFormat *format = RGST_FORMAT (self);
97
+ return GENUM2RVAL (*format, GST_TYPE_FORMAT);
95
98
  }
96
99
 
97
100
  /* Method: nick
98
101
  * Returns: the short nick of the format.
99
102
  */
100
103
  static VALUE
101
- rb_gst_format_get_nick (VALUE self)
104
+ rg_nick (VALUE self)
102
105
  {
103
- GstFormat *format = RGST_FORMAT (self);
104
- return CSTR2RVAL (gst_format_get_details (*format)->nick);
106
+ GstFormat *format = RGST_FORMAT (self);
107
+ return CSTR2RVAL (gst_format_get_details (*format)->nick);
105
108
  }
106
109
 
107
110
  /* Method: description
108
111
  * Returns: a longer description of the format.
109
112
  */
110
113
  static VALUE
111
- rb_gst_format_get_description (VALUE self)
114
+ rg_description (VALUE self)
112
115
  {
113
- GstFormat *format = RGST_FORMAT (self);
114
- return CSTR2RVAL (gst_format_get_details (*format)->description);
116
+ GstFormat *format = RGST_FORMAT (self);
117
+ return CSTR2RVAL (gst_format_get_details (*format)->description);
115
118
  }
116
119
 
117
120
  /*
@@ -124,36 +127,36 @@ rb_gst_format_get_description (VALUE self)
124
127
  * Returns: true on success, false on failure.
125
128
  */
126
129
  static VALUE
127
- rb_gst_format_is_equal (VALUE self, VALUE other_format)
130
+ rg_operator_is_equal (VALUE self, VALUE other_format)
128
131
  {
129
- GstFormat *f1, *f2;
130
- const gchar *n1, *n2;
132
+ GstFormat *f1, *f2;
133
+ const gchar *n1, *n2;
131
134
 
132
- if (NIL_P (other_format))
133
- return Qfalse;
135
+ if (NIL_P (other_format))
136
+ return Qfalse;
134
137
 
135
- f1 = RGST_FORMAT (self);
136
- f2 = RGST_FORMAT (other_format);
138
+ f1 = RGST_FORMAT (self);
139
+ f2 = RGST_FORMAT (other_format);
137
140
 
138
- n1 = gst_format_get_details (*f1)->nick;
139
- n2 = gst_format_get_details (*f2)->nick;
141
+ n1 = gst_format_get_details (*f1)->nick;
142
+ n2 = gst_format_get_details (*f2)->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_format (void)
148
+ Init_gst_format (VALUE mGst)
146
149
  {
147
- VALUE c = G_DEF_CLASS (GST_TYPE_FORMAT2, "Format", mGst);
150
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS (GST_TYPE_FORMAT2, "Format", mGst);
148
151
 
149
- rb_define_singleton_method (c, "each", rb_gst_format_each, 0);
150
- rb_define_singleton_method (c, "find", rb_gst_format_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_format_get_type_id, 0);
153
- rb_define_method (c, "nick", rb_gst_format_get_nick, 0);
154
- rb_define_method (c, "description", rb_gst_format_get_description, 0);
155
- rb_define_method (c, "==", rb_gst_format_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_FORMAT, "Type", c);
158
- G_DEF_CONSTANTS (c, GST_TYPE_FORMAT, "GST_FORMAT_");
160
+ G_DEF_CLASS (GST_TYPE_FORMAT, "Type", RG_TARGET_NAMESPACE);
161
+ G_DEF_CONSTANTS (RG_TARGET_NAMESPACE, GST_TYPE_FORMAT, "GST_FORMAT_");
159
162
  }
@@ -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 cIndex
22
25
 
23
26
  /* Class: Gst::Index
24
27
  * Generates indexes on objects.
@@ -28,7 +31,7 @@
28
31
  * Returns: a newly allocated Gst::Index object.
29
32
  */
30
33
  static VALUE
31
- rb_gst_index_new (VALUE self)
34
+ rg_initialize (VALUE self)
32
35
  {
33
36
  GstIndex *index = gst_index_new ();
34
37
 
@@ -41,7 +44,7 @@ rb_gst_index_new (VALUE self)
41
44
  * Returns: whether the index can be read.
42
45
  */
43
46
  static VALUE
44
- rb_gst_index_is_readable (VALUE self)
47
+ rg_readable_p (VALUE self)
45
48
  {
46
49
  return CBOOL2RVAL (GST_INDEX_IS_READABLE (RGST_INDEX (self)));
47
50
  }
@@ -50,7 +53,7 @@ rb_gst_index_is_readable (VALUE self)
50
53
  * Returns: whether the index can be written.
51
54
  */
52
55
  static VALUE
53
- rb_gst_index_is_writable (VALUE self)
56
+ rg_writable_p (VALUE self)
54
57
  {
55
58
  return CBOOL2RVAL (GST_INDEX_IS_WRITABLE (RGST_INDEX (self)));
56
59
  }
@@ -65,7 +68,7 @@ rb_gst_index_is_writable (VALUE self)
65
68
  * Returns: self.
66
69
  */
67
70
  static VALUE
68
- rb_gst_index_commit (VALUE self, VALUE id)
71
+ rg_commit (VALUE self, VALUE id)
69
72
  {
70
73
  gst_index_commit (RGST_INDEX (self), FIX2INT (id));
71
74
  return self;
@@ -75,7 +78,7 @@ rb_gst_index_commit (VALUE self, VALUE id)
75
78
  * Returns: the ID of the current group.
76
79
  */
77
80
  static VALUE
78
- rb_gst_index_get_group (VALUE self)
81
+ rg_group (VALUE self)
79
82
  {
80
83
  return INT2FIX (gst_index_get_group (RGST_INDEX (self)));
81
84
  }
@@ -89,7 +92,7 @@ rb_gst_index_get_group (VALUE self)
89
92
  * Returns: the ID of the newly created group.
90
93
  */
91
94
  static VALUE
92
- rb_gst_index_new_group (VALUE self)
95
+ rg_new_group (VALUE self)
93
96
  {
94
97
  return INT2FIX (gst_index_new_group (RGST_INDEX (self)));
95
98
  }
@@ -103,7 +106,7 @@ rb_gst_index_new_group (VALUE self)
103
106
  * Returns: true if the operation succeeded, false if the group did not exist.
104
107
  */
105
108
  static VALUE
106
- rb_gst_index_set_group (VALUE self, VALUE group)
109
+ rg_set_group (VALUE self, VALUE group)
107
110
  {
108
111
  return
109
112
  CBOOL2RVAL (gst_index_set_group (RGST_INDEX (self), FIX2INT (group)));
@@ -113,7 +116,7 @@ rb_gst_index_set_group (VALUE self, VALUE group)
113
116
  * Returns: the certainty of the index (see Gst::Index::Certainty).
114
117
  */
115
118
  static VALUE
116
- rb_gst_index_get_certainty (VALUE self)
119
+ rg_certainty (VALUE self)
117
120
  {
118
121
  return GENUM2RVAL (gst_index_get_certainty (RGST_INDEX (self)),
119
122
  GST_TYPE_INDEX_CERTAINTY);
@@ -128,7 +131,7 @@ rb_gst_index_get_certainty (VALUE self)
128
131
  * Returns: self.
129
132
  */
130
133
  static VALUE
131
- rb_gst_index_set_certainty (VALUE self, VALUE certainty)
134
+ rg_set_certainty (VALUE self, VALUE certainty)
132
135
  {
133
136
  gst_index_set_certainty (RGST_INDEX (self),
134
137
  RVAL2GENUM (certainty, GST_TYPE_INDEX_CERTAINTY));
@@ -143,7 +146,7 @@ __filter (GstIndex * index, GstIndexEntry * entry)
143
146
  }
144
147
 
145
148
  static VALUE
146
- rb_gst_index_set_filter (VALUE self)
149
+ rg_set_filter (VALUE self)
147
150
  {
148
151
  /*
149
152
  * TODO
@@ -164,7 +167,7 @@ __resolver (GstIndex * index, GstObject * writer, gchar ** writer_string,
164
167
  }
165
168
 
166
169
  static VALUE
167
- rb_gst_index_set_resolver (VALUE self)
170
+ rg_set_resolver (VALUE self)
168
171
  {
169
172
  gst_index_set_resolver (RGST_INDEX (self), __resolver,
170
173
  (gpointer) rb_block_proc ());
@@ -180,15 +183,15 @@ rb_gst_index_set_resolver (VALUE self)
180
183
  * Adds an entry into the index. The type of the entry depends of
181
184
  * the number and kind of additional parameters.
182
185
  *
183
- * * For an ID type, args must be a String.
184
- * * For a FORMAT type, args must be a Gst::Format.
185
- * * For an ASSOCIATION type, args must contains an association flag (see Gst::Index::AssocFlags), a Gst::Format and a value for the format.
186
- * * For an OBJECT type, well you must wait, because it is not yet implemented.
186
+ * * For an ID type, args must be a String.
187
+ * * For a FORMAT type, args must be a Gst::Format.
188
+ * * For an ASSOCIATION type, args must contains an association flag (see Gst::Index::AssocFlags), a Gst::Format and a value for the format.
189
+ * * For an OBJECT type, well you must wait, because it is not yet implemented.
187
190
  *
188
191
  * Returns: a reference to the newly allocated entry in the index, as a Gst::EntryIndex object.
189
192
  */
190
193
  static VALUE
191
- rb_gst_index_add (int argc, VALUE * argv, VALUE self)
194
+ rg_add (int argc, VALUE * argv, VALUE self)
192
195
  {
193
196
  GstIndexEntry *index_entry;
194
197
  VALUE id;
@@ -247,7 +250,7 @@ __compare (gconstpointer a, gconstpointer b, gpointer user_data)
247
250
  * if the value is not found.
248
251
  */
249
252
  static VALUE
250
- rb_gst_index_get_assoc_entry (VALUE self, VALUE id, VALUE method, VALUE flags,
253
+ rg_get_assoc_entry (VALUE self, VALUE id, VALUE method, VALUE flags,
251
254
  VALUE format, VALUE value)
252
255
  {
253
256
  GstIndexEntry *index_entry;
@@ -276,39 +279,39 @@ rb_gst_index_get_assoc_entry (VALUE self, VALUE id, VALUE method, VALUE flags,
276
279
  }
277
280
 
278
281
  void
279
- Init_gst_index (void)
282
+ Init_gst_index (VALUE mGst)
280
283
  {
281
- VALUE c = G_DEF_CLASS (GST_TYPE_INDEX, "Index", mGst);
282
-
283
- rb_define_method (c, "initialize", rb_gst_index_new, 0);
284
- rb_define_method (c, "readable?", rb_gst_index_is_readable, 0);
285
- rb_define_method (c, "writable?", rb_gst_index_is_writable, 0);
286
- rb_define_method (c, "commit", rb_gst_index_commit, 1);
287
- rb_define_method (c, "group", rb_gst_index_get_group, 0);
288
- rb_define_method (c, "new_group", rb_gst_index_new_group, 0);
289
- rb_define_method (c, "set_group", rb_gst_index_set_group, 1);
290
- rb_define_method (c, "certainty", rb_gst_index_get_certainty, 0);
291
- rb_define_method (c, "set_certainty", rb_gst_index_set_certainty, 1);
284
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS (GST_TYPE_INDEX, "Index", mGst);
285
+
286
+ RG_DEF_METHOD(initialize, 0);
287
+ RG_DEF_METHOD_P(readable, 0);
288
+ RG_DEF_METHOD_P(writable, 0);
289
+ RG_DEF_METHOD(commit, 1);
290
+ RG_DEF_METHOD(group, 0);
291
+ RG_DEF_METHOD(new_group, 0);
292
+ RG_DEF_METHOD(set_group, 1);
293
+ RG_DEF_METHOD(certainty, 0);
294
+ RG_DEF_METHOD(set_certainty, 1);
292
295
  #if 0
293
- rb_define_method (c, "set_filter", rb_gst_index_set_filter, 0);
294
- rb_define_method (c, "set_resolver", rb_gst_index_set_resolver, 0);
296
+ RG_DEF_METHOD(set_filter, 0);
297
+ RG_DEF_METHOD(set_resolver, 0);
295
298
  #endif
296
- rb_define_method (c, "add", rb_gst_index_add, -1);
297
- rb_define_method (c, "get_assoc_entry", rb_gst_index_get_assoc_entry, 5);
298
-
299
- G_DEF_CLASS (GST_TYPE_INDEX_CERTAINTY, "Certainty", c);
300
- G_DEF_CONSTANTS (c, GST_TYPE_INDEX_CERTAINTY, "GST_INDEX_");
301
- G_DEF_CLASS (GST_TYPE_INDEX_LOOKUP_METHOD, "LookupMethod", c);
302
- G_DEF_CONSTANTS (c, GST_TYPE_INDEX_LOOKUP_METHOD, "GST_INDEX_");
303
- G_DEF_CLASS (GST_TYPE_ASSOC_FLAGS, "AssocFlags", c);
304
- G_DEF_CONSTANTS (c, GST_TYPE_ASSOC_FLAGS, "GST_");
305
- G_DEF_CLASS (GST_TYPE_INDEX_RESOLVER_METHOD, "ResolverMethod", c);
306
- G_DEF_CONSTANTS (c, GST_TYPE_INDEX_RESOLVER_METHOD, "GST_INDEX_");
307
- G_DEF_CLASS (GST_TYPE_INDEX_FLAGS, "Flags", c);
308
- G_DEF_CONSTANTS (c, GST_TYPE_INDEX_FLAGS, "GST_INDEX_");
309
-
310
- G_DEF_SETTERS (c);
311
-
312
- rb_undef_method (c, "resolver");
313
- rb_undef_method (c, "resolver=");
299
+ RG_DEF_METHOD(add, -1);
300
+ RG_DEF_METHOD(get_assoc_entry, 5);
301
+
302
+ G_DEF_CLASS (GST_TYPE_INDEX_CERTAINTY, "Certainty", RG_TARGET_NAMESPACE);
303
+ G_DEF_CONSTANTS (RG_TARGET_NAMESPACE, GST_TYPE_INDEX_CERTAINTY, "GST_INDEX_");
304
+ G_DEF_CLASS (GST_TYPE_INDEX_LOOKUP_METHOD, "LookupMethod", RG_TARGET_NAMESPACE);
305
+ G_DEF_CONSTANTS (RG_TARGET_NAMESPACE, GST_TYPE_INDEX_LOOKUP_METHOD, "GST_INDEX_");
306
+ G_DEF_CLASS (GST_TYPE_ASSOC_FLAGS, "AssocFlags", RG_TARGET_NAMESPACE);
307
+ G_DEF_CONSTANTS (RG_TARGET_NAMESPACE, GST_TYPE_ASSOC_FLAGS, "GST_");
308
+ G_DEF_CLASS (GST_TYPE_INDEX_RESOLVER_METHOD, "ResolverMethod", RG_TARGET_NAMESPACE);
309
+ G_DEF_CONSTANTS (RG_TARGET_NAMESPACE, GST_TYPE_INDEX_RESOLVER_METHOD, "GST_INDEX_");
310
+ G_DEF_CLASS (GST_TYPE_INDEX_FLAGS, "Flags", RG_TARGET_NAMESPACE);
311
+ G_DEF_CONSTANTS (RG_TARGET_NAMESPACE, GST_TYPE_INDEX_FLAGS, "GST_INDEX_");
312
+
313
+ G_DEF_SETTERS (RG_TARGET_NAMESPACE);
314
+
315
+ rb_undef_method (RG_TARGET_NAMESPACE, "resolver");
316
+ rb_undef_method (RG_TARGET_NAMESPACE, "resolver=");
314
317
  }
@@ -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 cIndexEntry
22
25
 
23
26
  /* Class: Gst::IndexEntry
24
27
  * An index's entry.
@@ -29,15 +32,15 @@
29
32
  *
30
33
  * Gets the internal data stored in the entry. The data depends of the type
31
34
  * of the entry:
32
- * * Gst::IndexEntry::ID: the description of the ID, as a String.
33
- * * Gst::IndexEntry::ASSOCIATION: an Array that contains the number of associations, a Gst::Format, the value of the format and the association flags (see Gst::Index::AssocFlags).
34
- * * Gst::IndexEntry::FORMAT: an Array that contains a Gst::Format and its value.
35
- * * Gst::IndexEntry::OBJECt: not yet implemented.
35
+ * * Gst::IndexEntry::ID: the description of the ID, as a String.
36
+ * * Gst::IndexEntry::ASSOCIATION: an Array that contains the number of associations, a Gst::Format, the value of the format and the association flags (see Gst::Index::AssocFlags).
37
+ * * Gst::IndexEntry::FORMAT: an Array that contains a Gst::Format and its value.
38
+ * * Gst::IndexEntry::OBJECt: not yet implemented.
36
39
  *
37
40
  * Returns: the internal data of the entry.
38
41
  */
39
42
  static VALUE
40
- rb_gst_index_entry_get_data (VALUE self)
43
+ rg_data (VALUE self)
41
44
  {
42
45
  GstIndexEntry *entry;
43
46
  VALUE data;
@@ -75,7 +78,7 @@ rb_gst_index_entry_get_data (VALUE self)
75
78
  * Returns: the type of the entry (see Gst::IndexEntry::Types).
76
79
  */
77
80
  static VALUE
78
- rb_gst_index_entry_get_type (VALUE self)
81
+ rg_entry_type (VALUE self)
79
82
  {
80
83
  GstIndexEntry *entry = RGST_INDEX_ENTRY (self);
81
84
 
@@ -83,14 +86,14 @@ rb_gst_index_entry_get_type (VALUE self)
83
86
  }
84
87
 
85
88
  void
86
- Init_gst_indexentry (void)
89
+ Init_gst_indexentry (VALUE mGst)
87
90
  {
88
- VALUE c = G_DEF_CLASS (GST_TYPE_INDEX_ENTRY, "IndexEntry", mGst);
91
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS (GST_TYPE_INDEX_ENTRY, "IndexEntry", mGst);
89
92
 
90
- rb_undef_method (c, "initialize");
91
- rb_define_method (c, "data", rb_gst_index_entry_get_data, 0);
92
- rb_define_method (c, "entry_type", rb_gst_index_entry_get_type, 0);
93
+ rb_undef_method (RG_TARGET_NAMESPACE, "initialize");
94
+ RG_DEF_METHOD(data, 0);
95
+ RG_DEF_METHOD(entry_type, 0);
93
96
 
94
- G_DEF_CLASS (GST_TYPE_INDEX_ENTRY_TYPE, "Types", c);
95
- G_DEF_CONSTANTS (c, GST_TYPE_INDEX_ENTRY_TYPE, "GST_INDEX_ENTRY_");
97
+ G_DEF_CLASS (GST_TYPE_INDEX_ENTRY_TYPE, "Types", RG_TARGET_NAMESPACE);
98
+ G_DEF_CONSTANTS (RG_TARGET_NAMESPACE, GST_TYPE_INDEX_ENTRY_TYPE, "GST_INDEX_ENTRY_");
96
99
  }