gstreamer 1.0.3 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
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,25 +1,27 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
1
2
  /*
2
- * Copyright (C) 2007 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2011-2012 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2007 Ruby-GNOME2 Project Team
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"
22
23
 
24
+ #define RG_TARGET_NAMESPACE cBuffer
23
25
  #define SELF(obj) (RVAL2GST_BUF(obj))
24
26
  #define RVAL2GST_FLAGS(flags) \
25
27
  (RVAL2GFLAGS(flags, GST_TYPE_BUFFER_FLAG))
@@ -31,7 +33,7 @@
31
33
  (GFLAGS2RVAL(flags, GST_TYPE_BUFFER_COPY_FLAGS))
32
34
 
33
35
  static VALUE
34
- initialize(int argc, VALUE *argv, VALUE self)
36
+ rg_initialize(int argc, VALUE *argv, VALUE self)
35
37
  {
36
38
  VALUE size;
37
39
  GstBuffer *buffer;
@@ -49,41 +51,41 @@ initialize(int argc, VALUE *argv, VALUE self)
49
51
  }
50
52
 
51
53
  static VALUE
52
- get_flags(VALUE self)
54
+ rg_flags(VALUE self)
53
55
  {
54
56
  return GST_FLAGS2RVAL(GST_BUFFER_FLAGS(SELF(self)));
55
57
  }
56
58
 
57
59
  static VALUE
58
- set_flags(VALUE self, VALUE flag)
60
+ rg_set_flags(VALUE self, VALUE flag)
59
61
  {
60
62
  GST_BUFFER_FLAGS(SELF(self)) = RVAL2GST_FLAGS(flag);
61
63
  return Qnil;
62
64
  }
63
65
 
64
66
  static VALUE
65
- raise_flag(VALUE self, VALUE flag)
67
+ rg_raise_flag(VALUE self, VALUE flag)
66
68
  {
67
69
  GST_MINI_OBJECT_FLAG_SET(SELF(self), RVAL2GST_FLAGS(flag));
68
70
  return Qnil;
69
71
  }
70
72
 
71
73
  static VALUE
72
- lower_flag(VALUE self, VALUE flag)
74
+ rg_lower_flag(VALUE self, VALUE flag)
73
75
  {
74
76
  GST_MINI_OBJECT_FLAG_UNSET(SELF(self), RVAL2GST_FLAGS(flag));
75
77
  return Qnil;
76
78
  }
77
79
 
78
80
  static VALUE
79
- flag_raised_p(VALUE self, VALUE flag)
81
+ rg_flag_raised_p(VALUE self, VALUE flag)
80
82
  {
81
83
  return CBOOL2RVAL(GST_MINI_OBJECT_FLAG_IS_SET(SELF(self),
82
84
  RVAL2GST_FLAGS(flag)));
83
85
  }
84
86
 
85
87
  static VALUE
86
- get_data(VALUE self)
88
+ rg_data(VALUE self)
87
89
  {
88
90
  GstBuffer *buffer;
89
91
  guint size;
@@ -98,7 +100,7 @@ get_data(VALUE self)
98
100
  }
99
101
 
100
102
  static VALUE
101
- set_data(VALUE self, VALUE data)
103
+ rg_set_data(VALUE self, VALUE data)
102
104
  {
103
105
  GstBuffer *buffer;
104
106
  buffer = SELF(self);
@@ -115,115 +117,115 @@ set_data(VALUE self, VALUE data)
115
117
  }
116
118
 
117
119
  static VALUE
118
- get_size(VALUE self)
120
+ rg_size(VALUE self)
119
121
  {
120
122
  return UINT2NUM(GST_BUFFER_SIZE(SELF(self)));
121
123
  }
122
124
 
123
125
  static VALUE
124
- set_size(VALUE self, VALUE size)
126
+ rg_set_size(VALUE self, VALUE size)
125
127
  {
126
128
  GST_BUFFER_SIZE(SELF(self)) = NUM2UINT(size);
127
129
  return Qnil;
128
130
  }
129
131
 
130
132
  static VALUE
131
- get_timestamp(VALUE self)
133
+ rg_timestamp(VALUE self)
132
134
  {
133
135
  return ULL2NUM(GST_BUFFER_TIMESTAMP(SELF(self)));
134
136
  }
135
137
 
136
138
  static VALUE
137
- set_timestamp(VALUE self, VALUE timestamp)
139
+ rg_set_timestamp(VALUE self, VALUE timestamp)
138
140
  {
139
141
  GST_BUFFER_TIMESTAMP(SELF(self)) = NUM2ULL(timestamp);
140
142
  return Qnil;
141
143
  }
142
144
 
143
145
  static VALUE
144
- valid_timestamp_p(VALUE self)
146
+ rg_valid_timestamp_p(VALUE self)
145
147
  {
146
148
  return CBOOL2RVAL(GST_BUFFER_TIMESTAMP_IS_VALID(SELF(self)));
147
149
  }
148
150
 
149
151
  static VALUE
150
- get_duration(VALUE self)
152
+ rg_duration(VALUE self)
151
153
  {
152
154
  return ULL2NUM(GST_BUFFER_DURATION(SELF(self)));
153
155
  }
154
156
 
155
157
  static VALUE
156
- set_duration(VALUE self, VALUE duration)
158
+ rg_set_duration(VALUE self, VALUE duration)
157
159
  {
158
160
  GST_BUFFER_DURATION(SELF(self)) = NUM2ULL(duration);
159
161
  return Qnil;
160
162
  }
161
163
 
162
164
  static VALUE
163
- valid_duration_p(VALUE self)
165
+ rg_valid_duration_p(VALUE self)
164
166
  {
165
167
  return CBOOL2RVAL(GST_BUFFER_DURATION_IS_VALID(SELF(self)));
166
168
  }
167
169
 
168
170
  static VALUE
169
- get_caps(VALUE self)
171
+ rg_caps(VALUE self)
170
172
  {
171
173
  return GST_CAPS2RVAL(GST_BUFFER_CAPS(SELF(self)));
172
174
  }
173
175
 
174
176
  static VALUE
175
- set_caps(VALUE self, VALUE caps)
177
+ rg_set_caps(VALUE self, VALUE caps)
176
178
  {
177
179
  gst_buffer_set_caps(SELF(self), RVAL2GST_CAPS(caps));
178
180
  return Qnil;
179
181
  }
180
182
 
181
183
  static VALUE
182
- get_offset(VALUE self)
184
+ rg_offset(VALUE self)
183
185
  {
184
186
  return ULL2NUM(GST_BUFFER_OFFSET(SELF(self)));
185
187
  }
186
188
 
187
189
  static VALUE
188
- set_offset(VALUE self, VALUE offset)
190
+ rg_set_offset(VALUE self, VALUE offset)
189
191
  {
190
192
  GST_BUFFER_OFFSET(SELF(self)) = NUM2ULL(offset);
191
193
  return Qnil;
192
194
  }
193
195
 
194
196
  static VALUE
195
- valid_offset_p(VALUE self)
197
+ rg_valid_offset_p(VALUE self)
196
198
  {
197
199
  return CBOOL2RVAL(GST_BUFFER_OFFSET_IS_VALID(SELF(self)));
198
200
  }
199
201
 
200
202
  static VALUE
201
- get_offset_end(VALUE self)
203
+ rg_offset_end(VALUE self)
202
204
  {
203
205
  return ULL2NUM(GST_BUFFER_OFFSET_END(SELF(self)));
204
206
  }
205
207
 
206
208
  static VALUE
207
- set_offset_end(VALUE self, VALUE offset_end)
209
+ rg_set_offset_end(VALUE self, VALUE offset_end)
208
210
  {
209
211
  GST_BUFFER_OFFSET_END(SELF(self)) = NUM2ULL(offset_end);
210
212
  return Qnil;
211
213
  }
212
214
 
213
215
  static VALUE
214
- valid_offset_end_p(VALUE self)
216
+ rg_valid_offset_end_p(VALUE self)
215
217
  {
216
218
  return CBOOL2RVAL(GST_BUFFER_OFFSET_END_IS_VALID(SELF(self)));
217
219
  }
218
220
 
219
221
  static VALUE
220
- discontinuity_p(VALUE self)
222
+ rg_discontinuity_p(VALUE self)
221
223
  {
222
224
  return CBOOL2RVAL(GST_BUFFER_IS_DISCONT(SELF(self)));
223
225
  }
224
226
 
225
227
  static VALUE
226
- copy_metadata(int argc, VALUE *argv, VALUE self)
228
+ rg_copy_metadata(int argc, VALUE *argv, VALUE self)
227
229
  {
228
230
  VALUE arg1, arg2, copied_dest;
229
231
  GstBuffer *dest;
@@ -247,13 +249,13 @@ copy_metadata(int argc, VALUE *argv, VALUE self)
247
249
  }
248
250
 
249
251
  static VALUE
250
- metadata_writable_p(VALUE self)
252
+ rg_metadata_writable_p(VALUE self)
251
253
  {
252
254
  return CBOOL2RVAL(gst_buffer_is_metadata_writable(SELF(self)));
253
255
  }
254
256
 
255
257
  static VALUE
256
- metadata_writable_bang(VALUE self)
258
+ rg_metadata_writable_bang(VALUE self)
257
259
  {
258
260
  GstBuffer *orig_buffer, *buffer;
259
261
  VALUE rb_buffer;
@@ -268,7 +270,7 @@ metadata_writable_bang(VALUE self)
268
270
  }
269
271
 
270
272
  static VALUE
271
- create_sub(VALUE self, VALUE offset, VALUE size)
273
+ rg_create_sub(VALUE self, VALUE offset, VALUE size)
272
274
  {
273
275
  GstBuffer *buffer;
274
276
  VALUE rb_buffer;
@@ -279,87 +281,85 @@ create_sub(VALUE self, VALUE offset, VALUE size)
279
281
  }
280
282
 
281
283
  static VALUE
282
- span(VALUE self, VALUE offset, VALUE other, VALUE length)
284
+ rg_span(VALUE self, VALUE offset, VALUE other, VALUE length)
283
285
  {
284
286
  return GOBJ2RVAL(gst_buffer_span(SELF(self), NUM2UINT(offset),
285
287
  SELF(other), NUM2UINT(length)));
286
288
  }
287
289
 
288
290
  static VALUE
289
- span_p(VALUE self, VALUE other)
291
+ rg_span_p(VALUE self, VALUE other)
290
292
  {
291
293
  return CBOOL2RVAL(gst_buffer_is_span_fast(SELF(self), SELF(other)));
292
294
  }
293
295
 
294
296
  void
295
- Init_gst_buffer(void)
297
+ Init_gst_buffer(VALUE mGst)
296
298
  {
297
- VALUE rb_cGstBuffer, rb_cGstBufferCopyFlags;
299
+ VALUE RG_TARGET_NAMESPACE, rb_cGstBufferCopyFlags;
298
300
 
299
- rb_cGstBuffer = G_DEF_CLASS(GST_TYPE_BUFFER, "Buffer", mGst);
301
+ RG_TARGET_NAMESPACE = G_DEF_CLASS(GST_TYPE_BUFFER, "Buffer", mGst);
300
302
 
301
- rb_define_const(rb_cGstBuffer, "OFFSET_NONE",
303
+ rb_define_const(RG_TARGET_NAMESPACE, "OFFSET_NONE",
302
304
  ULL2NUM(GST_BUFFER_OFFSET_NONE));
303
305
 
304
- G_DEF_CLASS(GST_TYPE_BUFFER_FLAG, "Flags", rb_cGstBuffer);
305
- G_DEF_CONSTANTS(rb_cGstBuffer, GST_TYPE_BUFFER_FLAG, "GST_BUFFER_");
306
+ G_DEF_CLASS(GST_TYPE_BUFFER_FLAG, "Flags", RG_TARGET_NAMESPACE);
307
+ G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GST_TYPE_BUFFER_FLAG, "GST_BUFFER_");
306
308
 
307
309
  rb_cGstBufferCopyFlags = G_DEF_CLASS(GST_TYPE_BUFFER_COPY_FLAGS,
308
- "CopyFlags", rb_cGstBuffer);
309
- G_DEF_CONSTANTS(rb_cGstBuffer, GST_TYPE_BUFFER_COPY_FLAGS, "GST_BUFFER_");
310
+ "CopyFlags", RG_TARGET_NAMESPACE);
311
+ G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GST_TYPE_BUFFER_COPY_FLAGS, "GST_BUFFER_");
310
312
  rb_define_const(rb_cGstBufferCopyFlags, "ALL",
311
313
  GST_COPY_FLAGS2RVAL(GST_BUFFER_COPY_ALL));
312
- rb_define_const(rb_cGstBuffer, "COPY_ALL",
314
+ rb_define_const(RG_TARGET_NAMESPACE, "COPY_ALL",
313
315
  GST_COPY_FLAGS2RVAL(GST_BUFFER_COPY_ALL));
314
316
 
315
- rb_define_method(rb_cGstBuffer, "initialize", initialize, -1);
317
+ RG_DEF_METHOD(initialize, -1);
316
318
 
317
- rb_define_method(rb_cGstBuffer, "flags", get_flags, 0);
318
- rb_define_method(rb_cGstBuffer, "set_flags", set_flags, 1);
319
- rb_define_method(rb_cGstBuffer, "raise_flag", raise_flag, 1);
320
- rb_define_method(rb_cGstBuffer, "lower_flag", lower_flag, 1);
321
- rb_define_method(rb_cGstBuffer, "flag_raised?", flag_raised_p, 1);
319
+ RG_DEF_METHOD(flags, 0);
320
+ RG_DEF_METHOD(set_flags, 1);
321
+ RG_DEF_METHOD(raise_flag, 1);
322
+ RG_DEF_METHOD(lower_flag, 1);
323
+ RG_DEF_METHOD_P(flag_raised, 1);
322
324
 
323
- rb_define_method(rb_cGstBuffer, "data", get_data, 0);
324
- rb_define_method(rb_cGstBuffer, "set_data", set_data, 1);
325
+ RG_DEF_METHOD(data, 0);
326
+ RG_DEF_METHOD(set_data, 1);
325
327
 
326
- rb_define_method(rb_cGstBuffer, "size", get_size, 0);
327
- rb_define_method(rb_cGstBuffer, "set_size", set_size, 1);
328
- rb_define_alias(rb_cGstBuffer, "length", "size");
329
- rb_define_alias(rb_cGstBuffer, "set_length", "set_size");
328
+ RG_DEF_METHOD(size, 0);
329
+ RG_DEF_METHOD(set_size, 1);
330
+ RG_DEF_ALIAS("length", "size");
331
+ RG_DEF_ALIAS("set_length", "set_size");
330
332
 
331
- rb_define_method(rb_cGstBuffer, "timestamp", get_timestamp, 0);
332
- rb_define_method(rb_cGstBuffer, "set_timestamp", set_timestamp, 1);
333
- rb_define_method(rb_cGstBuffer, "valid_timestamp?", valid_timestamp_p, 0);
333
+ RG_DEF_METHOD(timestamp, 0);
334
+ RG_DEF_METHOD(set_timestamp, 1);
335
+ RG_DEF_METHOD_P(valid_timestamp, 0);
334
336
 
335
- rb_define_method(rb_cGstBuffer, "duration", get_duration, 0);
336
- rb_define_method(rb_cGstBuffer, "set_duration", set_duration, 1);
337
- rb_define_method(rb_cGstBuffer, "valid_duration?", valid_duration_p, 0);
337
+ RG_DEF_METHOD(duration, 0);
338
+ RG_DEF_METHOD(set_duration, 1);
339
+ RG_DEF_METHOD_P(valid_duration, 0);
338
340
 
339
- rb_define_method(rb_cGstBuffer, "caps", get_caps, 0);
340
- rb_define_method(rb_cGstBuffer, "set_caps", set_caps, 1);
341
+ RG_DEF_METHOD(caps, 0);
342
+ RG_DEF_METHOD(set_caps, 1);
341
343
 
342
- rb_define_method(rb_cGstBuffer, "offset", get_offset, 0);
343
- rb_define_method(rb_cGstBuffer, "set_offset", set_offset, 1);
344
- rb_define_method(rb_cGstBuffer, "valid_offset?", valid_offset_p, 0);
344
+ RG_DEF_METHOD(offset, 0);
345
+ RG_DEF_METHOD(set_offset, 1);
346
+ RG_DEF_METHOD_P(valid_offset, 0);
345
347
 
346
- rb_define_method(rb_cGstBuffer, "offset_end", get_offset_end, 0);
347
- rb_define_method(rb_cGstBuffer, "set_offset_end", set_offset_end, 1);
348
- rb_define_method(rb_cGstBuffer, "valid_offset_end?", valid_offset_end_p, 0);
348
+ RG_DEF_METHOD(offset_end, 0);
349
+ RG_DEF_METHOD(set_offset_end, 1);
350
+ RG_DEF_METHOD_P(valid_offset_end, 0);
349
351
 
350
- rb_define_method(rb_cGstBuffer, "discontinuity?", discontinuity_p, 0);
352
+ RG_DEF_METHOD_P(discontinuity, 0);
351
353
 
352
- rb_define_method(rb_cGstBuffer, "copy_metadata", copy_metadata, -1);
354
+ RG_DEF_METHOD(copy_metadata, -1);
353
355
 
354
- rb_define_method(rb_cGstBuffer, "metadata_writable?",
355
- metadata_writable_p, 0);
356
- rb_define_method(rb_cGstBuffer, "metadata_writable!",
357
- metadata_writable_bang, 0);
356
+ RG_DEF_METHOD_P(metadata_writable, 0);
357
+ RG_DEF_METHOD_BANG(metadata_writable, 0);
358
358
 
359
- rb_define_method(rb_cGstBuffer, "create_sub", create_sub, 2);
359
+ RG_DEF_METHOD(create_sub, 2);
360
360
 
361
- rb_define_method(rb_cGstBuffer, "span", span, 3);
362
- rb_define_method(rb_cGstBuffer, "span?", span_p, 1);
361
+ RG_DEF_METHOD(span, 3);
362
+ RG_DEF_METHOD_P(span, 1);
363
363
 
364
- G_DEF_SETTERS(rb_cGstBuffer);
364
+ G_DEF_SETTERS(RG_TARGET_NAMESPACE);
365
365
  }
@@ -1,30 +1,31 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2007 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2007 Ruby-GNOME2 Project Team
4
5
  *
5
- * 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.
6
10
  *
7
- * Ruby/GStreamer is free software; you can redistribute it and/or
8
- * modify it under the terms of the GNU Lesser General Public
9
- * License as published by the Free Software Foundation; either
10
- * 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.
11
15
  *
12
- * Ruby/GStreamer is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
- * Lesser General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU Lesser General Public
18
- * License along with Ruby/GStreamer; if not, write to the Free Software
19
- * 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
20
20
  */
