gstreamer 1.2.6 → 2.0.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 (92) hide show
  1. data/Rakefile +78 -39
  2. data/ext/gstreamer/extconf.rb +8 -22
  3. data/ext/gstreamer/rbgst.c +82 -194
  4. data/lib/gst/base_loader.rb +20 -0
  5. data/lib/gst/bin.rb +32 -0
  6. data/lib/gst/bus.rb +24 -0
  7. data/lib/gst/element.rb +48 -0
  8. data/lib/gst.rb +87 -22
  9. data/sample/helloworld.rb +75 -0
  10. data/sample/mp3parselaunch.rb +74 -0
  11. data/sample/queue.rb +92 -0
  12. data/sample/typefind.rb +101 -0
  13. metadata +29 -84
  14. data/README +0 -33
  15. data/ext/gstreamer/misc.c +0 -63
  16. data/ext/gstreamer/rbgst-bin.c +0 -456
  17. data/ext/gstreamer/rbgst-buffer.c +0 -363
  18. data/ext/gstreamer/rbgst-bus.c +0 -92
  19. data/ext/gstreamer/rbgst-caps.c +0 -446
  20. data/ext/gstreamer/rbgst-child-proxy.c +0 -34
  21. data/ext/gstreamer/rbgst-clock.c +0 -108
  22. data/ext/gstreamer/rbgst-element-factory.c +0 -249
  23. data/ext/gstreamer/rbgst-element.c +0 -1106
  24. data/ext/gstreamer/rbgst-event.c +0 -352
  25. data/ext/gstreamer/rbgst-ghost-pad.c +0 -45
  26. data/ext/gstreamer/rbgst-index-factory.c +0 -69
  27. data/ext/gstreamer/rbgst-install-plugins-context.c +0 -87
  28. data/ext/gstreamer/rbgst-install-plugins-return.c +0 -45
  29. data/ext/gstreamer/rbgst-install-plugins.c +0 -125
  30. data/ext/gstreamer/rbgst-message.c +0 -785
  31. data/ext/gstreamer/rbgst-mini-object.c +0 -221
  32. data/ext/gstreamer/rbgst-object.c +0 -81
  33. data/ext/gstreamer/rbgst-pad-template.c +0 -125
  34. data/ext/gstreamer/rbgst-pad.c +0 -336
  35. data/ext/gstreamer/rbgst-pipeline.c +0 -91
  36. data/ext/gstreamer/rbgst-plugin-feature.c +0 -131
  37. data/ext/gstreamer/rbgst-plugin.c +0 -162
  38. data/ext/gstreamer/rbgst-private.c +0 -88
  39. data/ext/gstreamer/rbgst-private.h +0 -97
  40. data/ext/gstreamer/rbgst-query.c +0 -291
  41. data/ext/gstreamer/rbgst-seek.c +0 -39
  42. data/ext/gstreamer/rbgst-static-caps.c +0 -49
  43. data/ext/gstreamer/rbgst-static-pad-template.c +0 -65
  44. data/ext/gstreamer/rbgst-structure.c +0 -300
  45. data/ext/gstreamer/rbgst-system-clock.c +0 -48
  46. data/ext/gstreamer/rbgst-type-find-factory.c +0 -125
  47. data/ext/gstreamer/rbgst-value.c +0 -527
  48. data/ext/gstreamer/rbgst-x-overlay.c +0 -131
  49. data/ext/gstreamer/rbgst.h +0 -197
  50. data/ext/gstreamer/rbgstclockentry.c +0 -271
  51. data/ext/gstreamer/rbgstformat.c +0 -162
  52. data/ext/gstreamer/rbgstindex.c +0 -315
  53. data/ext/gstreamer/rbgstindexentry.c +0 -99
  54. data/ext/gstreamer/rbgstparse.c +0 -69
  55. data/ext/gstreamer/rbgstquerytype.c +0 -162
  56. data/ext/gstreamer/rbgstregistry.c +0 -288
  57. data/ext/gstreamer/rbgsttag.c +0 -113
  58. data/ext/gstreamer/rbgsttagsetter.c +0 -53
  59. data/ext/gstreamer/rbgstxml.c +0 -192
  60. data/sample/audio-player.rb +0 -54
  61. data/sample/gst-gi.rb +0 -55
  62. data/sample/gst-inspect.rb +0 -417
  63. data/sample/install-plugins.rb +0 -40
  64. data/sample/media-type.rb +0 -55
  65. data/sample/media-type2.rb +0 -268
  66. data/sample/ogg-audio-player.rb +0 -54
  67. data/sample/type-find.rb +0 -46
  68. data/sample/video-player.rb +0 -57
  69. data/sample/xml-player.rb +0 -60
  70. data/test/gst-test-utils.rb +0 -18
  71. data/test/run-test.rb +0 -25
  72. data/test/test_bin.rb +0 -167
  73. data/test/test_buffer.rb +0 -185
  74. data/test/test_caps.rb +0 -24
  75. data/test/test_element.rb +0 -85
  76. data/test/test_element_factory.rb +0 -28
  77. data/test/test_event.rb +0 -10
  78. data/test/test_index_factory.rb +0 -7
  79. data/test/test_install-plugins.rb +0 -18
  80. data/test/test_message.rb +0 -191
  81. data/test/test_mini_object.rb +0 -38
  82. data/test/test_object.rb +0 -10
  83. data/test/test_pad.rb +0 -68
  84. data/test/test_plugin.rb +0 -6
  85. data/test/test_plugin_feature.rb +0 -20
  86. data/test/test_seek.rb +0 -17
  87. data/test/test_static_caps.rb +0 -18
  88. data/test/test_static_pad_template.rb +0 -16
  89. data/test/test_structure.rb +0 -159
  90. data/test/test_thread_handling.rb +0 -58
  91. data/test/test_type_find_factory.rb +0 -8
  92. data/test/test_value.rb +0 -69
