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,88 +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
|
-
char *
|
25
|
-
_rbgst_inspect(VALUE object)
|
26
|
-
{
|
27
|
-
VALUE inspected;
|
28
|
-
inspected = rb_funcall(object, rb_intern("inspect"), 0);
|
29
|
-
return StringValueCStr(inspected);
|
30
|
-
}
|
31
|
-
|
32
|
-
void
|
33
|
-
_rbgst_define_class_if_need(VALUE klass, GType type, const gchar *prefix)
|
34
|
-
{
|
35
|
-
VALUE parent;
|
36
|
-
const gchar *type_name;
|
37
|
-
gchar *class_name = NULL;
|
38
|
-
static ID id_gtype = 0;
|
39
|
-
|
40
|
-
if (rb_class2name(klass)[0] != '#')
|
41
|
-
return;
|
42
|
-
|
43
|
-
type_name = g_type_name(type);
|
44
|
-
if (g_str_has_prefix(type_name, "Gst"))
|
45
|
-
type_name += 3;
|
46
|
-
|
47
|
-
if (prefix)
|
48
|
-
class_name = g_strconcat(prefix, type_name, NULL);
|
49
|
-
G_DEF_CLASS(type, class_name ? class_name : type_name, mGst);
|
50
|
-
g_free(class_name);
|
51
|
-
|
52
|
-
parent = rb_ary_entry(rb_mod_ancestors(klass), 1);
|
53
|
-
if (!id_gtype)
|
54
|
-
id_gtype = rb_intern("gtype");
|
55
|
-
if (rb_respond_to(parent, id_gtype))
|
56
|
-
_rbgst_define_class_if_need(parent, CLASS2GTYPE(parent), prefix);
|
57
|
-
}
|
58
|
-
|
59
|
-
VALUE
|
60
|
-
_rbgst_collect_elements(GstIterator *iter)
|
61
|
-
{
|
62
|
-
VALUE elements;
|
63
|
-
gboolean done = FALSE;
|
64
|
-
|
65
|
-
elements = rb_ary_new();
|
66
|
-
while (!done) {
|
67
|
-
gpointer element;
|
68
|
-
switch (gst_iterator_next(iter, &element)) {
|
69
|
-
case GST_ITERATOR_OK:
|
70
|
-
rb_ary_push(elements, GST_ELEMENT2RVAL(element));
|
71
|
-
gst_object_unref(element);
|
72
|
-
break;
|
73
|
-
case GST_ITERATOR_RESYNC:
|
74
|
-
gst_iterator_resync(iter);
|
75
|
-
break;
|
76
|
-
case GST_ITERATOR_ERROR:
|
77
|
-
done = TRUE;
|
78
|
-
break;
|
79
|
-
case GST_ITERATOR_DONE:
|
80
|
-
done = TRUE;
|
81
|
-
break;
|
82
|
-
}
|
83
|
-
}
|
84
|
-
gst_iterator_free(iter);
|
85
|
-
|
86
|
-
return elements;
|
87
|
-
}
|
88
|
-
|
@@ -1,97 +0,0 @@
|
|
1
|
-
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
-
/*
|
3
|
-
* Copyright (C) 2011-2013 Ruby-GNOME2 Project Team
|
4
|
-
* Copyright (C) 2008 Ruby-GNOME2 Project
|
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
|
-
#ifndef __RBGST_PRIVATE_H_
|
23
|
-
#define __RBGST_PRIVATE_H_
|
24
|
-
|
25
|
-
#include "rbgst.h"
|
26
|
-
|
27
|
-
#ifndef G_VALUE_INIT
|
28
|
-
# define G_VALUE_INIT { 0, { { 0 } } }
|
29
|
-
#endif
|
30
|
-
|
31
|
-
char *_rbgst_inspect(VALUE object);
|
32
|
-
void _rbgst_define_class_if_need(VALUE klass, GType type, const gchar *prefix);
|
33
|
-
VALUE _rbgst_collect_elements(GstIterator *iter);
|
34
|
-
|
35
|
-
void _rbgst_mini_object_free(void *ptr);
|
36
|
-
|
37
|
-
/* implemented in rbgst-object.c */
|
38
|
-
VALUE rbgst_object_instance2robj(gpointer instance, gpointer user_data);
|
39
|
-
|
40
|
-
|
41
|
-
G_GNUC_INTERNAL void Init_gst_bin (VALUE mGst);
|
42
|
-
G_GNUC_INTERNAL void Init_gst_buffer(VALUE mGst);
|
43
|
-
G_GNUC_INTERNAL void Init_gst_bus(VALUE mGst);
|
44
|
-
G_GNUC_INTERNAL void Init_gst_caps (VALUE mGst);
|
45
|
-
G_GNUC_INTERNAL void Init_gst_child_proxy(VALUE mGst);
|
46
|
-
G_GNUC_INTERNAL void Init_gst_clock (VALUE mGst);
|
47
|
-
G_GNUC_INTERNAL void Init_gst_clock_entry (VALUE mGst);
|
48
|
-
G_GNUC_INTERNAL void Init_gst_element (VALUE mGst);
|
49
|
-
G_GNUC_INTERNAL void Init_gst_elementfactory (VALUE mGst);
|
50
|
-
G_GNUC_INTERNAL void Init_gst_event(VALUE mGst);
|
51
|
-
G_GNUC_INTERNAL void Init_gst_format (VALUE mGst);
|
52
|
-
G_GNUC_INTERNAL void Init_gst_seek(VALUE mGst);
|
53
|
-
G_GNUC_INTERNAL void Init_gst_structure(VALUE mGst);
|
54
|
-
G_GNUC_INTERNAL void Init_gst_index (VALUE mGst);
|
55
|
-
G_GNUC_INTERNAL void Init_gst_indexentry (VALUE mGst);
|
56
|
-
G_GNUC_INTERNAL void Init_gst_indexfactory (VALUE mGst);
|
57
|
-
G_GNUC_INTERNAL void Init_gst_message(VALUE mGst);
|
58
|
-
G_GNUC_INTERNAL void Init_gst_mini_object(VALUE mGst);
|
59
|
-
G_GNUC_INTERNAL void Init_gst_object (VALUE mGst);
|
60
|
-
G_GNUC_INTERNAL void Init_gst_pad (VALUE mGst);
|
61
|
-
G_GNUC_INTERNAL void Init_gst_pad_template(VALUE mGst);
|
62
|
-
G_GNUC_INTERNAL void Init_gst_ghost_pad(VALUE mGst);
|
63
|
-
G_GNUC_INTERNAL void Init_gst_parse (VALUE mGst);
|
64
|
-
G_GNUC_INTERNAL void Init_gst_pipeline (VALUE mGst);
|
65
|
-
G_GNUC_INTERNAL void Init_gst_plugin (VALUE mGst);
|
66
|
-
G_GNUC_INTERNAL void Init_gst_plugin_feature (VALUE mGst);
|
67
|
-
G_GNUC_INTERNAL void Init_gst_query(VALUE mGst);
|
68
|
-
G_GNUC_INTERNAL void Init_gst_querytype (VALUE mGst);
|
69
|
-
G_GNUC_INTERNAL void Init_gst_registry (VALUE mGst);
|
70
|
-
G_GNUC_INTERNAL void Init_gst_registry_pool (VALUE mGst);
|
71
|
-
G_GNUC_INTERNAL void Init_gst_scheduler (VALUE mGst);
|
72
|
-
G_GNUC_INTERNAL void Init_gst_schedulerfactory (VALUE mGst);
|
73
|
-
G_GNUC_INTERNAL void Init_gst_static_caps(VALUE mGst);
|
74
|
-
G_GNUC_INTERNAL void Init_gst_static_pad_template(VALUE mGst);
|
75
|
-
G_GNUC_INTERNAL void Init_gst_systemclock (VALUE mGst);
|
76
|
-
G_GNUC_INTERNAL void Init_gst_tag (VALUE mGst);
|
77
|
-
G_GNUC_INTERNAL void Init_gst_tag_setter (VALUE mGst);
|
78
|
-
G_GNUC_INTERNAL void Init_gst_thread (VALUE mGst);
|
79
|
-
G_GNUC_INTERNAL void Init_gst_typefindfactory (VALUE mGst);
|
80
|
-
G_GNUC_INTERNAL void Init_gst_value(VALUE mGst);
|
81
|
-
G_GNUC_INTERNAL void Init_gst_xml (VALUE mGst);
|
82
|
-
|
83
|
-
#if defined(HAVE_GST_OVERLAY)
|
84
|
-
G_GNUC_INTERNAL void Init_gst_x_overlay (VALUE mGst);
|
85
|
-
#endif
|
86
|
-
|
87
|
-
#if defined(HAVE_MEDIA_INFO)
|
88
|
-
G_GNUC_INTERNAL void Init_gst_mediatype (VALUE mGst);
|
89
|
-
#endif
|
90
|
-
|
91
|
-
#ifdef HAVE_GST_PBUTILS
|
92
|
-
G_GNUC_INTERNAL void Init_gst_install_plugins_context (VALUE mGst);
|
93
|
-
G_GNUC_INTERNAL void Init_gst_install_plugins (VALUE mGst);
|
94
|
-
G_GNUC_INTERNAL void Init_gst_install_plugins_return (VALUE mGst);
|
95
|
-
#endif
|
96
|
-
|
97
|
-
#endif /* __RBGST_PRIVATE_H_ */
|
data/ext/gstreamer/rbgst-query.c
DELETED
@@ -1,291 +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) 2006 Sjoerd Simons <sjoerd@luon.net>
|
6
|
-
* Copyright (C) 2006 Zaheer Abbas Merali <zaheerabbas at merali dot org>
|
7
|
-
* Copyright (C) 2003, 2004 Laurent Sansonetti <lrz@gnome.org>
|
8
|
-
*
|
9
|
-
* This library is free software; you can redistribute it and/or
|
10
|
-
* modify it under the terms of the GNU Lesser General Public
|
11
|
-
* License as published by the Free Software Foundation; either
|
12
|
-
* version 2.1 of the License, or (at your option) any later version.
|
13
|
-
*
|
14
|
-
* This library is distributed in the hope that it will be useful,
|
15
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
17
|
-
* Lesser General Public License for more details.
|
18
|
-
*
|
19
|
-
* You should have received a copy of the GNU Lesser General Public
|
20
|
-
* License along with this library; if not, write to the Free Software
|
21
|
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
22
|
-
* MA 02110-1301 USA
|
23
|
-
*/
|
24
|
-
|
25
|
-
#include "rbgst-private.h"
|
26
|
-
|
27
|
-
/* Document-class: Gst::Query
|
28
|
-
* Queries.
|
29
|
-
*/
|
30
|
-
|
31
|
-
static VALUE rb_cGstQueryPosition;
|
32
|
-
static VALUE rb_cGstQueryDuration;
|
33
|
-
static VALUE rb_cGstQueryLatency;
|
34
|
-
static VALUE rb_cGstQuerySeeking;
|
35
|
-
static VALUE rb_cGstQuerySegment;
|
36
|
-
static VALUE rb_cGstQueryConvert;
|
37
|
-
static VALUE rb_cGstQueryFormats;
|
38
|
-
static VALUE rb_cGstQuery;
|
39
|
-
|
40
|
-
static VALUE
|
41
|
-
get_superclass(G_GNUC_UNUSED gpointer user_data)
|
42
|
-
{
|
43
|
-
return rb_cGstMiniObject;
|
44
|
-
}
|
45
|
-
|
46
|
-
static VALUE
|
47
|
-
instance2robj(gpointer instance, G_GNUC_UNUSED gpointer user_data)
|
48
|
-
{
|
49
|
-
VALUE klass;
|
50
|
-
GstQuery *query;
|
51
|
-
|
52
|
-
query = instance;
|
53
|
-
|
54
|
-
switch (GST_QUERY_TYPE(query)) {
|
55
|
-
case GST_QUERY_POSITION:
|
56
|
-
klass = rb_cGstQueryPosition;
|
57
|
-
break;
|
58
|
-
case GST_QUERY_DURATION:
|
59
|
-
klass = rb_cGstQueryDuration;
|
60
|
-
break;
|
61
|
-
case GST_QUERY_LATENCY:
|
62
|
-
klass = rb_cGstQueryLatency;
|
63
|
-
break;
|
64
|
-
case GST_QUERY_SEEKING:
|
65
|
-
klass = rb_cGstQuerySeeking;
|
66
|
-
break;
|
67
|
-
case GST_QUERY_SEGMENT:
|
68
|
-
klass = rb_cGstQuerySegment;
|
69
|
-
break;
|
70
|
-
case GST_QUERY_CONVERT:
|
71
|
-
klass = rb_cGstQueryConvert;
|
72
|
-
break;
|
73
|
-
case GST_QUERY_FORMATS:
|
74
|
-
klass = rb_cGstQueryFormats;
|
75
|
-
break;
|
76
|
-
default:
|
77
|
-
klass = rb_cGstQuery;
|
78
|
-
break;
|
79
|
-
}
|
80
|
-
|
81
|
-
gst_mini_object_ref(instance);
|
82
|
-
return Data_Wrap_Struct(klass, NULL, _rbgst_mini_object_free, instance);
|
83
|
-
}
|
84
|
-
|
85
|
-
static VALUE
|
86
|
-
position_initialize(VALUE self, VALUE format)
|
87
|
-
{
|
88
|
-
GstQuery *query;
|
89
|
-
|
90
|
-
query = gst_query_new_position(RVAL2GST_FORMAT(format));
|
91
|
-
|
92
|
-
G_INITIALIZE(self, query);
|
93
|
-
return Qnil;
|
94
|
-
}
|
95
|
-
|
96
|
-
static VALUE
|
97
|
-
position_parse(VALUE self)
|
98
|
-
{
|
99
|
-
GstFormat format;
|
100
|
-
gint64 cur;
|
101
|
-
|
102
|
-
gst_query_parse_position(RVAL2GST_QUERY(self), &format, &cur);
|
103
|
-
|
104
|
-
return rb_ary_new3(2, GST_FORMAT2RVAL(format), LL2NUM(cur));
|
105
|
-
}
|
106
|
-
|
107
|
-
static VALUE
|
108
|
-
duration_initialize(VALUE self, VALUE format)
|
109
|
-
{
|
110
|
-
GstQuery *query;
|
111
|
-
|
112
|
-
query = gst_query_new_duration(RVAL2GST_FORMAT(format));
|
113
|
-
|
114
|
-
G_INITIALIZE(self, query);
|
115
|
-
return Qnil;
|
116
|
-
}
|
117
|
-
|
118
|
-
static VALUE
|
119
|
-
duration_parse(VALUE self)
|
120
|
-
{
|
121
|
-
GstFormat format;
|
122
|
-
gint64 cur;
|
123
|
-
|
124
|
-
gst_query_parse_duration(RVAL2GST_QUERY(self), &format, &cur);
|
125
|
-
|
126
|
-
return rb_ary_new3(2, GST_FORMAT2RVAL(format), LL2NUM(cur));
|
127
|
-
}
|
128
|
-
|
129
|
-
static VALUE
|
130
|
-
latency_initialize(VALUE self)
|
131
|
-
{
|
132
|
-
GstQuery *query;
|
133
|
-
|
134
|
-
query = gst_query_new_latency();
|
135
|
-
|
136
|
-
G_INITIALIZE(self, query);
|
137
|
-
return Qnil;
|
138
|
-
}
|
139
|
-
|
140
|
-
static VALUE
|
141
|
-
latency_parse(VALUE self)
|
142
|
-
{
|
143
|
-
GstClockTime min_latency;
|
144
|
-
GstClockTime max_latency;
|
145
|
-
gboolean live;
|
146
|
-
|
147
|
-
gst_query_parse_latency(RVAL2GST_QUERY(self), &live, &min_latency,
|
148
|
-
&max_latency);
|
149
|
-
|
150
|
-
return rb_ary_new3(3, CBOOL2RVAL(live), ULL2NUM(min_latency),
|
151
|
-
ULL2NUM(max_latency));
|
152
|
-
}
|
153
|
-
|
154
|
-
|
155
|
-
static VALUE
|
156
|
-
seeking_initialize(VALUE self, VALUE format)
|
157
|
-
{
|
158
|
-
GstQuery *query;
|
159
|
-
|
160
|
-
query = gst_query_new_seeking(RVAL2GST_FORMAT(format));
|
161
|
-
|
162
|
-
G_INITIALIZE(self, query);
|
163
|
-
return Qnil;
|
164
|
-
}
|
165
|
-
|
166
|
-
static VALUE
|
167
|
-
seeking_parse(VALUE self)
|
168
|
-
{
|
169
|
-
GstFormat format;
|
170
|
-
gboolean seekable;
|
171
|
-
gint64 segment_start, segment_end;
|
172
|
-
|
173
|
-
gst_query_parse_seeking(RVAL2GST_QUERY(self), &format, &seekable,
|
174
|
-
&segment_start, &segment_end);
|
175
|
-
|
176
|
-
return rb_ary_new3(4, GST_FORMAT2RVAL(format), CBOOL2RVAL(seekable),
|
177
|
-
LL2NUM(segment_start), LL2NUM(segment_end));
|
178
|
-
}
|
179
|
-
|
180
|
-
|
181
|
-
static VALUE
|
182
|
-
segment_initialize(VALUE self, VALUE format)
|
183
|
-
{
|
184
|
-
GstQuery *query;
|
185
|
-
|
186
|
-
query = gst_query_new_segment(RVAL2GST_FORMAT(format));
|
187
|
-
|
188
|
-
G_INITIALIZE(self, query);
|
189
|
-
return Qnil;
|
190
|
-
}
|
191
|
-
|
192
|
-
static VALUE
|
193
|
-
segment_parse(VALUE self)
|
194
|
-
{
|
195
|
-
GstFormat format;
|
196
|
-
gdouble rate;
|
197
|
-
gint64 start_value, stop_value;
|
198
|
-
|
199
|
-
gst_query_parse_segment(RVAL2GST_QUERY(self), &rate, &format,
|
200
|
-
&start_value, &stop_value);
|
201
|
-
|
202
|
-
return rb_ary_new3(4, rb_dbl2big(rate), GST_FORMAT2RVAL(format),
|
203
|
-
LL2NUM(start_value), LL2NUM(stop_value));
|
204
|
-
}
|
205
|
-
|
206
|
-
static VALUE
|
207
|
-
convert_initialize(VALUE self, VALUE src_format, VALUE value, VALUE dest_format)
|
208
|
-
{
|
209
|
-
GstQuery *query;
|
210
|
-
|
211
|
-
query = gst_query_new_convert(GST_FORMAT2RVAL(src_format),
|
212
|
-
NUM2LL(value), GST_FORMAT2RVAL(dest_format));
|
213
|
-
|
214
|
-
G_INITIALIZE(self, query);
|
215
|
-
return Qnil;
|
216
|
-
}
|
217
|
-
|
218
|
-
static VALUE
|
219
|
-
convert_parse(VALUE self)
|
220
|
-
{
|
221
|
-
GstFormat src_format, dest_format;
|
222
|
-
gint64 src_value, dest_value;
|
223
|
-
|
224
|
-
gst_query_parse_convert(RVAL2GST_QUERY(self), &src_format, &src_value,
|
225
|
-
&dest_format, &dest_value);
|
226
|
-
|
227
|
-
return rb_ary_new3(4, GST_FORMAT2RVAL(src_format), LL2NUM(src_value),
|
228
|
-
RVAL2GST_FORMAT(dest_format), LL2NUM(dest_value));
|
229
|
-
}
|
230
|
-
|
231
|
-
|
232
|
-
static VALUE
|
233
|
-
formats_initialize(VALUE self, VALUE format)
|
234
|
-
{
|
235
|
-
GstQuery *query;
|
236
|
-
|
237
|
-
query = gst_query_new_formats();
|
238
|
-
|
239
|
-
G_INITIALIZE (self, query);
|
240
|
-
return Qnil;
|
241
|
-
}
|
242
|
-
|
243
|
-
static VALUE
|
244
|
-
formats_parse(VALUE self)
|
245
|
-
{
|
246
|
-
VALUE ret;
|
247
|
-
guint n_formats;
|
248
|
-
guint i;
|
249
|
-
|
250
|
-
gst_query_parse_formats_length(RVAL2GST_QUERY(self), &n_formats);
|
251
|
-
ret = rb_ary_new2(n_formats);
|
252
|
-
for (i = 0 ; i< n_formats; i++) {
|
253
|
-
GstFormat format;
|
254
|
-
gst_query_parse_formats_nth(RVAL2GST_QUERY(self), i, &format);
|
255
|
-
rb_ary_push(ret, GST_FORMAT2RVAL(format));
|
256
|
-
}
|
257
|
-
|
258
|
-
return ret;
|
259
|
-
}
|
260
|
-
|
261
|
-
void
|
262
|
-
Init_gst_query (VALUE mGst)
|
263
|
-
{
|
264
|
-
RGConvertTable table;
|
265
|
-
|
266
|
-
memset(&table, 0, sizeof(table));
|
267
|
-
table.type = GST_TYPE_QUERY;
|
268
|
-
table.klass = Qnil;
|
269
|
-
table.get_superclass = get_superclass;
|
270
|
-
table.instance2robj = instance2robj;
|
271
|
-
RG_DEF_CONVERSION(&table);
|
272
|
-
|
273
|
-
rb_cGstQuery = G_DEF_CLASS (GST_TYPE_QUERY, "Query", mGst);
|
274
|
-
|
275
|
-
#define DEFINE_QUERY(type, lctype, arguments) \
|
276
|
-
rb_cGstQuery ## type = \
|
277
|
-
rb_define_class_under(mGst, "Query" #type, rb_cGstQuery); \
|
278
|
-
rbg_define_method(rb_cGstQuery ## type, "initialize", \
|
279
|
-
lctype ## _initialize, arguments); \
|
280
|
-
rbg_define_method(rb_cGstQuery ## type, "parse", \
|
281
|
-
lctype ## _parse, 0) \
|
282
|
-
|
283
|
-
DEFINE_QUERY(Position, position, 1);
|
284
|
-
DEFINE_QUERY(Duration, duration, 1);
|
285
|
-
DEFINE_QUERY(Latency, latency, 0);
|
286
|
-
DEFINE_QUERY(Seeking, seeking, 1);
|
287
|
-
DEFINE_QUERY(Segment, segment, 1);
|
288
|
-
DEFINE_QUERY(Convert, convert, 2);
|
289
|
-
DEFINE_QUERY(Formats, formats, 0);
|
290
|
-
#undef DEFINE_QUERY
|
291
|
-
}
|
data/ext/gstreamer/rbgst-seek.c
DELETED
@@ -1,39 +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 mSeek
|
25
|
-
|
26
|
-
/* Class: Gst::Seek
|
27
|
-
*/
|
28
|
-
|
29
|
-
void
|
30
|
-
Init_gst_seek (VALUE mGst)
|
31
|
-
{
|
32
|
-
VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGst, "Seek");
|
33
|
-
|
34
|
-
G_DEF_CLASS(GST_TYPE_SEEK_TYPE, "SeekType", mGst);
|
35
|
-
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GST_TYPE_SEEK_TYPE, "GST_SEEK_");
|
36
|
-
|
37
|
-
G_DEF_CLASS(GST_TYPE_SEEK_FLAGS, "SeekFlags", mGst);
|
38
|
-
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GST_TYPE_SEEK_FLAGS, "GST_SEEK_");
|
39
|
-
}
|
@@ -1,49 +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 cStaticCaps
|
25
|
-
#define SELF(obj) (RVAL2GST_STATIC_CAPS(obj))
|
26
|
-
|
27
|
-
static VALUE
|
28
|
-
rg_description(VALUE self)
|
29
|
-
{
|
30
|
-
return CSTR2RVAL(SELF(self)->string);
|
31
|
-
}
|
32
|
-
|
33
|
-
static VALUE
|
34
|
-
rg_get(VALUE self)
|
35
|
-
{
|
36
|
-
return GST_CAPS2RVAL(gst_static_caps_get(SELF(self)));
|
37
|
-
}
|
38
|
-
|
39
|
-
void
|
40
|
-
Init_gst_static_caps(VALUE mGst)
|
41
|
-
{
|
42
|
-
VALUE RG_TARGET_NAMESPACE;
|
43
|
-
|
44
|
-
RG_TARGET_NAMESPACE = G_DEF_CLASS(GST_TYPE_STATIC_CAPS, "StaticCaps", mGst);
|
45
|
-
|
46
|
-
RG_DEF_METHOD(description, 0);
|
47
|
-
RG_DEF_METHOD(get, 0);
|
48
|
-
RG_DEF_ALIAS("to_caps", "get");
|
49
|
-
}
|
@@ -1,65 +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
|
-
*
|
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::StaticPadTemplate
|
25
|
-
*/
|
26
|
-
|
27
|
-
#define RG_TARGET_NAMESPACE cStaticPadTemplate
|
28
|
-
#define SELF(self) RVAL2GST_STATIC_PAD_TEMPLATE(self)
|
29
|
-
|
30
|
-
static VALUE
|
31
|
-
rg_name(VALUE self)
|
32
|
-
{
|
33
|
-
return CSTR2RVAL(SELF(self)->name_template);
|
34
|
-
}
|
35
|
-
|
36
|
-
static VALUE
|
37
|
-
rg_presence(VALUE self)
|
38
|
-
{
|
39
|
-
return GENUM2RVAL(SELF(self)->presence, GST_TYPE_PAD_PRESENCE);
|
40
|
-
}
|
41
|
-
|
42
|
-
static VALUE
|
43
|
-
rg_direction(VALUE self)
|
44
|
-
{
|
45
|
-
return GENUM2RVAL(SELF(self)->direction, GST_TYPE_PAD_DIRECTION);
|
46
|
-
}
|
47
|
-
|
48
|
-
static VALUE
|
49
|
-
rg_caps(VALUE self)
|
50
|
-
{
|
51
|
-
return GST_STATIC_CAPS2RVAL(gst_static_pad_template_get_caps(SELF(self)));
|
52
|
-
}
|
53
|
-
|
54
|
-
void
|
55
|
-
Init_gst_static_pad_template (VALUE mGst)
|
56
|
-
{
|
57
|
-
VALUE RG_TARGET_NAMESPACE;
|
58
|
-
|
59
|
-
RG_TARGET_NAMESPACE = G_DEF_CLASS(GST_TYPE_STATIC_PAD_TEMPLATE,
|
60
|
-
"StaticPadTemplate", mGst);
|
61
|
-
RG_DEF_METHOD(name, 0);
|
62
|
-
RG_DEF_METHOD(presence, 0);
|
63
|
-
RG_DEF_METHOD(direction, 0);
|
64
|
-
RG_DEF_METHOD(caps, 0);
|
65
|
-
}
|