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.
- data/Rakefile +78 -39
- data/ext/gstreamer/extconf.rb +8 -22
- data/ext/gstreamer/rbgst.c +82 -194
- data/lib/gst/base_loader.rb +20 -0
- data/lib/gst/bin.rb +32 -0
- data/lib/gst/bus.rb +24 -0
- data/lib/gst/element.rb +48 -0
- data/lib/gst.rb +87 -22
- data/sample/helloworld.rb +75 -0
- data/sample/mp3parselaunch.rb +74 -0
- data/sample/queue.rb +92 -0
- data/sample/typefind.rb +101 -0
- metadata +29 -84
- data/README +0 -33
- data/ext/gstreamer/misc.c +0 -63
- data/ext/gstreamer/rbgst-bin.c +0 -456
- data/ext/gstreamer/rbgst-buffer.c +0 -363
- data/ext/gstreamer/rbgst-bus.c +0 -92
- data/ext/gstreamer/rbgst-caps.c +0 -446
- data/ext/gstreamer/rbgst-child-proxy.c +0 -34
- data/ext/gstreamer/rbgst-clock.c +0 -108
- data/ext/gstreamer/rbgst-element-factory.c +0 -249
- data/ext/gstreamer/rbgst-element.c +0 -1106
- data/ext/gstreamer/rbgst-event.c +0 -352
- data/ext/gstreamer/rbgst-ghost-pad.c +0 -45
- data/ext/gstreamer/rbgst-index-factory.c +0 -69
- data/ext/gstreamer/rbgst-install-plugins-context.c +0 -87
- data/ext/gstreamer/rbgst-install-plugins-return.c +0 -45
- data/ext/gstreamer/rbgst-install-plugins.c +0 -125
- data/ext/gstreamer/rbgst-message.c +0 -785
- data/ext/gstreamer/rbgst-mini-object.c +0 -221
- data/ext/gstreamer/rbgst-object.c +0 -81
- data/ext/gstreamer/rbgst-pad-template.c +0 -125
- data/ext/gstreamer/rbgst-pad.c +0 -336
- data/ext/gstreamer/rbgst-pipeline.c +0 -91
- data/ext/gstreamer/rbgst-plugin-feature.c +0 -131
- data/ext/gstreamer/rbgst-plugin.c +0 -162
- data/ext/gstreamer/rbgst-private.c +0 -88
- data/ext/gstreamer/rbgst-private.h +0 -97
- data/ext/gstreamer/rbgst-query.c +0 -291
- data/ext/gstreamer/rbgst-seek.c +0 -39
- data/ext/gstreamer/rbgst-static-caps.c +0 -49
- data/ext/gstreamer/rbgst-static-pad-template.c +0 -65
- data/ext/gstreamer/rbgst-structure.c +0 -300
- data/ext/gstreamer/rbgst-system-clock.c +0 -48
- data/ext/gstreamer/rbgst-type-find-factory.c +0 -125
- data/ext/gstreamer/rbgst-value.c +0 -527
- data/ext/gstreamer/rbgst-x-overlay.c +0 -131
- data/ext/gstreamer/rbgst.h +0 -197
- data/ext/gstreamer/rbgstclockentry.c +0 -271
- data/ext/gstreamer/rbgstformat.c +0 -162
- data/ext/gstreamer/rbgstindex.c +0 -315
- data/ext/gstreamer/rbgstindexentry.c +0 -99
- data/ext/gstreamer/rbgstparse.c +0 -69
- data/ext/gstreamer/rbgstquerytype.c +0 -162
- data/ext/gstreamer/rbgstregistry.c +0 -288
- data/ext/gstreamer/rbgsttag.c +0 -113
- data/ext/gstreamer/rbgsttagsetter.c +0 -53
- data/ext/gstreamer/rbgstxml.c +0 -192
- data/sample/audio-player.rb +0 -54
- data/sample/gst-gi.rb +0 -55
- data/sample/gst-inspect.rb +0 -417
- data/sample/install-plugins.rb +0 -40
- data/sample/media-type.rb +0 -55
- data/sample/media-type2.rb +0 -268
- data/sample/ogg-audio-player.rb +0 -54
- data/sample/type-find.rb +0 -46
- data/sample/video-player.rb +0 -57
- data/sample/xml-player.rb +0 -60
- data/test/gst-test-utils.rb +0 -18
- data/test/run-test.rb +0 -25
- data/test/test_bin.rb +0 -167
- data/test/test_buffer.rb +0 -185
- data/test/test_caps.rb +0 -24
- data/test/test_element.rb +0 -85
- data/test/test_element_factory.rb +0 -28
- data/test/test_event.rb +0 -10
- data/test/test_index_factory.rb +0 -7
- data/test/test_install-plugins.rb +0 -18
- data/test/test_message.rb +0 -191
- data/test/test_mini_object.rb +0 -38
- data/test/test_object.rb +0 -10
- data/test/test_pad.rb +0 -68
- data/test/test_plugin.rb +0 -6
- data/test/test_plugin_feature.rb +0 -20
- data/test/test_seek.rb +0 -17
- data/test/test_static_caps.rb +0 -18
- data/test/test_static_pad_template.rb +0 -16
- data/test/test_structure.rb +0 -159
- data/test/test_thread_handling.rb +0 -58
- data/test/test_type_find_factory.rb +0 -8
- data/test/test_value.rb +0 -69
@@ -1,249 +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 cElementFactory
|
26
|
-
#define SELF(self) RVAL2GST_ELEMENT_FACTORY(self)
|
27
|
-
|
28
|
-
/* Class: Gst::ElementFactory
|
29
|
-
* Creates Gst::Element instances.
|
30
|
-
*/
|
31
|
-
|
32
|
-
/*
|
33
|
-
* Class method: make(factory_name, element_name)
|
34
|
-
* factory_name: a name of an existing factory.
|
35
|
-
* element_name: a name which will be attributed to the element.
|
36
|
-
*
|
37
|
-
* Creates a new Gst::Element of the type defined by the given element factory.
|
38
|
-
*
|
39
|
-
* If element name is ommited (or nil), then the element will receive a guaranteed
|
40
|
-
* unique name, consisting of the element factory name and a number.
|
41
|
-
* If name is given, it will be given the name supplied.
|
42
|
-
*
|
43
|
-
* # Creates a 'mad' GStreamer element, named 'foo':
|
44
|
-
* elem1 = Gst::ElementFactory.make("mad", "foo")
|
45
|
-
*
|
46
|
-
* # This line does exactly the same thing:
|
47
|
-
* elem2 = Gst::ElementFactory.find("mad").create("foo")
|
48
|
-
*
|
49
|
-
* Returns: a newly created object based on Gst::Element.
|
50
|
-
*/
|
51
|
-
static VALUE
|
52
|
-
rg_s_make(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
53
|
-
{
|
54
|
-
GstElement *element;
|
55
|
-
VALUE fname, ename;
|
56
|
-
VALUE ret;
|
57
|
-
|
58
|
-
rb_scan_args(argc, argv, "11", &fname, &ename);
|
59
|
-
|
60
|
-
element = gst_element_factory_make(RVAL2CSTR(fname),
|
61
|
-
RVAL2CSTR_ACCEPT_NIL(ename));
|
62
|
-
|
63
|
-
if (element == NULL)
|
64
|
-
return Qnil;
|
65
|
-
|
66
|
-
/* This add another ref to the element, but it was already ours so
|
67
|
-
* unref it again */
|
68
|
-
ret = GOBJ2RVAL(element);
|
69
|
-
GOBJ2RVAL_UNREF(element);
|
70
|
-
return ret;
|
71
|
-
}
|
72
|
-
|
73
|
-
/*
|
74
|
-
* Class method: find(factory_name)
|
75
|
-
* factory_name: a name of an existing factory.
|
76
|
-
*
|
77
|
-
* Searches for an element factory of the given name.
|
78
|
-
*
|
79
|
-
* Returns: a Gst::ElementFactory object if found, nil otherwise.
|
80
|
-
*/
|
81
|
-
static VALUE
|
82
|
-
rg_s_find (G_GNUC_UNUSED VALUE self, VALUE factory_name)
|
83
|
-
{
|
84
|
-
GstElementFactory *factory = gst_element_factory_find (RVAL2CSTR (factory_name));
|
85
|
-
return factory != NULL
|
86
|
-
? RGST_ELEMENT_FACTORY_NEW (factory)
|
87
|
-
: Qnil;
|
88
|
-
}
|
89
|
-
|
90
|
-
/*
|
91
|
-
* Method: create(element_name=nil)
|
92
|
-
* element_name: a name which will be attributed to the element.
|
93
|
-
*
|
94
|
-
* Creates a new element of the type defined by the element factory.
|
95
|
-
*
|
96
|
-
* If element name is ommited (or nil), then the element will receive a guaranteed
|
97
|
-
* unique name, consisting of the element factory name and a number.
|
98
|
-
* If name is given, it will be given the name supplied.
|
99
|
-
*
|
100
|
-
* Returns: a newly created object based on Gst::Element.
|
101
|
-
*/
|
102
|
-
static VALUE
|
103
|
-
rg_create(int argc, VALUE *argv, VALUE self)
|
104
|
-
{
|
105
|
-
GstElement *element;
|
106
|
-
VALUE name;
|
107
|
-
|
108
|
-
rb_scan_args(argc, argv, "01", &name);
|
109
|
-
|
110
|
-
element = gst_element_factory_create(SELF(self), RVAL2CSTR_ACCEPT_NIL(name));
|
111
|
-
return GOBJ2RVAL(element);
|
112
|
-
}
|
113
|
-
|
114
|
-
static VALUE
|
115
|
-
rg_to_s (VALUE self)
|
116
|
-
{
|
117
|
-
GstElementFactory *factory = RGST_ELEMENT_FACTORY (self);
|
118
|
-
return rb_str_new_with_format ("Element: %s (%s)",
|
119
|
-
GST_PLUGIN_FEATURE_NAME(factory),
|
120
|
-
factory->details.longname);
|
121
|
-
}
|
122
|
-
|
123
|
-
/*
|
124
|
-
* Method: pad_templates
|
125
|
-
*
|
126
|
-
* Requests all pad templates of factory.
|
127
|
-
*
|
128
|
-
* Returns: an array of Gst::PadTemplate objects.
|
129
|
-
*/
|
130
|
-
static VALUE
|
131
|
-
rg_pad_templates (VALUE self)
|
132
|
-
{
|
133
|
-
GstElementFactory *factory;
|
134
|
-
const GList *list;
|
135
|
-
VALUE arr;
|
136
|
-
|
137
|
-
arr = rb_ary_new();
|
138
|
-
factory = RGST_ELEMENT_FACTORY(self);
|
139
|
-
for (list = gst_element_factory_get_static_pad_templates(factory);
|
140
|
-
list != NULL;
|
141
|
-
list = g_list_next(list)) {
|
142
|
-
GstStaticPadTemplate *pad = list->data;
|
143
|
-
rb_ary_push(arr, GST_STATIC_PAD_TEMPLATE2RVAL(pad));
|
144
|
-
}
|
145
|
-
return arr;
|
146
|
-
}
|
147
|
-
|
148
|
-
/*
|
149
|
-
* Method: each_pad_template { |pad_template| ... }
|
150
|
-
*
|
151
|
-
* Calls the block for each pad template of the factory, passing a
|
152
|
-
* reference to the Gst::PadTemplate as parameter.
|
153
|
-
*
|
154
|
-
* Returns: always nil.
|
155
|
-
*/
|
156
|
-
static VALUE
|
157
|
-
rg_each_pad_template (VALUE self)
|
158
|
-
{
|
159
|
-
return rb_ary_yield (rg_pad_templates (self));
|
160
|
-
}
|
161
|
-
|
162
|
-
/*
|
163
|
-
* Method: details
|
164
|
-
*
|
165
|
-
* Gets some public information about the factory,
|
166
|
-
* mostly for the benefit of editors.
|
167
|
-
*
|
168
|
-
* This information is encapsulated in a Hash object,
|
169
|
-
* with the following (String) keys:
|
170
|
-
*
|
171
|
-
* * longname: long (English) element name.
|
172
|
-
* * klass: type of element, as hierarchy.
|
173
|
-
* * description: a short description about the element.
|
174
|
-
* * author: some information about the author(s).
|
175
|
-
*
|
176
|
-
* Here is an example.
|
177
|
-
*
|
178
|
-
* # Prints all details related to the 'mad' element:
|
179
|
-
* Gst::ElementFactory.find("mad").details do |k, v|
|
180
|
-
* p "#{k}: #{v}"
|
181
|
-
* end
|
182
|
-
*
|
183
|
-
* Returns: a Hash.
|
184
|
-
*/
|
185
|
-
static VALUE
|
186
|
-
rg_details (VALUE self)
|
187
|
-
{
|
188
|
-
GstElementFactory *factory;
|
189
|
-
VALUE hash;
|
190
|
-
|
191
|
-
factory = RGST_ELEMENT_FACTORY (self);
|
192
|
-
|
193
|
-
hash = rb_hash_new();
|
194
|
-
|
195
|
-
rb_hash_aset (hash, CSTR2RVAL ("longname"), CSTR2RVAL (factory->details.longname));
|
196
|
-
rb_hash_aset (hash, CSTR2RVAL ("klass"), CSTR2RVAL (factory->details.klass));
|
197
|
-
rb_hash_aset (hash, CSTR2RVAL ("description"), CSTR2RVAL (factory->details.description));
|
198
|
-
rb_hash_aset (hash, CSTR2RVAL ("author"), CSTR2RVAL (factory->details.author));
|
199
|
-
|
200
|
-
return hash;
|
201
|
-
}
|
202
|
-
|
203
|
-
static VALUE
|
204
|
-
rg_long_name(VALUE self)
|
205
|
-
{
|
206
|
-
return CSTR2RVAL(gst_element_factory_get_longname(SELF(self)));
|
207
|
-
}
|
208
|
-
|
209
|
-
static VALUE
|
210
|
-
rg_klass(VALUE self)
|
211
|
-
{
|
212
|
-
return CSTR2RVAL(gst_element_factory_get_klass(SELF(self)));
|
213
|
-
}
|
214
|
-
|
215
|
-
static VALUE
|
216
|
-
rg_description(VALUE self)
|
217
|
-
{
|
218
|
-
return CSTR2RVAL(gst_element_factory_get_description(SELF(self)));
|
219
|
-
}
|
220
|
-
|
221
|
-
static VALUE
|
222
|
-
rg_author(VALUE self)
|
223
|
-
{
|
224
|
-
return CSTR2RVAL(gst_element_factory_get_author(SELF(self)));
|
225
|
-
}
|
226
|
-
|
227
|
-
void
|
228
|
-
Init_gst_elementfactory (VALUE mGst)
|
229
|
-
{
|
230
|
-
VALUE RG_TARGET_NAMESPACE;
|
231
|
-
|
232
|
-
RG_TARGET_NAMESPACE = G_DEF_CLASS(GST_TYPE_ELEMENT_FACTORY,
|
233
|
-
"ElementFactory",
|
234
|
-
mGst);
|
235
|
-
|
236
|
-
RG_DEF_SMETHOD(make, -1);
|
237
|
-
RG_DEF_SMETHOD(find, 1);
|
238
|
-
|
239
|
-
RG_DEF_METHOD(create, -1);
|
240
|
-
RG_DEF_METHOD(details, 0);
|
241
|
-
RG_DEF_METHOD(to_s, 0);
|
242
|
-
RG_DEF_METHOD(pad_templates, 0);
|
243
|
-
RG_DEF_METHOD(each_pad_template, 0);
|
244
|
-
|
245
|
-
RG_DEF_METHOD(long_name, 0);
|
246
|
-
RG_DEF_METHOD(klass, 0);
|
247
|
-
RG_DEF_METHOD(description, 0);
|
248
|
-
RG_DEF_METHOD(author, 0);
|
249
|
-
}
|