@@ -1,352 +0,0 @@
1
- /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /*
3
- * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
- * Copyright (C) 2007 Ruby-GNOME2 Project Team
5
- * Copyright (C) 2006 Sjoerd Simons <sjoerd@luon.net>
6
- * Copyright (C) 2003, 2004 Laurent Sansonetti <lrz@gnome.org>
7
- *
8
- * This library is free software; you can redistribute it and/or
9
- * modify it under the terms of the GNU Lesser General Public
10
- * License as published by the Free Software Foundation; either
11
- * version 2.1 of the License, or (at your option) any later version.
12
- *
13
- * This library is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
- * Lesser General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU Lesser General Public
19
- * License along with this library; if not, write to the Free Software
20
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21
- * MA 02110-1301 USA
22
- */
23
-
24
- #include "rbgst-private.h"
25
-
26
- /* Document-class: Gst::Event
27
- * Events.
28
- */
29
-
30
- static VALUE rb_cGstEvent;
31
- static VALUE rb_cGstEventFlushStart;
32
- static VALUE rb_cGstEventFlushStop;
33
- static VALUE rb_cGstEventEOS;
34
- static VALUE rb_cGstEventNewSegment;
35
- static VALUE rb_cGstEventTag;
36
- static VALUE rb_cGstEventBufferSize;
37
- static VALUE rb_cGstEventQOS;
38
- static VALUE rb_cGstEventSeek;
39
- static VALUE rb_cGstEventNavigation;
40
- static VALUE rb_cGstEventLatency;
41
-
42
- static VALUE
43
- get_superclass(G_GNUC_UNUSED gpointer user_data)
44
- {
45
- return rb_cGstMiniObject;
46
- }
47
-
48
- static VALUE
49
- instance2robj(gpointer instance, G_GNUC_UNUSED gpointer user_data)
50
- {
51
- VALUE klass;
52
- GstEvent *event;
53
-
54
- event = instance;
55
-
56
- switch (GST_EVENT_TYPE(event)) {
57
- case GST_EVENT_FLUSH_START:
58
- klass = rb_cGstEventFlushStart;
59
- break;
60
- case GST_EVENT_FLUSH_STOP:
61
- klass = rb_cGstEventFlushStop;
62
- break;
63
- case GST_EVENT_EOS:
64
- klass = rb_cGstEventEOS;
65
- break;
66
- case GST_EVENT_NEWSEGMENT:
67
- klass = rb_cGstEventNewSegment;
68
- break;
69
- case GST_EVENT_TAG:
70
- klass = rb_cGstEventTag;
71
- break;
72
- case GST_EVENT_BUFFERSIZE:
73
- klass = rb_cGstEventBufferSize;
74
- break;
75
- case GST_EVENT_QOS:
76
- klass = rb_cGstEventQOS;
77
- break;
78
- case GST_EVENT_SEEK:
79
- klass = rb_cGstEventSeek;
80
- break;
81
- case GST_EVENT_NAVIGATION:
82
- klass = rb_cGstEventNavigation;
83
- break;
84
- case GST_EVENT_LATENCY:
85
- klass = rb_cGstEventLatency;
86
- break;
87
- default:
88
- klass = rb_cGstEvent;
89
- break;
90
- }
91
-
92
- gst_mini_object_ref(instance);
93
- return Data_Wrap_Struct(klass, NULL, _rbgst_mini_object_free, instance);
94
- }
95
-
96
- static VALUE
97
- flush_start_initialize(VALUE self)
98
- {
99
- GstEvent *event;
100
-
101
- event = gst_event_new_flush_start();
102
-
103
- G_INITIALIZE(self, event);
104
- return Qnil;
105
- }
106
-
107
- static VALUE
108
- flush_stop_initialize(VALUE self)
109
- {
110
- GstEvent *event;
111
-
112
- event = gst_event_new_flush_start();
113
-
114
- G_INITIALIZE(self, event);
115
- return Qnil;
116
- }
117
-
118
- static VALUE
119
- eos_initialize(VALUE self)
120
- {
121
- GstEvent *event;
122
-
123
- event = gst_event_new_eos();
124
-
125
- G_INITIALIZE(self, event);
126
- return Qnil;
127
- }
128
-
129
- static VALUE
130
- newsegment_initialize(VALUE self, VALUE update, VALUE rate, VALUE applied_rate,
131
- VALUE format, VALUE start, VALUE stop, VALUE position)
132
- {
133
- GstEvent *event;
134
-
135
- event = gst_event_new_new_segment_full(RVAL2CBOOL(update),
136
- NUM2DBL(rate),
137
- NUM2DBL(applied_rate),
138
- RVAL2GST_FORMAT(format),
139
- NUM2LL(start),
140
- NUM2LL(stop),
141
- NUM2LL(position));
142
-
143
- G_INITIALIZE(self, event);
144
- return Qnil;
145
- }
146
-
147
- static VALUE
148
- newsegment_parse(VALUE self)
149
- {
150
- gboolean update;
151
- gdouble rate, applied_rate;
152
- GstFormat format;
153
- gint64 start, stop, position;
154
-
155
- gst_event_parse_new_segment_full(RGST_EVENT(self), &update, &rate,
156
- &applied_rate, &format, &start, &stop,
157
- &position);
158
-
159
- return rb_ary_new3(7, CBOOL2RVAL(update), DBL2NUM(update), DBL2NUM(rate),
160
- GST_FORMAT2RVAL(format), LL2NUM(start), LL2NUM(stop),
161
- LL2NUM(position));
162
- }
163
-
164
- static VALUE
165
- tag_initialize(VALUE self, VALUE taglist)
166
- {
167
- GstEvent *event;
168
- event = gst_event_new_tag(RVAL2GST_STRUCT(taglist));
169
-
170
- G_INITIALIZE(self, event);
171
- return Qnil;
172
- }
173
-
174
- static VALUE
175
- tag_parse(VALUE self)
176
- {
177
- GstTagList *taglist;
178
-
179
- gst_event_parse_tag(RGST_EVENT(self), &taglist);
180
-
181
- return GST_STRUCT2RVAL(taglist);
182
- }
183
-
184
- static VALUE
185
- buffersize_initialize(VALUE self, VALUE format, VALUE minsize, VALUE maxsize,
186
- VALUE async)
187
- {
188
- GstEvent *event;
189
-
190
- event = gst_event_new_buffer_size(RVAL2GST_FORMAT(format), NUM2LL(minsize),
191
- NUM2LL(maxsize), RVAL2CBOOL(async));
192
-
193
- G_INITIALIZE(self, event);
194
- return Qnil;
195
- }
196
-
197
- static VALUE
198
- buffersize_parse(VALUE self)
199
- {
200
- GstFormat format;
201
- gint64 minsize;
202
- gint64 maxsize;
203
- gboolean async;
204
-
205
- gst_event_parse_buffer_size(RGST_EVENT(self), &format, &minsize,
206
- &maxsize, &async);
207
-
208
- return rb_ary_new3(4, GST_FORMAT2RVAL(format), LL2NUM(minsize),
209
- LL2NUM(maxsize), CBOOL2RVAL(async));
210
- }
211
-
212
- static VALUE
213
- qos_initialize(VALUE self, VALUE portion, VALUE clockdiff, VALUE timestamp)
214
- {
215
- GstEvent *event;
216
-
217
- event = gst_event_new_qos(NUM2DBL(portion), NUM2LL(clockdiff),
218
- NUM2ULL(timestamp));
219
-
220
- G_INITIALIZE(self, event);
221
- return Qnil;
222
- }
223
-
224
- static VALUE
225
- qos_parse(VALUE self)
226
- {
227
- gdouble proportion;
228
- GstClockTimeDiff diff;
229
- GstClockTime timestamp;
230
-
231
- gst_event_parse_qos(RGST_EVENT(self), &proportion, &diff, &timestamp);
232
-
233
- return rb_ary_new3(3, DBL2NUM(proportion), LL2NUM(diff),
234
- ULL2NUM(timestamp));
235
- }
236
-
237
- static VALUE
238
- seek_initialize(VALUE self, VALUE rate, VALUE format, VALUE flags,
239
- VALUE start_type, VALUE start, VALUE stop_type, VALUE stop)
240
- {
241
- GstEvent *event;
242
-
243
- event = gst_event_new_seek(NUM2DBL(rate),
244
- RVAL2GST_FORMAT(format),
245
- RVAL2GFLAGS(flags, GST_TYPE_SEEK_FLAGS),
246
- RVAL2GENUM(start_type, GST_TYPE_SEEK_TYPE),
247
- NUM2ULL(start),
248
- RVAL2GENUM(stop_type, GST_TYPE_SEEK_TYPE),
249
- NUM2ULL(stop));
250
-
251
- G_INITIALIZE(self, event);
252
- return Qnil;
253
- }
254
-
255
- static VALUE
256
- seek_parse(VALUE self)
257
- {
258
- gdouble rate;
259
- GstFormat format;
260
- GstSeekFlags flags;
261
- GstSeekType start_type, stop_type;
262
- gint64 start, stop;
263
-
264
- gst_event_parse_seek(RGST_EVENT(self), &rate, &format, &flags, &start_type,
265
- &start, &stop_type, &stop);
266
-
267
- return rb_ary_new3(6, DBL2NUM(rate), GST_FORMAT2RVAL(format),
268
- GFLAGS2RVAL(start_type, GST_TYPE_SEEK_FLAGS),
269
- LL2NUM(start),
270
- GFLAGS2RVAL(stop_type, GST_TYPE_SEEK_FLAGS),
271
- LL2NUM(stop));
272
- }
273
-
274
- static VALUE
275
- navigation_initialize(VALUE self, VALUE structure)
276
- {
277
- GstEvent *event;
278
-
279
- event = gst_event_new_navigation(RVAL2GST_STRUCT(structure));
280
-
281
- G_INITIALIZE(self, event);
282
- return Qnil;
283
- }
284
-
285
- static VALUE
286
- latency_initialize(VALUE self, VALUE latency)
287
- {
288
- GstEvent *event;
289
-
290
- event = gst_event_new_latency(NUM2ULL(latency));
291
-
292
- G_INITIALIZE(self, event);
293
- return Qnil;
294
- }
295
-
296
- static VALUE
297
- latency_parse(VALUE self)
298
- {
299
- GstClockTime latency;
300
-
301
- gst_event_parse_latency(RGST_EVENT(self), &latency);
302
-
303
- return LL2NUM(latency);
304
- }
305
-
306
- static VALUE
307
- rbgst_event_get_type(VALUE self)
308
- {
309
- return GENUM2RVAL(GST_EVENT_TYPE(RVAL2GST_EVENT(self)), GST_TYPE_EVENT_TYPE);
310
- }
311
-
312
- void
313
- Init_gst_event (VALUE mGst)
314
- {
315
- RGConvertTable table;
316
-
317
- memset(&table, 0, sizeof(RGConvertTable));
318
- table.type = GST_TYPE_EVENT;
319
- table.get_superclass = get_superclass;
320
- table.instance2robj = instance2robj;
321
- RG_DEF_CONVERSION(&table);
322
-
323
- rb_cGstEvent = G_DEF_CLASS(GST_TYPE_EVENT, "Event", mGst);
324
- rbg_define_method(rb_cGstEvent, "get_type", rbgst_event_get_type, 0);
325
- G_DEF_CLASS(GST_TYPE_EVENT_TYPE, "EventType", mGst);
326
- G_DEF_CONSTANTS(rb_cGstEvent, GST_TYPE_EVENT_TYPE, "GST_EVENT_");
327
-
328
- #define DEFINE_EVENT(type, lctype, arguments) \
329
- rb_cGstEvent ## type = \
330
- rb_define_class_under(mGst, "Event" #type, rb_cGstEvent); \
331
- rbg_define_method(rb_cGstEvent ## type, "initialize", \
332
- lctype ## _initialize, arguments)
333
-
334
- #define DEFINE_EVENT_PARSE(type, lctype, arguments) \
335
- DEFINE_EVENT(type, lctype, arguments); \
336
- rbg_define_method(rb_cGstEvent ## type, "parse", \
337
- lctype ## _parse, 0)
338
-
339
- DEFINE_EVENT(FlushStart, flush_start, 0);
340
- DEFINE_EVENT(FlushStop, flush_stop, 0);
341
- DEFINE_EVENT(EOS, eos, 0);
342
- DEFINE_EVENT_PARSE(NewSegment, newsegment, 7);
343
- DEFINE_EVENT_PARSE(Tag, tag, 1);
344
- DEFINE_EVENT_PARSE(BufferSize, buffersize, 4);
345
- DEFINE_EVENT_PARSE(QOS, qos, 3);
346
- DEFINE_EVENT_PARSE(Seek, seek, 7);
347
- DEFINE_EVENT(Navigation, navigation, 1);
348
- DEFINE_EVENT_PARSE(Latency, latency, 1);
349
-
350
- #undef DEFINE_EVENT_PARSE
351
- #undef DEFINE_EVENT
352
- }
@@ -1,45 +0,0 @@
1
- /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /*
3
- * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
- * Copyright (C) 2006,2008 Sjoerd Simons <sjoerd@luon.net>
5
- * Copyright (C) 2003, 2004 Laurent Sansonetti <lrz@gnome.org>
6
- *
7
- * This library 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
- *
12
- * This library 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 this library; if not, write to the Free Software
19
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20
- * MA 02110-1301 USA
21
- */
22
-
23
- #include "rbgst-private.h"
24
-
25
- #define RG_TARGET_NAMESPACE cGhostPad
26
-
27
- static VALUE
28
- rg_initialize(VALUE self, VALUE name, VALUE pad)
29
- {
30
- GstPad *gpad;
31
-
32
- gpad = gst_ghost_pad_new(RVAL2CSTR(name), RVAL2GST_PAD(pad));
33
-
34
- G_INITIALIZE(self, gpad);
35
-
36
- return Qnil;
37
- }
38
-
39
- void
40
- Init_gst_ghost_pad(VALUE mGst)
41
- {
42
- VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GST_TYPE_GHOST_PAD, "GhostPad", mGst);
43
-
44
- RG_DEF_METHOD(initialize, 2);
45
- }
@@ -1,69 +0,0 @@
1
- /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /*
3
- * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
- * Copyright (C) 2007 Ruby-GNOME2 Project Team
5
- * Copyright (C) 2003, 2004 Laurent Sansonetti <lrz@gnome.org>
6
- *
7
- * This library 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
- *
12
- * This library 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 this library; if not, write to the Free Software
19
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20
- * MA 02110-1301 USA
21
- */
22
-
23
- #include "rbgst-private.h"
24
-
25
- #define RG_TARGET_NAMESPACE cIndexFactory
26
- #define SELF(self) RVAL2GST_INDEX_FACTORY(self)
27
-
28
- /* Class: Gst::IndexFactory
29
- * Create indexes from a factory.
30
- */
31
-
32
- static VALUE
33
- rg_s_find(G_GNUC_UNUSED VALUE self, VALUE name)
34
- {
35
- return GOBJ2RVAL(gst_index_factory_find(RVAL2CSTR(name)));
36
- }
37
-
38
- /* Method: to_s
39
- * Returns: a String representing the factory.
40
- */
41
- static VALUE
42
- rg_to_s (VALUE self)
43
- {
44
- GstIndexFactory *factory = RGST_INDEX_FACTORY (self);
45
- return rb_str_new_with_format ("Index: %s (%s)",
46
- GST_PLUGIN_FEATURE_NAME (factory),
47
- factory->longdesc);
48
- }
49
-
50
- static VALUE
51
- rg_description(VALUE self)
52
- {
53
- return CSTR2RVAL(SELF(self)->longdesc);
54
- }
55
-
56
- void
57
- Init_gst_indexfactory (VALUE mGst)
58
- {
59
- VALUE RG_TARGET_NAMESPACE;
60
-
61
- RG_TARGET_NAMESPACE = G_DEF_CLASS(GST_TYPE_INDEX_FACTORY,
62
- "IndexFactory", mGst);
63
-
64
- RG_DEF_SMETHOD(find, 1);
65
-
66
- RG_DEF_METHOD(to_s, 0);
67
-
68
- RG_DEF_METHOD(description, 0);
69
- }
@@ -1,87 +0,0 @@
1
- /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /*
3
- * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
- *
5
- * This library is free software; you can redistribute it and/or
6
- * modify it under the terms of the GNU Lesser General Public
7
- * License as published by the Free Software Foundation; either
8
- * version 2.1 of the License, or (at your option) any later version.
9
- *
10
- * This library is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
- * Lesser General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU Lesser General Public
16
- * License along with this library; if not, write to the Free Software
17
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
- * MA 02110-1301 USA
19
- */
20
-
21
- #ifdef HAVE_GST_PBUTILS
22
- #include "rbgst-private.h"
23
- #include <gst/pbutils/pbutils-enumtypes.h>
24
- #include <gst/pbutils/install-plugins.h>
25
-
26
- #define RG_TARGET_NAMESPACE cInstallPluginsContext
27
-
28
- static VALUE RG_TARGET_NAMESPACE;
29
-
30
- static VALUE
31
- context2robj(gpointer context, G_GNUC_UNUSED gpointer user_data)
32
- {
33
- return Data_Wrap_Struct(RG_TARGET_NAMESPACE, NULL,
34
- gst_install_plugins_context_free,
35
- (GstInstallPluginsContext *)context);
36
- }
37
-
38
- static gpointer
39
- robj2context(VALUE object, G_GNUC_UNUSED gpointer user_data)
40
- {
41
- gpointer instance;
42
-
43
- if (!RVAL2CBOOL(rb_obj_is_kind_of(object, RG_TARGET_NAMESPACE))) {
44
- rb_raise(rb_eTypeError, "not a Gst::InstallPluginsContext");
45
- }
46
- Data_Get_Struct(object, GstInstallPluginsContext, instance);
47
- return instance;
48
- }
49
-
50
- static VALUE
51
- rg_initialize(VALUE self)
52
- {
53
- GstInstallPluginsContext *context;
54
-
55
- context = gst_install_plugins_context_new();
56
- G_INITIALIZE(self, context);
57
- return Qnil;
58
- }
59
-
60
- static VALUE
61
- rg_set_xid(VALUE self, VALUE xid)
62
- {
63
- GstInstallPluginsContext *context;
64
-
65
- context = (GstInstallPluginsContext *)RVAL2GOBJ(self);
66
- gst_install_plugins_context_set_xid(context, NUM2INT(xid));/*FIXME: segfault on ruby exit*/
67
- return self;
68
- }
69
-
70
- void
71
- Init_gst_install_plugins_context(VALUE mGst)
72
- {
73
- RGConvertTable context_table;
74
-
75
- memset(&context_table, 0, sizeof(RGConvertTable));
76
- context_table.type = GST_TYPE_INSTALL_PLUGINS_CONTEXT;
77
- context_table.instance2robj = context2robj;
78
- context_table.robj2instance = robj2context;
79
- RG_DEF_CONVERSION(&context_table);
80
-
81
- RG_TARGET_NAMESPACE = G_DEF_CLASS(GST_TYPE_INSTALL_PLUGINS_CONTEXT,
82
- "InstallPluginsContext", mGst);
83
-
84
- RG_DEF_METHOD(initialize, 0);
85
- RG_DEF_METHOD(set_xid, 1);
86
- }
87
- #endif /* HAVE_GST_PBUTILS */
@@ -1,45 +0,0 @@
1
- /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /*
3
- * Copyright (C) 2011-2012 Ruby-GNOME2 Project Team
4
- *
5
- * This library is free software; you can redistribute it and/or
6
- * modify it under the terms of the GNU Lesser General Public
7
- * License as published by the Free Software Foundation; either
8
- * version 2.1 of the License, or (at your option) any later version.
9
- *
10
- * This library is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
- * Lesser General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU Lesser General Public
16
- * License along with this library; if not, write to the Free Software
17
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
- * MA 02110-1301 USA
19
- */
20
-
21
- #ifdef HAVE_GST_PBUTILS
22
- #include "rbgst-private.h"
23
- #include <gst/pbutils/pbutils-enumtypes.h>
24
- #include <gst/pbutils/install-plugins.h>
25
-
26
- #define RG_TARGET_NAMESPACE cInstallPluginsReturn
27
-
28
- static VALUE RG_TARGET_NAMESPACE;
29
-
30
- static VALUE
31
- rg_name(VALUE self)
32
- {
33
- return CSTR2RVAL(gst_install_plugins_return_get_name(
34
- (GstInstallPluginsReturn)
35
- RVAL2GENUM(self, GST_TYPE_INSTALL_PLUGINS_RETURN)));
36
- }
37
-
38
- void
39
- Init_gst_install_plugins_return(VALUE mGst)
40
- {
41
- RG_TARGET_NAMESPACE = G_DEF_CLASS(GST_TYPE_INSTALL_PLUGINS_RETURN,
42
- "InstallPluginsReturn", mGst);
43
- RG_DEF_METHOD(name, 0);
44
- }
45
- #endif /* HAVE_GST_PBUTILS */