gstreamer 1.2.6 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
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,300 +0,0 @@
1
- /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /*
3
- * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
- * Copyright (C) 2008 Ruby-GNOME2 Project Team
5
- *
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.
10
- *
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.
15
- *
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
- */
21
-
22
- #include "rbgst-private.h"
23
-
24
- #define RG_TARGET_NAMESPACE cStructure
25
- #define SELF(obj) (RVAL2GST_STRUCT(obj))
26
-
27
- static VALUE
28
- rg_s_parse(G_GNUC_UNUSED VALUE self, VALUE string)
29
- {
30
- GstStructure *structure;
31
- gchar *end;
32
-
33
- structure = gst_structure_from_string(RVAL2CSTR(string), &end);
34
-
35
- return rb_ary_new3(2, GST_STRUCT2RVAL(structure), CSTR2RVAL(end));
36
- }
37
-
38
- static VALUE
39
- rg_initialize(int argc, VALUE *argv, VALUE self)
40
- {
41
- VALUE name, fields;
42
- GstStructure *structure;
43
-
44
- rb_scan_args(argc, argv, "11", &name, &fields);
45
-
46
- structure = gst_structure_empty_new(RVAL2CSTR(name));
47
- if (!NIL_P(fields)) {
48
- /* set fields */
49
- }
50
-
51
- G_INITIALIZE(self, structure);
52
-
53
- return Qnil;
54
- }
55
-
56
- static VALUE
57
- rg_name(VALUE self)
58
- {
59
- return CSTR2RVAL(gst_structure_get_name(SELF(self)));
60
- }
61
-
62
- static VALUE
63
- rg_set_name(VALUE self, VALUE name)
64
- {
65
- gst_structure_set_name(SELF(self), RVAL2CSTR(name));
66
- return Qnil;
67
- }
68
-
69
- static VALUE
70
- rg_has_name_p(VALUE self, VALUE name)
71
- {
72
- return CBOOL2RVAL(gst_structure_has_name(SELF(self), RVAL2CSTR(name)));
73
- }
74
-
75
- static VALUE
76
- rg_operator_get_value(VALUE self, VALUE name)
77
- {
78
- return GVAL2RVAL(gst_structure_get_value(SELF(self), RVAL2CSTR(name)));
79
- }
80
-
81
- static VALUE
82
- rg_operator_set_value(VALUE self, VALUE name, VALUE rb_value)
83
- {
84
- GValue value = G_VALUE_INIT;
85
-
86
- rbgobj_initialize_gvalue(&value, rb_value);
87
- gst_structure_set_value(SELF(self), RVAL2CSTR(name), &value);
88
- g_value_unset(&value);
89
-
90
- return Qnil;
91
- }
92
-
93
- static VALUE
94
- rg_remove(int argc, VALUE *argv, VALUE self)
95
- {
96
- int i;
97
- VALUE name, rest;
98
- GstStructure *structure;
99
-
100
- rb_scan_args(argc, argv, "1*", &name, &rest);
101
-
102
- structure = SELF(self);
103
- for (i = 0; i < argc; i++) {
104
- name = argv[i];
105
-
106
- gst_structure_remove_field(structure, RVAL2CSTR(name));
107
- }
108
-
109
- return Qnil;
110
- }
111
-
112
- static VALUE
113
- rg_remove_all(VALUE self)
114
- {
115
- gst_structure_remove_all_fields(SELF(self));
116
- return Qnil;
117
- }
118
-
119
- typedef struct _EachCallbackInfo
120
- {
121
- int state;
122
- VALUE proc;
123
- } EachCallbackInfo;
124
-
125
- typedef struct _EachCallbackData
126
- {
127
- VALUE proc;
128
- VALUE key;
129
- VALUE value;
130
- } EachCallbackData;
131
-
132
- typedef struct _RValueToGValueData
133
- {
134
- VALUE rvalue;
135
- GValue *gvalue;
136
- } RValueToGValueData;
137
-
138
- static VALUE
139
- invoke_proc_func(VALUE user_data)
140
- {
141
- EachCallbackData *data = (EachCallbackData *)user_data;
142
-
143
- return rb_funcall(data->proc,
144
- rb_intern("call"),
145
- 2,
146
- data->key,
147
- data->value);
148
- }
149
-
150
- static VALUE
151
- invoke_proc(GQuark field_id, const GValue *value,
152
- EachCallbackInfo *info)
153
- {
154
- EachCallbackData data;
155
-
156
- data.proc = info->proc;
157
- data.key = rb_str_new2(g_quark_to_string(field_id));
158
- data.value = GVAL2RVAL(value);
159
- return rb_protect(invoke_proc_func, (VALUE)(&data), &(info->state));
160
- }
161
-
162
- static gboolean
163
- foreach_cb(GQuark field_id, const GValue *value, gpointer user_data)
164
- {
165
- EachCallbackInfo *info = user_data;
166
-
167
- invoke_proc(field_id, value, info);
168
-
169
- return info->state == 0;
170
- }
171
-
172
- static VALUE
173
- rg_each(VALUE self)
174
- {
175
- EachCallbackInfo info;
176
-
177
- info.state = 0;
178
- info.proc = rb_block_proc();
179
-
180
- if (!gst_structure_foreach(SELF(self), foreach_cb, &info))
181
- rb_jump_tag(info.state);
182
-
183
- return Qnil;
184
- }
185
-
186
- static VALUE
187
- invoke_rvalue_to_gvalue(VALUE user_data)
188
- {
189
- RValueToGValueData *data = (RValueToGValueData *)user_data;
190
-
191
- g_value_unset(data->gvalue);
192
- rbgobj_initialize_gvalue(data->gvalue, data->rvalue);
193
-
194
- return Qnil;
195
- }
196
-
197
- static gboolean
198
- map_in_place_cb(GQuark field_id, GValue *value, gpointer user_data)
199
- {
200
- EachCallbackInfo *info = user_data;
201
- VALUE result;
202
-
203
- result = invoke_proc(field_id, value, info);
204
- if (info->state == 0) {
205
- RValueToGValueData convert_data;
206
- convert_data.rvalue = result;
207
- convert_data.gvalue = value;
208
- rb_protect(invoke_rvalue_to_gvalue,
209
- (VALUE)(&convert_data), &(info->state));
210
- }
211
-
212
- return info->state == 0;
213
- }
214
-
215
- static VALUE
216
- rg_map_bang(VALUE self)
217
- {
218
- EachCallbackInfo info;
219
-
220
- info.state = 0;
221
- info.proc = rb_block_proc();
222
-
223
- if (!gst_structure_map_in_place(SELF(self), map_in_place_cb, &info))
224
- rb_jump_tag(info.state);
225
-
226
- return Qnil;
227
- }
228
-
229
- static VALUE
230
- rg_size(VALUE self)
231
- {
232
- return INT2NUM(gst_structure_n_fields(SELF(self)));
233
- }
234
-
235
- static VALUE
236
- rg_empty_p(VALUE self)
237
- {
238
- return CBOOL2RVAL(gst_structure_n_fields(SELF(self)) == 0);
239
- }
240
-
241
- static VALUE
242
- rg_nth_field_name(VALUE self, VALUE index)
243
- {
244
- return CSTR2RVAL(gst_structure_nth_field_name(SELF(self), NUM2INT(index)));
245
- }
246
-
247
- static VALUE
248
- rg_has_field_p(VALUE self, VALUE name)
249
- {
250
- return CBOOL2RVAL(gst_structure_has_field(SELF(self), RVAL2CSTR(name)));
251
- }
252
-
253
- static VALUE
254
- rg_to_s(VALUE self)
255
- {
256
- return CSTR2RVAL_FREE(gst_structure_to_string(SELF(self)));
257
- }
258
-
259
- void
260
- Init_gst_structure(VALUE mGst)
261
- {
262
- VALUE RG_TARGET_NAMESPACE;
263
-
264
- RG_TARGET_NAMESPACE = G_DEF_CLASS(GST_TYPE_STRUCTURE, "Structure", mGst);
265
-
266
- rb_include_module(RG_TARGET_NAMESPACE, rb_mEnumerable);
267
-
268
- RG_DEF_SMETHOD(parse, 1);
269
-
270
- RG_DEF_METHOD(initialize, -1);
271
-
272
- RG_DEF_METHOD(name, 0);
273
- RG_DEF_METHOD(set_name, 1);
274
- RG_DEF_METHOD_P(has_name, 1);
275
- RG_DEF_ALIAS("have_name?", "has_name?");
276
-
277
- RG_DEF_METHOD_OPERATOR("[]", get_value, 1);
278
- RG_DEF_METHOD_OPERATOR("[]=", set_value, 2);
279
-
280
- RG_DEF_METHOD(remove, -1);
281
- RG_DEF_ALIAS("delete", "remove");
282
- RG_DEF_METHOD(remove_all, 0);
283
- RG_DEF_ALIAS("clear", "remove_all");
284
-
285
- RG_DEF_METHOD(each, 0);
286
-
287
- RG_DEF_METHOD_BANG(map, 0);
288
- RG_DEF_ALIAS("collect!", "map!");
289
-
290
- RG_DEF_METHOD(size, 0);
291
- RG_DEF_ALIAS("length", "size");
292
- RG_DEF_METHOD_P(empty, 0);
293
-
294
- RG_DEF_METHOD(nth_field_name, 1);
295
-
296
- RG_DEF_METHOD_P(has_field, 1);
297
- RG_DEF_ALIAS("have_field?", "has_field?");
298
-
299
- RG_DEF_METHOD(to_s, 0);
300
- }
@@ -1,48 +0,0 @@
1
- /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /*
3
- * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
- * Copyright (C) 2003, 2004 Laurent Sansonetti <lrz@gnome.org>
5
- *
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.
10
- *
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.
15
- *
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
- */
21
-
22
- #include "rbgst-private.h"
23
-
24
- #define RG_TARGET_NAMESPACE cSystemClock
25
-
26
- /* Class: Gst::SystemClock
27
- * The Gst::SystemClock class is an implementation of Gst::Clock
28
- * using the system time.
29
- */
30
-
31
- /*
32
- * Class method: obtain
33
- *
34
- * Returns: a handle to the default system clock, as a reference
35
- * to a Gst::SystemClock object.
36
- */
37
- static VALUE
38
- rg_s_obtain (G_GNUC_UNUSED VALUE self)
39
- {
40
- return RGST_SYSTEM_CLOCK_NEW (gst_system_clock_obtain ());
41
- }
42
-
43
- void
44
- Init_gst_systemclock (VALUE mGst)
45
- {
46
- VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS (GST_TYPE_SYSTEM_CLOCK, "SystemClock", mGst);
47
- RG_DEF_SMETHOD(obtain, 0);
48
- }
@@ -1,125 +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 cTypeFindFactory
26
- #define SELF(self) RVAL2GST_TYPE_FIND_FACTORY(self)
27
-
28
- /* Class: Gst::TypeFindFactory
29
- * Information about registered type find functions.
30
- */
31
-
32
- /*
33
- * Class method: list
34
- *
35
- * Gets the list of all registered type find factories.
36
- *
37
- * Returns: an Array of Gst::TypeFindFactory objects.
38
- */
39
- static VALUE
40
- rg_s_list (void)
41
- {
42
- GList *list;
43
- GList *orig;
44
- VALUE arr;
45
-
46
- arr = rb_ary_new ();
47
- orig = gst_type_find_factory_get_list();
48
- for (list = orig; list != NULL; list = g_list_next (list)) {
49
- GstTypeFindFactory *tff = GST_TYPE_FIND_FACTORY (list->data);
50
- rb_ary_push (arr, RGST_TYPE_FIND_FACTORY_NEW (tff));
51
- }
52
- if (orig != NULL) {
53
- g_list_free (orig);
54
- }
55
- return arr;
56
- }
57
-
58
- /*
59
- * Method: extensions
60
- *
61
- * Gets the extensions associated with a type find factory.
62
- *
63
- * Returns: an Array of String objects, or nil if no extensions are
64
- * associated with the type find factory.
65
- */
66
- static VALUE
67
- rg_extensions(VALUE self)
68
- {
69
- VALUE ary;
70
- gchar **extensions;
71
-
72
- ary = rb_ary_new ();
73
- extensions = gst_type_find_factory_get_extensions(SELF(self));
74
-
75
- if (!extensions)
76
- return ary;
77
-
78
- while (*extensions) {
79
- rb_ary_push(ary, CSTR2RVAL(*extensions));
80
- extensions++;
81
- }
82
-
83
- return ary;
84
- }
85
-
86
- /*
87
- * Method: caps
88
- *
89
- * Gets the caps associated with a type find factory.
90
- *
91
- * Returns: the Gst::Caps object associated with this factory.
92
- */
93
- static VALUE
94
- rg_caps (VALUE self)
95
- {
96
- return RGST_CAPS_NEW (gst_type_find_factory_get_caps (RGST_TYPE_FIND_FACTORY (self)));
97
- }
98
-
99
- #if 0 /* requires Gst::TypeFind */
100
- static VALUE
101
- rb_gst_type_find_factory_call_function (VALUE self, VALUE find)
102
- {
103
- gst_type_find_factory_call_function(RGST_TYPE_FIND_FACTORY (self), );
104
- return Qnil;
105
- }
106
- #endif
107
-
108
- static VALUE
109
- rg_to_s (VALUE self)
110
- {
111
- GstTypeFindFactory *factory = RGST_TYPE_FIND_FACTORY (self);
112
- return rb_str_new_with_format ("TypeFind: %s", GST_PLUGIN_FEATURE_NAME (factory));
113
- }
114
-
115
- void
116
- Init_gst_typefindfactory (VALUE mGst)
117
- {
118
- VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS (GST_TYPE_TYPE_FIND_FACTORY, "TypeFindFactory", mGst);
119
-
120
- RG_DEF_SMETHOD(list, 0);
121
- RG_DEF_METHOD(extensions, 0);
122
- RG_DEF_METHOD(caps, 0);
123
- /*rb_define_method(RG_TARGET_NAMESPACE, "call_function", rb_gst_type_find_factory_call_function, 1);*/
124
- RG_DEF_METHOD(to_s, 0);
125
- }