gstreamer 1.2.6 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- 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,221 +0,0 @@
|
|
1
|
-
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
-
/*
|
3
|
-
* Copyright (C) 2011-2013 Ruby-GNOME2 Project Team
|
4
|
-
* Copyright (C) 2007 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
|
-
/* Class: Gst::MiniObject
|
25
|
-
* Base class for refcounted lightweight objects.
|
26
|
-
*/
|
27
|
-
|
28
|
-
#define RG_TARGET_NAMESPACE rb_cGstMiniObject
|
29
|
-
#define SELF(object) (RVAL2GST_MINI_OBJ(object))
|
30
|
-
#define RVAL2GST_FLAGS(flags) \
|
31
|
-
(RVAL2GFLAGS(flags, GST_TYPE_MINI_OBJECT_FLAGS))
|
32
|
-
#define GST_FLAGS2RVAL(flags) \
|
33
|
-
(GFLAGS2RVAL(flags, GST_TYPE_MINI_OBJECT_FLAGS))
|
34
|
-
|
35
|
-
VALUE RG_TARGET_NAMESPACE;
|
36
|
-
|
37
|
-
void
|
38
|
-
_rbgst_mini_object_free(void *ptr)
|
39
|
-
{
|
40
|
-
if (ptr) {
|
41
|
-
gst_mini_object_unref((GstMiniObject *)ptr);
|
42
|
-
}
|
43
|
-
}
|
44
|
-
|
45
|
-
static VALUE
|
46
|
-
rbgst_mini_object_get_superclass(G_GNUC_UNUSED gpointer user_data)
|
47
|
-
{
|
48
|
-
return rb_cObject;
|
49
|
-
}
|
50
|
-
|
51
|
-
static VALUE
|
52
|
-
initialize_with_abstract_check(int argc, VALUE *argv, VALUE self)
|
53
|
-
{
|
54
|
-
GType gtype = CLASS2GTYPE(CLASS_OF(self));
|
55
|
-
|
56
|
-
if (G_TYPE_IS_ABSTRACT(gtype))
|
57
|
-
rb_raise(rb_eTypeError, "initializing abstract class");
|
58
|
-
|
59
|
-
return rb_call_super(argc, argv);
|
60
|
-
}
|
61
|
-
|
62
|
-
static void
|
63
|
-
rbgst_mini_object_type_init_hook(VALUE klass, G_GNUC_UNUSED gpointer user_data)
|
64
|
-
{
|
65
|
-
if (G_TYPE_IS_ABSTRACT(CLASS2GTYPE(klass)))
|
66
|
-
rbg_define_method(klass, "initialize",
|
67
|
-
initialize_with_abstract_check, -1);
|
68
|
-
}
|
69
|
-
|
70
|
-
static VALUE
|
71
|
-
gvalue2rvalue(const GValue *value, G_GNUC_UNUSED gpointer user_data)
|
72
|
-
{
|
73
|
-
GstMiniObject* obj;
|
74
|
-
obj = gst_value_get_mini_object(value);
|
75
|
-
return obj ? GOBJ2RVAL(obj) : Qnil;
|
76
|
-
}
|
77
|
-
|
78
|
-
static void
|
79
|
-
rvalue2gvalue(VALUE value, GValue *result, G_GNUC_UNUSED gpointer user_data)
|
80
|
-
{
|
81
|
-
gst_value_set_mini_object(result, NIL_P(value) ? NULL : RVAL2GOBJ(value));
|
82
|
-
}
|
83
|
-
|
84
|
-
static void
|
85
|
-
rbgst_mini_object_initialize(VALUE object, gpointer instance,
|
86
|
-
G_GNUC_UNUSED gpointer user_data)
|
87
|
-
{
|
88
|
-
DATA_PTR(object) = instance;
|
89
|
-
}
|
90
|
-
|
91
|
-
static gpointer
|
92
|
-
rbgst_mini_object_robj2instance(VALUE object, G_GNUC_UNUSED gpointer user_data)
|
93
|
-
{
|
94
|
-
gpointer instance;
|
95
|
-
|
96
|
-
if (!RVAL2CBOOL(rb_obj_is_kind_of(object, RG_TARGET_NAMESPACE))) {
|
97
|
-
rb_raise(rb_eTypeError, "not a Gst::MiniObject");
|
98
|
-
}
|
99
|
-
Data_Get_Struct(object, GstMiniObject, instance);
|
100
|
-
return instance;
|
101
|
-
}
|
102
|
-
|
103
|
-
static void
|
104
|
-
rbgst_mini_object_define_class_if_need(VALUE klass, GType type)
|
105
|
-
{
|
106
|
-
_rbgst_define_class_if_need(klass, type, NULL);
|
107
|
-
}
|
108
|
-
|
109
|
-
static VALUE
|
110
|
-
rbgst_mini_object_instance2robj(gpointer instance,
|
111
|
-
G_GNUC_UNUSED gpointer user_data)
|
112
|
-
{
|
113
|
-
VALUE klass;
|
114
|
-
GType type;
|
115
|
-
|
116
|
-
type = G_TYPE_FROM_INSTANCE(instance);
|
117
|
-
klass = GTYPE2CLASS(type);
|
118
|
-
rbgst_mini_object_define_class_if_need(klass, type);
|
119
|
-
gst_mini_object_ref(instance);
|
120
|
-
return Data_Wrap_Struct(klass, NULL, _rbgst_mini_object_free, instance);
|
121
|
-
}
|
122
|
-
|
123
|
-
static void
|
124
|
-
rbgst_mini_object_unref(gpointer instance, G_GNUC_UNUSED gpointer user_data)
|
125
|
-
{
|
126
|
-
gst_mini_object_unref(instance);
|
127
|
-
}
|
128
|
-
|
129
|
-
static VALUE
|
130
|
-
s_allocate(VALUE klass)
|
131
|
-
{
|
132
|
-
return Data_Wrap_Struct(klass, NULL, _rbgst_mini_object_free, NULL);
|
133
|
-
}
|
134
|
-
|
135
|
-
static VALUE
|
136
|
-
rg_flags(VALUE self)
|
137
|
-
{
|
138
|
-
return GST_FLAGS2RVAL(GST_MINI_OBJECT_FLAGS(SELF(self)));
|
139
|
-
}
|
140
|
-
|
141
|
-
static VALUE
|
142
|
-
rg_set_flags(VALUE self, VALUE flag)
|
143
|
-
{
|
144
|
-
GST_MINI_OBJECT_FLAGS(SELF(self)) = RVAL2GST_FLAGS(flag);
|
145
|
-
return Qnil;
|
146
|
-
}
|
147
|
-
|
148
|
-
static VALUE
|
149
|
-
rg_raise_flag(VALUE self, VALUE flag)
|
150
|
-
{
|
151
|
-
GST_MINI_OBJECT_FLAG_SET(SELF(self), RVAL2GST_FLAGS(flag));
|
152
|
-
return Qnil;
|
153
|
-
}
|
154
|
-
|
155
|
-
static VALUE
|
156
|
-
rg_lower_flag(VALUE self, VALUE flag)
|
157
|
-
{
|
158
|
-
GST_MINI_OBJECT_FLAG_UNSET(SELF(self), RVAL2GST_FLAGS(flag));
|
159
|
-
return Qnil;
|
160
|
-
}
|
161
|
-
|
162
|
-
static VALUE
|
163
|
-
rg_flag_raised_p(VALUE self, VALUE flag)
|
164
|
-
{
|
165
|
-
return CBOOL2RVAL(GST_MINI_OBJECT_FLAG_IS_SET(SELF(self),
|
166
|
-
RVAL2GST_FLAGS(flag)));
|
167
|
-
}
|
168
|
-
|
169
|
-
static VALUE
|
170
|
-
rg_writable_p(VALUE self)
|
171
|
-
{
|
172
|
-
return CBOOL2RVAL(gst_mini_object_is_writable(SELF(self)));
|
173
|
-
}
|
174
|
-
|
175
|
-
static VALUE
|
176
|
-
rg_writable_bang(VALUE self)
|
177
|
-
{
|
178
|
-
GstMiniObject *original, *writable;
|
179
|
-
|
180
|
-
original = SELF(self);
|
181
|
-
writable = gst_mini_object_make_writable(original);
|
182
|
-
DATA_PTR(self) = writable;
|
183
|
-
if (original == writable)
|
184
|
-
gst_mini_object_unref(original);
|
185
|
-
return self;
|
186
|
-
}
|
187
|
-
|
188
|
-
void
|
189
|
-
Init_gst_mini_object(VALUE mGst)
|
190
|
-
{
|
191
|
-
RGConvertTable table;
|
192
|
-
|
193
|
-
memset(&table, 0, sizeof(RGConvertTable));
|
194
|
-
table.type = GST_TYPE_MINI_OBJECT;
|
195
|
-
table.get_superclass = rbgst_mini_object_get_superclass;
|
196
|
-
table.type_init_hook = rbgst_mini_object_type_init_hook;
|
197
|
-
table.rvalue2gvalue = rvalue2gvalue;
|
198
|
-
table.gvalue2rvalue = gvalue2rvalue;
|
199
|
-
table.initialize = rbgst_mini_object_initialize;
|
200
|
-
table.robj2instance = rbgst_mini_object_robj2instance;
|
201
|
-
table.instance2robj = rbgst_mini_object_instance2robj;
|
202
|
-
table.unref = rbgst_mini_object_unref;
|
203
|
-
|
204
|
-
RG_DEF_CONVERSION(&table);
|
205
|
-
|
206
|
-
RG_TARGET_NAMESPACE = G_DEF_CLASS(GST_TYPE_MINI_OBJECT, "MiniObject", mGst);
|
207
|
-
|
208
|
-
G_DEF_CLASS(GST_TYPE_MINI_OBJECT_FLAGS, "Flags", RG_TARGET_NAMESPACE);
|
209
|
-
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GST_TYPE_MINI_OBJECT_FLAGS,
|
210
|
-
"GST_MINI_OBJECT_");
|
211
|
-
|
212
|
-
rb_define_alloc_func(RG_TARGET_NAMESPACE, s_allocate);
|
213
|
-
|
214
|
-
RG_DEF_METHOD(flags, 0);
|
215
|
-
RG_DEF_METHOD(set_flags, 1);
|
216
|
-
RG_DEF_METHOD(raise_flag, 1);
|
217
|
-
RG_DEF_METHOD(lower_flag, 1);
|
218
|
-
RG_DEF_METHOD_P(flag_raised, 1);
|
219
|
-
RG_DEF_METHOD_P(writable, 0);
|
220
|
-
RG_DEF_METHOD_BANG(writable, 0);
|
221
|
-
}
|
@@ -1,81 +0,0 @@
|
|
1
|
-
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
-
/*
|
3
|
-
* Copyright (C) 2011-2013 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 cObject
|
26
|
-
#define SELF(self) (RVAL2GST_OBJ(self))
|
27
|
-
|
28
|
-
/* Class: Gst::Object
|
29
|
-
* Basis for the GST object hierarchy.
|
30
|
-
*/
|
31
|
-
|
32
|
-
VALUE
|
33
|
-
rbgst_object_instance2robj(gpointer instance, G_GNUC_UNUSED gpointer user_data)
|
34
|
-
{
|
35
|
-
if (GST_OBJECT_IS_FLOATING(instance)) {
|
36
|
-
gst_object_ref(instance);
|
37
|
-
gst_object_sink(instance);
|
38
|
-
}
|
39
|
-
|
40
|
-
return rbgobj_get_ruby_object_from_gobject(instance, TRUE);
|
41
|
-
}
|
42
|
-
|
43
|
-
static void
|
44
|
-
rbgst_object_initialize(VALUE obj, gpointer cobj,
|
45
|
-
G_GNUC_UNUSED gpointer user_data)
|
46
|
-
{
|
47
|
-
if (GST_OBJECT_IS_FLOATING(cobj)) {
|
48
|
-
gst_object_ref(cobj);
|
49
|
-
gst_object_sink(cobj);
|
50
|
-
}
|
51
|
-
|
52
|
-
rbgobj_gobject_initialize(obj, cobj);
|
53
|
-
}
|
54
|
-
|
55
|
-
static VALUE
|
56
|
-
rg_set_name(VALUE self, VALUE name)
|
57
|
-
{
|
58
|
-
return CBOOL2RVAL(gst_object_set_name(SELF(self), RVAL2CSTR(name)));
|
59
|
-
}
|
60
|
-
|
61
|
-
void
|
62
|
-
Init_gst_object(VALUE mGst)
|
63
|
-
{
|
64
|
-
VALUE RG_TARGET_NAMESPACE;
|
65
|
-
RGConvertTable table;
|
66
|
-
|
67
|
-
memset(&table, 0, sizeof(table));
|
68
|
-
table.type = GST_TYPE_OBJECT;
|
69
|
-
table.klass = Qnil;
|
70
|
-
table.instance2robj = rbgst_object_instance2robj;
|
71
|
-
table.initialize = rbgst_object_initialize;
|
72
|
-
|
73
|
-
RG_DEF_CONVERSION(&table);
|
74
|
-
|
75
|
-
RG_TARGET_NAMESPACE = G_DEF_CLASS(GST_TYPE_OBJECT, "Object", mGst);
|
76
|
-
|
77
|
-
G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "name", rg_set_name, 1);
|
78
|
-
|
79
|
-
G_DEF_CLASS(GST_TYPE_OBJECT_FLAGS, "Flags", RG_TARGET_NAMESPACE);
|
80
|
-
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GST_TYPE_OBJECT_FLAGS, "GST_");
|
81
|
-
}
|
@@ -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 cPadTemplate
|
26
|
-
#define SELF(self) RVAL2GST_PAD_TEMPLATE(self)
|
27
|
-
|
28
|
-
/* Class: Gst::PadTemplate
|
29
|
-
* Describe the media type of a Gst::Pad.
|
30
|
-
*/
|
31
|
-
|
32
|
-
/*
|
33
|
-
* Method: name
|
34
|
-
*
|
35
|
-
* Gets the name of the pad template.
|
36
|
-
* This overrides Gst::Object#name.
|
37
|
-
*
|
38
|
-
* Returns: the name of the pad template.
|
39
|
-
*/
|
40
|
-
static VALUE
|
41
|
-
rg_name(VALUE self)
|
42
|
-
{
|
43
|
-
/*
|
44
|
-
* We can't call Gst::Object#name since the real name
|
45
|
-
* of the pad template is in the "name_template" field of
|
46
|
-
* GstPadTemplate.
|
47
|
-
*/
|
48
|
-
return CSTR2RVAL(GST_PAD_TEMPLATE_NAME_TEMPLATE(SELF(self)));
|
49
|
-
}
|
50
|
-
|
51
|
-
/* Method: presence
|
52
|
-
* Returns: the pad's presence (see Gst::Pad::Presence).
|
53
|
-
*/
|
54
|
-
static VALUE
|
55
|
-
rg_presence(VALUE self)
|
56
|
-
{
|
57
|
-
return GENUM2RVAL(GST_PAD_TEMPLATE_PRESENCE(SELF(self)),
|
58
|
-
GST_TYPE_PAD_PRESENCE);
|
59
|
-
}
|
60
|
-
|
61
|
-
/* Method: direction
|
62
|
-
* Returns: the pad's direction (see Gst::Pad::Direction).
|
63
|
-
*/
|
64
|
-
static VALUE
|
65
|
-
rg_direction(VALUE self)
|
66
|
-
{
|
67
|
-
return GENUM2RVAL(GST_PAD_TEMPLATE_DIRECTION(SELF(self)),
|
68
|
-
GST_TYPE_PAD_DIRECTION);
|
69
|
-
}
|
70
|
-
|
71
|
-
/*
|
72
|
-
* Method: caps
|
73
|
-
*
|
74
|
-
* Gets the capabilities of the pad template element.
|
75
|
-
*
|
76
|
-
* Returns: a Gst::Caps object.
|
77
|
-
*/
|
78
|
-
static VALUE
|
79
|
-
rg_caps(VALUE self)
|
80
|
-
{
|
81
|
-
return GST_CAPS2RVAL(gst_pad_template_get_caps(RGST_PAD_TEMPLATE(self)));
|
82
|
-
}
|
83
|
-
|
84
|
-
/*
|
85
|
-
* Method: each_caps { |caps| ... }
|
86
|
-
*
|
87
|
-
* Calls the block for each capability of the pad template,
|
88
|
-
* passing a reference to the Gst::Caps object as parameter.
|
89
|
-
*
|
90
|
-
* Returns: always nil.
|
91
|
-
*/
|
92
|
-
static VALUE
|
93
|
-
rg_each_caps(VALUE self)
|
94
|
-
{
|
95
|
-
return rb_ary_yield(rg_caps(self));
|
96
|
-
}
|
97
|
-
|
98
|
-
/* Method: has_caps?
|
99
|
-
* Returns: true if the pad template has capabilities, false otherwise.
|
100
|
-
*/
|
101
|
-
static VALUE
|
102
|
-
rg_has_caps_p(VALUE self)
|
103
|
-
{
|
104
|
-
return CBOOL2RVAL(SELF(self)->caps != NULL);
|
105
|
-
}
|
106
|
-
|
107
|
-
void
|
108
|
-
Init_gst_pad_template (VALUE mGst)
|
109
|
-
{
|
110
|
-
VALUE RG_TARGET_NAMESPACE;
|
111
|
-
|
112
|
-
RG_TARGET_NAMESPACE = G_DEF_CLASS(GST_TYPE_PAD_TEMPLATE, "PadTemplate", mGst);
|
113
|
-
|
114
|
-
RG_DEF_METHOD(name, 0);
|
115
|
-
RG_DEF_METHOD(presence, 0);
|
116
|
-
RG_DEF_METHOD(direction, 0);
|
117
|
-
RG_DEF_METHOD(caps, 0);
|
118
|
-
RG_DEF_METHOD(each_caps, 0);
|
119
|
-
RG_DEF_METHOD_P(has_caps, 0);
|
120
|
-
RG_DEF_ALIAS("have_caps?", "has_caps?");
|
121
|
-
|
122
|
-
G_DEF_CLASS(GST_TYPE_PAD_TEMPLATE_FLAGS, "Flags", RG_TARGET_NAMESPACE);
|
123
|
-
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GST_TYPE_PAD_TEMPLATE_FLAGS,
|
124
|
-
"GST_PAD_TEMPLATE_");
|
125
|
-
}
|