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,315 +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 cIndex
25
-
26
- /* Class: Gst::Index
27
- * Generates indexes on objects.
28
- */
29
-
30
- /* Class method: new
31
- * Returns: a newly allocated Gst::Index object.
32
- */
33
- static VALUE
34
- rg_initialize (VALUE self)
35
- {
36
- GstIndex *index = gst_index_new ();
37
-
38
- if (index != NULL)
39
- RBGST_INITIALIZE (self, index);
40
- return Qnil;
41
- }
42
-
43
- /* Method: readable?
44
- * Returns: whether the index can be read.
45
- */
46
- static VALUE
47
- rg_readable_p (VALUE self)
48
- {
49
- return CBOOL2RVAL (GST_INDEX_IS_READABLE (RGST_INDEX (self)));
50
- }
51
-
52
- /* Method: writable?
53
- * Returns: whether the index can be written.
54
- */
55
- static VALUE
56
- rg_writable_p (VALUE self)
57
- {
58
- return CBOOL2RVAL (GST_INDEX_IS_WRITABLE (RGST_INDEX (self)));
59
- }
60
-
61
- /*
62
- * Method: commit(id)
63
- * id: the writer that committed the index.
64
- *
65
- * Tells the index that the writer with the given ID is done with
66
- * this index and is not going to write any more entries to it.
67
- *
68
- * Returns: self.
69
- */
70
- static VALUE
71
- rg_commit (VALUE self, VALUE id)
72
- {
73
- gst_index_commit (RGST_INDEX (self), FIX2INT (id));
74
- return self;
75
- }
76
-
77
- /* Method: group
78
- * Returns: the ID of the current group.
79
- */
80
- static VALUE
81
- rg_group (VALUE self)
82
- {
83
- return INT2FIX (gst_index_get_group (RGST_INDEX (self)));
84
- }
85
-
86
- /*
87
- * Method: new_group
88
- *
89
- * Creates a new group for the given index. It will be set as the current
90
- * group.
91
- *
92
- * Returns: the ID of the newly created group.
93
- */
94
- static VALUE
95
- rg_new_group (VALUE self)
96
- {
97
- return INT2FIX (gst_index_new_group (RGST_INDEX (self)));
98
- }
99
-
100
- /*
101
- * Method: set_group(group)
102
- * group: the number of the group to set.
103
- *
104
- * Sets the current group number to the given argument.
105
- *
106
- * Returns: true if the operation succeeded, false if the group did not exist.
107
- */
108
- static VALUE
109
- rg_set_group (VALUE self, VALUE group)
110
- {
111
- return
112
- CBOOL2RVAL (gst_index_set_group (RGST_INDEX (self), FIX2INT (group)));
113
- }
114
-
115
- /* Method: certainty
116
- * Returns: the certainty of the index (see Gst::Index::Certainty).
117
- */
118
- static VALUE
119
- rg_certainty (VALUE self)
120
- {
121
- return GENUM2RVAL (gst_index_get_certainty (RGST_INDEX (self)),
122
- GST_TYPE_INDEX_CERTAINTY);
123
- }
124
-
125
- /*
126
- * Method: set_certainty(certainty)
127
- * certainty: the certainty to set (see Gst::Index::Certainty).
128
- *
129
- * Sets the certainty of the index.
130
- *
131
- * Returns: self.
132
- */
133
- static VALUE
134
- rg_set_certainty (VALUE self, VALUE certainty)
135
- {
136
- gst_index_set_certainty (RGST_INDEX (self),
137
- RVAL2GENUM (certainty, GST_TYPE_INDEX_CERTAINTY));
138
- return self;
139
- }
140
-
141
- #if 0
142
- static gboolean
143
- __filter (GstIndex * index, GstIndexEntry * entry)
144
- {
145
-
146
- }
147
-
148
- static VALUE
149
- rg_set_filter (VALUE self)
150
- {
151
- /*
152
- * TODO
153
- */
154
- return self;
155
- }
156
-
157
- static gboolean
158
- __resolver (GstIndex * index, GstObject * writer, gchar ** writer_string,
159
- gpointer user_data)
160
- {
161
- VALUE block = (VALUE) user_data;
162
-
163
- return
164
- RVAL2CBOOL (rb_funcall
165
- (block, 2, RGST_INDEX_NEW (index),
166
- RGST_OBJECT_NEW (writer)));
167
- }
168
-
169
- static VALUE
170
- rg_set_resolver (VALUE self)
171
- {
172
- gst_index_set_resolver (RGST_INDEX (self), __resolver,
173
- (gpointer) rb_block_proc ());
174
- return self;
175
- }
176
- #endif
177
-
178
- /*
179
- * Method: add(id, *args)
180
- * id: the ID of the index writer.
181
- * args: additional parameters, see below.
182
- *
183
- * Adds an entry into the index. The type of the entry depends of
184
- * the number and kind of additional parameters.
185
- *
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.
190
- *
191
- * Returns: a reference to the newly allocated entry in the index, as a Gst::EntryIndex object.
192
- */
193
- static VALUE
194
- rg_add (int argc, VALUE * argv, VALUE self)
195
- {
196
- GstIndexEntry *index_entry;
197
- VALUE id;
198
-
199
- if (argc == 2) {
200
- VALUE var;
201
-
202
- rb_scan_args (argc, argv, "2", &id, &var);
203
-
204
- index_entry = CLASS2GTYPE (CLASS_OF (var)) == GST_TYPE_FORMAT2
205
- ? gst_index_add_format (RGST_INDEX (self), FIX2INT (id),
206
- *RGST_FORMAT (var))
207
- : gst_index_add_id (RGST_INDEX (self), FIX2INT (id),
208
- RVAL2CSTR (var));
209
-
210
- } else {
211
- VALUE flags, format, value;
212
-
213
- rb_scan_args (argc, argv, "4", &id, &flags, &format, &value);
214
-
215
- index_entry =
216
- gst_index_add_association (RGST_INDEX (self), FIX2INT (id),
217
- RVAL2GFLAGS (flags,
218
- GST_TYPE_ASSOC_FLAGS),
219
- *RGST_FORMAT (format), NUM2ULL (value));
220
- }
221
-
222
- return index_entry != NULL ? RGST_INDEX_ENTRY_NEW (index_entry)
223
- : Qnil;
224
- }
225
-
226
- static gint
227
- __compare (gconstpointer a, gconstpointer b, gpointer user_data)
228
- {
229
- VALUE block = (VALUE) user_data;
230
-
231
- return
232
- FIX2INT (rb_funcall
233
- (block, rb_intern ("call"), 2, RGST_INDEX_ENTRY_NEW (a),
234
- RGST_INDEX_ENTRY_NEW (b)));
235
- }
236
-
237
- /*
238
- * Method: get_assoc_entry(id, method, flags, format, value) { ... }
239
- * id: the ID of the index writer.
240
- * method: the lookup method to use (see Gst::Index::LookupMethod).
241
- * flags: flags for the entry (see Gst::Index::AssocFlags).
242
- * format: a Gst::Format object.
243
- * value: the value to find.
244
- *
245
- * Finds the given format/value in the index. If a block is given, it will be
246
- * called as a compare function, passing references to 2 Gst::IndexEntry objects,
247
- * and waiting for a boolean as the return value.
248
- *
249
- * Returns: the entry associated with the value (as a Gst::IndexEntry object), or nil
250
- * if the value is not found.
251
- */
252
- static VALUE
253
- rg_get_assoc_entry (VALUE self, VALUE id, VALUE method, VALUE flags,
254
- VALUE format, VALUE value)
255
- {
256
- GstIndexEntry *index_entry;
257
-
258
- if (rb_block_given_p () == Qfalse)
259
- index_entry =
260
- gst_index_get_assoc_entry (RGST_INDEX (self), FIX2INT (id),
261
- RVAL2GENUM (method,
262
- GST_TYPE_INDEX_LOOKUP_METHOD),
263
- RVAL2GFLAGS (flags,
264
- GST_TYPE_ASSOC_FLAGS),
265
- *RGST_FORMAT (format), NUM2ULL (value));
266
- else
267
- index_entry =
268
- gst_index_get_assoc_entry_full (RGST_INDEX (self), FIX2INT (id),
269
- RVAL2GENUM (method,
270
- GST_TYPE_INDEX_LOOKUP_METHOD),
271
- RVAL2GFLAGS (flags,
272
- GST_TYPE_ASSOC_FLAGS),
273
- *RGST_FORMAT (format),
274
- NUM2ULL (value), __compare,
275
- (gpointer) rb_block_proc ());
276
-
277
- return index_entry != NULL ? RGST_INDEX_ENTRY_NEW (index_entry)
278
- : Qnil;
279
- }
280
-
281
- void
282
- Init_gst_index (VALUE mGst)
283
- {
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);
295
- #if 0
296
- RG_DEF_METHOD(set_filter, 0);
297
- RG_DEF_METHOD(set_resolver, 0);
298
- #endif
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
- rb_undef_method (RG_TARGET_NAMESPACE, "resolver");
314
- rb_undef_method (RG_TARGET_NAMESPACE, "resolver=");
315
- }
@@ -1,99 +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 cIndexEntry
25
-
26
- /* Class: Gst::IndexEntry
27
- * An index's entry.
28
- */
29
-
30
- /*
31
- * Method: data
32
- *
33
- * Gets the internal data stored in the entry. The data depends of the type
34
- * of the entry:
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.
39
- *
40
- * Returns: the internal data of the entry.
41
- */
42
- static VALUE
43
- rg_data (VALUE self)
44
- {
45
- GstIndexEntry *entry;
46
- VALUE data;
47
-
48
- entry = RGST_INDEX_ENTRY (self);
49
- switch (entry->type) {
50
- case GST_INDEX_ENTRY_ID:
51
- data = CSTR2RVAL (entry->data.id.description);
52
- break;
53
-
54
- case GST_INDEX_ENTRY_ASSOCIATION:
55
- data = rb_ary_new ();
56
- rb_ary_push (data, INT2FIX (entry->data.assoc.nassocs));
57
- rb_ary_push (data, RGST_FORMAT_NEW (entry->data.assoc.assocs->format));
58
- rb_ary_push (data, ULL2NUM (entry->data.assoc.assocs->value));
59
- rb_ary_push (data,
60
- GFLAGS2RVAL (entry->data.assoc.flags,
61
- GST_TYPE_ASSOC_FLAGS));
62
- break;
63
-
64
- case GST_INDEX_ENTRY_FORMAT:
65
- data = rb_ary_new ();
66
- rb_ary_push (data, RGST_FORMAT_NEW (entry->data.format.format));
67
- rb_ary_push (data, CSTR2RVAL (entry->data.format.key));
68
- break;
69
-
70
- case GST_INDEX_ENTRY_OBJECT: /* TODO */
71
- default:
72
- data = Qnil;
73
- }
74
- return data;
75
- }
76
-
77
- /* Method: entry_type
78
- * Returns: the type of the entry (see Gst::IndexEntry::Types).
79
- */
80
- static VALUE
81
- rg_entry_type (VALUE self)
82
- {
83
- GstIndexEntry *entry = RGST_INDEX_ENTRY (self);
84
-
85
- return GENUM2RVAL (entry->type, GST_TYPE_INDEX_ENTRY_TYPE);
86
- }
87
-
88
- void
89
- Init_gst_indexentry (VALUE mGst)
90
- {
91
- VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS (GST_TYPE_INDEX_ENTRY, "IndexEntry", mGst);
92
-
93
- rb_undef_method (RG_TARGET_NAMESPACE, "initialize");
94
- RG_DEF_METHOD(data, 0);
95
- RG_DEF_METHOD(entry_type, 0);
96
-
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_");
99
- }
@@ -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) 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 mParse
25
-
26
- /* Module: Gst::Parse
27
- * Parses command-line syntax into a pipeline.
28
- */
29
-
30
- /*
31
- * Class method: launch(command)
32
- * command: a command line.
33
- *
34
- * Creates a new pipeline based on command line syntax.
35
- * On failure, an exception is thrown with a specific
36
- * error message.
37
- *
38
- * Returns: a reference to a new Gst::Bin on success,
39
- * an exception on failure.
40
- */
41
- static VALUE
42
- rg_s_launch (G_GNUC_UNUSED VALUE self, VALUE command)
43
- {
44
- #if !defined(GST_DISABLE_PARSE)
45
- GError *error;
46
- GstBin *bin;
47
-
48
- error = NULL;
49
- bin = (GstBin*)gst_parse_launch (RVAL2CSTR (command), &error);
50
- if (bin != NULL)
51
- return RGST_BIN_NEW (bin);
52
- RAISE_GERROR(error);
53
- #else
54
- rb_raise (rb_eRuntimeError,
55
- "This function has been disabled "
56
- "when GStreamer was compiled");
57
- #endif
58
- return Qnil;
59
- }
60
-
61
- void
62
- Init_gst_parse (VALUE mGst)
63
- {
64
- VALUE RG_TARGET_NAMESPACE = rb_define_module_under (mGst, "Parse");
65
- RG_DEF_SMETHOD(launch, 1);
66
-
67
- G_DEF_ERROR(GST_PARSE_ERROR, "ParseError", mGst, rb_eRuntimeError,
68
- GST_TYPE_PARSE_ERROR);
69
- }
@@ -1,162 +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 cQueryType
25
-
26
- /* Class: Gst::QueryType
27
- * Dynamically register new query types.
28
- */
29
-
30
- static GstQueryType *
31
- query_type_copy (const GstQueryType* query_type)
32
- {
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;
38
- }
39
-
40
- GType
41
- gst_query_type_get_type2 (void)
42
- {
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;
49
- }
50
-
51
- /*
52
- * Class method: find(nick)
53
- * nick: the nick of an existing query type.
54
- *
55
- * Returns: a reference to the Gst::QueryType object registered with the
56
- * given nick, or nil if this query was not registered.
57
- */
58
- static VALUE
59
- rg_s_find (G_GNUC_UNUSED VALUE self, VALUE nick)
60
- {
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;
65
- }
66
-
67
- /*
68
- * Class method: each { |query_type| block }
69
- *
70
- * Calls the block for each registered query type, passing a reference
71
- * to the Gst::QueryType object as parameter.
72
- *
73
- * Returns: always nil.
74
- */
75
- static VALUE
76
- rg_s_each (G_GNUC_UNUSED VALUE self)
77
- {
78
- GstIterator *iter;
79
- gpointer value;
80
-
81
- iter = gst_query_type_iterate_definitions();
82
- while (gst_iterator_next(iter, &value) == GST_ITERATOR_OK) {
83
- GstQueryTypeDefinition *definition = value;
84
- rb_yield(RGST_QUERY_TYPE_NEW(&(definition->value)));
85
- }
86
- gst_iterator_free(iter);
87
- return Qnil;
88
- }
89
-
90
- /* Method: type_id
91
- * Returns: the type id of this query type (see Gst::QueryType::Type).
92
- */
93
- static VALUE
94
- rg_type_id (VALUE self)
95
- {
96
- GstQueryType *querytype = RGST_QUERY_TYPE (self);
97
- return INT2FIX (*querytype);
98
- }
99
-
100
- /* Method: nick
101
- * Returns: the short nick of the query type.
102
- */
103
- static VALUE
104
- rg_nick (VALUE self)
105
- {
106
- GstQueryType *querytype = RGST_QUERY_TYPE (self);
107
- return CSTR2RVAL (gst_query_type_get_details (*querytype)->nick);
108
- }
109
-
110
- /* Method: description
111
- * Returns: a longer description of the query type.
112
- */
113
- static VALUE
114
- rg_description (VALUE self)
115
- {
116
- GstQueryType *querytype = RGST_QUERY_TYPE (self);
117
- return CSTR2RVAL (gst_query_type_get_details (*querytype)->description);
118
- }
119
-
120
- /*
121
- * Method: ==(query_type)
122
- * query_type: a Gst::QueryType object.
123
- *
124
- * Checks if two Gst::QueryType objects are registered under the
125
- * same nick.
126
- *
127
- * Returns: true on success, false on failure.
128
- */
129
- static VALUE
130
- rg_operator_is_equal (VALUE self, VALUE other_query)
131
- {
132
- GstQueryType *q1, *q2;
133
- const gchar *n1, *n2;
134
-
135
- if (NIL_P (other_query))
136
- return Qfalse;
137
-
138
- q1 = RGST_QUERY_TYPE (self);
139
- q2 = RGST_QUERY_TYPE (other_query);
140
-
141
- n1 = gst_query_type_get_details (*q1)->nick;
142
- n2 = gst_query_type_get_details (*q2)->nick;
143
-
144
- return CBOOL2RVAL( strcmp (n1, n2) == 0);
145
- }
146
-
147
- void
148
- Init_gst_querytype (VALUE mGst)
149
- {
150
- VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS (GST_TYPE_QUERY_TYPE2, "QueryType", mGst);
151
-
152
- RG_DEF_SMETHOD(each, 0);
153
- RG_DEF_SMETHOD(find, 1);
154
-
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);
159
-
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_");
162
- }