21
21
 
22
- #include "rbgst.h"
22
+ #include "rbgst-private.h"
23
23
 
24
24
  /* Class: Gst::Bus
25
25
  * Asynchronous message bus subsystem.
26
26
  */
27
27
 
28
+ #define RG_TARGET_NAMESPACE cBus
28
29
  #define SELF(obj) (RVAL2GST_BUS(obj))
29
30
 
30
31
  static ID id_call;
@@ -56,7 +57,7 @@ destroy_watch_func(gpointer data)
56
57
  }
57
58
 
58
59
  static VALUE
59
- rb_gst_bus_add_watch(int argc, VALUE *argv, VALUE self)
60
+ rg_add_watch(int argc, VALUE *argv, VALUE self)
60
61
  {
61
62
  VALUE rb_priority, block, rb_id;
62
63
  gint priority;
@@ -78,15 +79,14 @@ rb_gst_bus_add_watch(int argc, VALUE *argv, VALUE self)
78
79
  return rb_id;
79
80
  }
80
81
 
81
-
82
82
  void
83
- Init_gst_bus (void)
83
+ Init_gst_bus (VALUE mGst)
84
84
  {
85
- VALUE rb_cGstBus;
85
+ VALUE RG_TARGET_NAMESPACE;
86
86
 
87
87
  id_call = rb_intern("call");
88
88
 
89
- rb_cGstBus = G_DEF_CLASS(GST_TYPE_BUS, "Bus", mGst);
89
+ RG_TARGET_NAMESPACE = G_DEF_CLASS(GST_TYPE_BUS, "Bus", mGst);
90
90
 
91
- rb_define_method(rb_cGstBus, "add_watch", rb_gst_bus_add_watch, -1);
91
+ RG_DEF_METHOD(add_watch, -1);
92
92
  }