gstreamer 1.1.9 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/ext/gstreamer/rbgst-element.c +4 -4
- data/ext/gstreamer/rbgst-event.c +5 -4
- data/ext/gstreamer/rbgst-install-plugins-context.c +5 -3
- data/ext/gstreamer/rbgst-message.c +4 -3
- data/ext/gstreamer/rbgst-mini-object.c +14 -11
- data/ext/gstreamer/rbgst-object.c +5 -5
- data/ext/gstreamer/rbgst-private.h +2 -2
- data/ext/gstreamer/rbgst-query.c +5 -5
- data/ext/gstreamer/rbgst-value.c +32 -26
- data/sample/gst-gi.rb +55 -0
- metadata +10 -9
data/Rakefile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
* Copyright (C) 2011-
|
3
|
+
* Copyright (C) 2011-2013 Ruby-GNOME2 Project Team
|
4
4
|
* Copyright (C) 2007, 2008 Ruby-GNOME2 Project Team
|
5
5
|
* Copyright (C) 2006, 2008 Sjoerd Simons <sjoerd@luon.net>
|
6
6
|
* Copyright (C) 2003, 2004 Laurent Sansonetti <lrz@gnome.org>
|
@@ -81,7 +81,6 @@ typedef struct _ThreadData {
|
|
81
81
|
} data;
|
82
82
|
} ThreadData;
|
83
83
|
|
84
|
-
static RGConvertTable table;
|
85
84
|
static VALUE RG_TARGET_NAMESPACE;
|
86
85
|
static ID id_gtype;
|
87
86
|
static GThreadPool *set_state_thread_pool;
|
@@ -96,7 +95,7 @@ define_class_if_need(VALUE klass, GType type)
|
|
96
95
|
}
|
97
96
|
|
98
97
|
static VALUE
|
99
|
-
instance2robj(gpointer instance)
|
98
|
+
instance2robj(gpointer instance, gpointer user_data)
|
100
99
|
{
|
101
100
|
VALUE klass;
|
102
101
|
GType type;
|
@@ -104,7 +103,7 @@ instance2robj(gpointer instance)
|
|
104
103
|
type = G_TYPE_FROM_INSTANCE(instance);
|
105
104
|
klass = GTYPE2CLASS(type);
|
106
105
|
define_class_if_need(klass, type);
|
107
|
-
return rbgst_object_instance2robj(instance);
|
106
|
+
return rbgst_object_instance2robj(instance, user_data);
|
108
107
|
}
|
109
108
|
|
110
109
|
/* Class: Gst::Element
|
@@ -1027,6 +1026,7 @@ initialize_thread_pool(GThreadPool **pool, GFunc function)
|
|
1027
1026
|
void
|
1028
1027
|
Init_gst_element(VALUE mGst)
|
1029
1028
|
{
|
1029
|
+
RGConvertTable table;
|
1030
1030
|
memset(&table, 0, sizeof(table));
|
1031
1031
|
table.type = GST_TYPE_ELEMENT;
|
1032
1032
|
table.klass = Qnil;
|
data/ext/gstreamer/rbgst-event.c
CHANGED
@@ -27,8 +27,6 @@
|
|
27
27
|
* Events.
|
28
28
|
*/
|
29
29
|
|
30
|
-
static RGConvertTable table = {0};
|
31
|
-
|
32
30
|
static VALUE rb_cGstEvent;
|
33
31
|
static VALUE rb_cGstEventFlushStart;
|
34
32
|
static VALUE rb_cGstEventFlushStop;
|
@@ -42,13 +40,13 @@ static VALUE rb_cGstEventNavigation;
|
|
42
40
|
static VALUE rb_cGstEventLatency;
|
43
41
|
|
44
42
|
static VALUE
|
45
|
-
get_superclass(
|
43
|
+
get_superclass(G_GNUC_UNUSED gpointer user_data)
|
46
44
|
{
|
47
45
|
return rb_cGstMiniObject;
|
48
46
|
}
|
49
47
|
|
50
48
|
static VALUE
|
51
|
-
instance2robj(gpointer instance)
|
49
|
+
instance2robj(gpointer instance, G_GNUC_UNUSED gpointer user_data)
|
52
50
|
{
|
53
51
|
VALUE klass;
|
54
52
|
GstEvent *event;
|
@@ -314,6 +312,9 @@ rbgst_event_get_type(VALUE self)
|
|
314
312
|
void
|
315
313
|
Init_gst_event (VALUE mGst)
|
316
314
|
{
|
315
|
+
RGConvertTable table;
|
316
|
+
|
317
|
+
memset(&table, 0, sizeof(RGConvertTable));
|
317
318
|
table.type = GST_TYPE_EVENT;
|
318
319
|
table.get_superclass = get_superclass;
|
319
320
|
table.instance2robj = instance2robj;
|
@@ -25,11 +25,10 @@
|
|
25
25
|
|
26
26
|
#define RG_TARGET_NAMESPACE cInstallPluginsContext
|
27
27
|
|
28
|
-
static RGConvertTable context_table = {0};
|
29
28
|
static VALUE RG_TARGET_NAMESPACE;
|
30
29
|
|
31
30
|
static VALUE
|
32
|
-
context2robj(gpointer context)
|
31
|
+
context2robj(gpointer context, G_GNUC_UNUSED gpointer user_data)
|
33
32
|
{
|
34
33
|
return Data_Wrap_Struct(RG_TARGET_NAMESPACE, NULL,
|
35
34
|
gst_install_plugins_context_free,
|
@@ -37,7 +36,7 @@ context2robj(gpointer context)
|
|
37
36
|
}
|
38
37
|
|
39
38
|
static gpointer
|
40
|
-
robj2context(VALUE object)
|
39
|
+
robj2context(VALUE object, G_GNUC_UNUSED gpointer user_data)
|
41
40
|
{
|
42
41
|
gpointer instance;
|
43
42
|
|
@@ -71,6 +70,9 @@ rg_set_xid(VALUE self, VALUE xid)
|
|
71
70
|
void
|
72
71
|
Init_gst_install_plugins_context(VALUE mGst)
|
73
72
|
{
|
73
|
+
RGConvertTable context_table;
|
74
|
+
|
75
|
+
memset(&context_table, 0, sizeof(RGConvertTable));
|
74
76
|
context_table.type = GST_TYPE_INSTALL_PLUGINS_CONTEXT;
|
75
77
|
context_table.instance2robj = context2robj;
|
76
78
|
context_table.robj2instance = robj2context;
|
@@ -32,7 +32,6 @@
|
|
32
32
|
#define RVAL2GST_MSG_TYPE(type) RVAL2GFLAGS(type, GST_TYPE_MESSAGE_TYPE)
|
33
33
|
#define GST_MSG_TYPE2RVAL(type) GFLAGS2RVAL(type, GST_TYPE_MESSAGE_TYPE)
|
34
34
|
|
35
|
-
static RGConvertTable table = {0};
|
36
35
|
static VALUE rb_cGstMessage;
|
37
36
|
static VALUE rb_cGstMessageUnknown;
|
38
37
|
static VALUE rb_cGstMessageEos;
|
@@ -64,13 +63,13 @@ static VALUE rb_cGstMissingURISourceMessage;
|
|
64
63
|
#endif
|
65
64
|
|
66
65
|
static VALUE
|
67
|
-
get_superclass(
|
66
|
+
get_superclass(G_GNUC_UNUSED gpointer user_data)
|
68
67
|
{
|
69
68
|
return rb_cGstMiniObject;
|
70
69
|
}
|
71
70
|
|
72
71
|
static VALUE
|
73
|
-
instance2robj(gpointer instance)
|
72
|
+
instance2robj(gpointer instance, G_GNUC_UNUSED gpointer user_data)
|
74
73
|
{
|
75
74
|
VALUE klass;
|
76
75
|
GstMessage *message;
|
@@ -623,7 +622,9 @@ void
|
|
623
622
|
Init_gst_message(VALUE mGst)
|
624
623
|
{
|
625
624
|
VALUE rb_cGstMessageType;
|
625
|
+
RGConvertTable table;
|
626
626
|
|
627
|
+
memset(&table, 0, sizeof(RGConvertTable));
|
627
628
|
table.type = GST_TYPE_MESSAGE;
|
628
629
|
table.get_superclass = get_superclass;
|
629
630
|
table.instance2robj = instance2robj;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
3
|
+
* Copyright (C) 2011-2013 Ruby-GNOME2 Project Team
|
4
4
|
* Copyright (C) 2007 Ruby-GNOME2 Project Team
|
5
5
|
*
|
6
6
|
* This library is free software; you can redistribute it and/or
|
@@ -34,8 +34,6 @@
|
|
34
34
|
|
35
35
|
VALUE RG_TARGET_NAMESPACE;
|
36
36
|
|
37
|
-
static RGConvertTable table = {0};
|
38
|
-
|
39
37
|
void
|
40
38
|
_rbgst_mini_object_free(void *ptr)
|
41
39
|
{
|
@@ -45,7 +43,7 @@ _rbgst_mini_object_free(void *ptr)
|
|
45
43
|
}
|
46
44
|
|
47
45
|
static VALUE
|
48
|
-
rbgst_mini_object_get_superclass(
|
46
|
+
rbgst_mini_object_get_superclass(G_GNUC_UNUSED gpointer user_data)
|
49
47
|
{
|
50
48
|
return rb_cObject;
|
51
49
|
}
|
@@ -62,7 +60,7 @@ initialize_with_abstract_check(int argc, VALUE *argv, VALUE self)
|
|
62
60
|
}
|
63
61
|
|
64
62
|
static void
|
65
|
-
rbgst_mini_object_type_init_hook(VALUE klass)
|
63
|
+
rbgst_mini_object_type_init_hook(VALUE klass, G_GNUC_UNUSED gpointer user_data)
|
66
64
|
{
|
67
65
|
if (G_TYPE_IS_ABSTRACT(CLASS2GTYPE(klass)))
|
68
66
|
rbg_define_method(klass, "initialize",
|
@@ -70,7 +68,7 @@ rbgst_mini_object_type_init_hook(VALUE klass)
|
|
70
68
|
}
|
71
69
|
|
72
70
|
static VALUE
|
73
|
-
gvalue2rvalue(const GValue *value)
|
71
|
+
gvalue2rvalue(const GValue *value, G_GNUC_UNUSED gpointer user_data)
|
74
72
|
{
|
75
73
|
GstMiniObject* obj;
|
76
74
|
obj = gst_value_get_mini_object(value);
|
@@ -78,19 +76,20 @@ gvalue2rvalue(const GValue *value)
|
|
78
76
|
}
|
79
77
|
|
80
78
|
static void
|
81
|
-
rvalue2gvalue(VALUE value, GValue *result)
|
79
|
+
rvalue2gvalue(VALUE value, GValue *result, G_GNUC_UNUSED gpointer user_data)
|
82
80
|
{
|
83
81
|
gst_value_set_mini_object(result, NIL_P(value) ? NULL : RVAL2GOBJ(value));
|
84
82
|
}
|
85
83
|
|
86
84
|
static void
|
87
|
-
rbgst_mini_object_initialize(VALUE object, gpointer instance
|
85
|
+
rbgst_mini_object_initialize(VALUE object, gpointer instance,
|
86
|
+
G_GNUC_UNUSED gpointer user_data)
|
88
87
|
{
|
89
88
|
DATA_PTR(object) = instance;
|
90
89
|
}
|
91
90
|
|
92
91
|
static gpointer
|
93
|
-
rbgst_mini_object_robj2instance(VALUE object)
|
92
|
+
rbgst_mini_object_robj2instance(VALUE object, G_GNUC_UNUSED gpointer user_data)
|
94
93
|
{
|
95
94
|
gpointer instance;
|
96
95
|
|
@@ -108,7 +107,8 @@ rbgst_mini_object_define_class_if_need(VALUE klass, GType type)
|
|
108
107
|
}
|
109
108
|
|
110
109
|
static VALUE
|
111
|
-
rbgst_mini_object_instance2robj(gpointer instance
|
110
|
+
rbgst_mini_object_instance2robj(gpointer instance,
|
111
|
+
G_GNUC_UNUSED gpointer user_data)
|
112
112
|
{
|
113
113
|
VALUE klass;
|
114
114
|
GType type;
|
@@ -121,7 +121,7 @@ rbgst_mini_object_instance2robj(gpointer instance)
|
|
121
121
|
}
|
122
122
|
|
123
123
|
static void
|
124
|
-
rbgst_mini_object_unref(gpointer instance)
|
124
|
+
rbgst_mini_object_unref(gpointer instance, G_GNUC_UNUSED gpointer user_data)
|
125
125
|
{
|
126
126
|
gst_mini_object_unref(instance);
|
127
127
|
}
|
@@ -188,6 +188,9 @@ rg_writable_bang(VALUE self)
|
|
188
188
|
void
|
189
189
|
Init_gst_mini_object(VALUE mGst)
|
190
190
|
{
|
191
|
+
RGConvertTable table;
|
192
|
+
|
193
|
+
memset(&table, 0, sizeof(RGConvertTable));
|
191
194
|
table.type = GST_TYPE_MINI_OBJECT;
|
192
195
|
table.get_superclass = rbgst_mini_object_get_superclass;
|
193
196
|
table.type_init_hook = rbgst_mini_object_type_init_hook;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
3
|
+
* Copyright (C) 2011-2013 Ruby-GNOME2 Project Team
|
4
4
|
* Copyright (C) 2007 Ruby-GNOME2 Project Team
|
5
5
|
* Copyright (C) 2003, 2004 Laurent Sansonetti <lrz@gnome.org>
|
6
6
|
*
|
@@ -25,14 +25,12 @@
|
|
25
25
|
#define RG_TARGET_NAMESPACE cObject
|
26
26
|
#define SELF(self) (RVAL2GST_OBJ(self))
|
27
27
|
|
28
|
-
static RGConvertTable table;
|
29
|
-
|
30
28
|
/* Class: Gst::Object
|
31
29
|
* Basis for the GST object hierarchy.
|
32
30
|
*/
|
33
31
|
|
34
32
|
VALUE
|
35
|
-
rbgst_object_instance2robj(gpointer instance)
|
33
|
+
rbgst_object_instance2robj(gpointer instance, G_GNUC_UNUSED gpointer user_data)
|
36
34
|
{
|
37
35
|
if (GST_OBJECT_IS_FLOATING(instance)) {
|
38
36
|
gst_object_ref(instance);
|
@@ -43,7 +41,8 @@ rbgst_object_instance2robj(gpointer instance)
|
|
43
41
|
}
|
44
42
|
|
45
43
|
static void
|
46
|
-
rbgst_object_initialize(VALUE obj, gpointer cobj
|
44
|
+
rbgst_object_initialize(VALUE obj, gpointer cobj,
|
45
|
+
G_GNUC_UNUSED gpointer user_data)
|
47
46
|
{
|
48
47
|
if (GST_OBJECT_IS_FLOATING(cobj)) {
|
49
48
|
gst_object_ref(cobj);
|
@@ -63,6 +62,7 @@ void
|
|
63
62
|
Init_gst_object(VALUE mGst)
|
64
63
|
{
|
65
64
|
VALUE RG_TARGET_NAMESPACE;
|
65
|
+
RGConvertTable table;
|
66
66
|
|
67
67
|
memset(&table, 0, sizeof(table));
|
68
68
|
table.type = GST_TYPE_OBJECT;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
* Copyright (C) 2011-
|
3
|
+
* Copyright (C) 2011-2013 Ruby-GNOME2 Project Team
|
4
4
|
* Copyright (C) 2008 Ruby-GNOME2 Project
|
5
5
|
*
|
6
6
|
* This library is free software; you can redistribute it and/or
|
@@ -35,7 +35,7 @@ VALUE _rbgst_collect_elements(GstIterator *iter);
|
|
35
35
|
void _rbgst_mini_object_free(void *ptr);
|
36
36
|
|
37
37
|
/* implemented in rbgst-object.c */
|
38
|
-
VALUE rbgst_object_instance2robj(gpointer instance);
|
38
|
+
VALUE rbgst_object_instance2robj(gpointer instance, gpointer user_data);
|
39
39
|
|
40
40
|
|
41
41
|
G_GNUC_INTERNAL void Init_gst_bin (VALUE mGst);
|
data/ext/gstreamer/rbgst-query.c
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
* Copyright (C) 2011-
|
3
|
+
* Copyright (C) 2011-2013 Ruby-GNOME2 Project Team
|
4
4
|
* Copyright (C) 2007 Ruby-GNOME2 Project Team
|
5
5
|
* Copyright (C) 2006 Sjoerd Simons <sjoerd@luon.net>
|
6
6
|
* Copyright (C) 2006 Zaheer Abbas Merali <zaheerabbas at merali dot org>
|
@@ -28,8 +28,6 @@
|
|
28
28
|
* Queries.
|
29
29
|
*/
|
30
30
|
|
31
|
-
static RGConvertTable table;
|
32
|
-
|
33
31
|
static VALUE rb_cGstQueryPosition;
|
34
32
|
static VALUE rb_cGstQueryDuration;
|
35
33
|
static VALUE rb_cGstQueryLatency;
|
@@ -40,13 +38,13 @@ static VALUE rb_cGstQueryFormats;
|
|
40
38
|
static VALUE rb_cGstQuery;
|
41
39
|
|
42
40
|
static VALUE
|
43
|
-
get_superclass(
|
41
|
+
get_superclass(G_GNUC_UNUSED gpointer user_data)
|
44
42
|
{
|
45
43
|
return rb_cGstMiniObject;
|
46
44
|
}
|
47
45
|
|
48
46
|
static VALUE
|
49
|
-
instance2robj(gpointer instance)
|
47
|
+
instance2robj(gpointer instance, G_GNUC_UNUSED gpointer user_data)
|
50
48
|
{
|
51
49
|
VALUE klass;
|
52
50
|
GstQuery *query;
|
@@ -263,6 +261,8 @@ formats_parse(VALUE self)
|
|
263
261
|
void
|
264
262
|
Init_gst_query (VALUE mGst)
|
265
263
|
{
|
264
|
+
RGConvertTable table;
|
265
|
+
|
266
266
|
memset(&table, 0, sizeof(table));
|
267
267
|
table.type = GST_TYPE_QUERY;
|
268
268
|
table.klass = Qnil;
|
data/ext/gstreamer/rbgst-value.c
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
* Copyright (C) 2011-
|
3
|
+
* Copyright (C) 2011-2013 Ruby-GNOME2 Project Team
|
4
4
|
* Copyright (C) 2008 Ruby-GNOME2 Project Team
|
5
5
|
*
|
6
6
|
* This library is free software; you can redistribute it and/or
|
@@ -23,16 +23,9 @@
|
|
23
23
|
|
24
24
|
static VALUE cIntRange, cFourcc, cFractionRange;
|
25
25
|
|
26
|
-
static RGConvertTable value_list_table;
|
27
|
-
static RGConvertTable value_array_table;
|
28
|
-
static RGConvertTable int_range_table;
|
29
|
-
static RGConvertTable fourcc_table;
|
30
|
-
static RGConvertTable fraction_table;
|
31
|
-
static RGConvertTable fraction_range_table;
|
32
|
-
|
33
|
-
|
34
26
|
static void
|
35
|
-
value_list_rvalue2gvalue(VALUE value, GValue *result
|
27
|
+
value_list_rvalue2gvalue(VALUE value, GValue *result,
|
28
|
+
G_GNUC_UNUSED gpointer user_data)
|
36
29
|
{
|
37
30
|
guint i, len;
|
38
31
|
|
@@ -46,7 +39,7 @@ value_list_rvalue2gvalue(VALUE value, GValue *result)
|
|
46
39
|
}
|
47
40
|
|
48
41
|
static VALUE
|
49
|
-
value_list_gvalue2rvalue(const GValue *value)
|
42
|
+
value_list_gvalue2rvalue(const GValue *value, G_GNUC_UNUSED gpointer user_data)
|
50
43
|
{
|
51
44
|
guint i, len;
|
52
45
|
VALUE result;
|
@@ -62,7 +55,8 @@ value_list_gvalue2rvalue(const GValue *value)
|
|
62
55
|
|
63
56
|
|
64
57
|
static void
|
65
|
-
value_array_rvalue2gvalue(VALUE value, GValue *result
|
58
|
+
value_array_rvalue2gvalue(VALUE value, GValue *result,
|
59
|
+
G_GNUC_UNUSED gpointer user_data)
|
66
60
|
{
|
67
61
|
guint i, len;
|
68
62
|
|
@@ -76,7 +70,7 @@ value_array_rvalue2gvalue(VALUE value, GValue *result)
|
|
76
70
|
}
|
77
71
|
|
78
72
|
static VALUE
|
79
|
-
value_array_gvalue2rvalue(const GValue *value)
|
73
|
+
value_array_gvalue2rvalue(const GValue *value, G_GNUC_UNUSED gpointer user_data)
|
80
74
|
{
|
81
75
|
guint i, len;
|
82
76
|
VALUE result;
|
@@ -113,7 +107,7 @@ g_value_free(gpointer instance)
|
|
113
107
|
}
|
114
108
|
|
115
109
|
static VALUE
|
116
|
-
g_value_to_ruby_value(const GValue *value)
|
110
|
+
g_value_to_ruby_value(const GValue *value, G_GNUC_UNUSED gpointer user_data)
|
117
111
|
{
|
118
112
|
VALUE klass;
|
119
113
|
GType type;
|
@@ -127,20 +121,21 @@ g_value_to_ruby_value(const GValue *value)
|
|
127
121
|
}
|
128
122
|
|
129
123
|
static VALUE
|
130
|
-
g_value_type_instance_to_ruby_object(gpointer instance)
|
124
|
+
g_value_type_instance_to_ruby_object(gpointer instance, gpointer user_data)
|
131
125
|
{
|
132
|
-
return g_value_to_ruby_value(instance);
|
126
|
+
return g_value_to_ruby_value(instance, user_data);
|
133
127
|
}
|
134
128
|
|
135
129
|
static void
|
136
|
-
g_value_type_unref(gpointer instance)
|
130
|
+
g_value_type_unref(gpointer instance, G_GNUC_UNUSED gpointer user_data)
|
137
131
|
{
|
138
132
|
g_value_unset(instance);
|
139
133
|
}
|
140
134
|
|
141
135
|
#define DEF_G_VALUE_CONVERTERS(prefix, g_type, type) \
|
142
136
|
static gpointer \
|
143
|
-
prefix ## _robj2instance(VALUE object
|
137
|
+
prefix ## _robj2instance(VALUE object, \
|
138
|
+
G_GNUC_UNUSED gpointer user_data) \
|
144
139
|
{ \
|
145
140
|
gpointer instance; \
|
146
141
|
\
|
@@ -228,13 +223,14 @@ int_range_to_a(VALUE self)
|
|
228
223
|
}
|
229
224
|
|
230
225
|
static VALUE
|
231
|
-
int_range_get_superclass(
|
226
|
+
int_range_get_superclass(G_GNUC_UNUSED gpointer user_data)
|
232
227
|
{
|
233
228
|
return rb_cObject;
|
234
229
|
}
|
235
230
|
|
236
231
|
static void
|
237
|
-
int_range_rvalue2gvalue(VALUE value, GValue *result
|
232
|
+
int_range_rvalue2gvalue(VALUE value, GValue *result,
|
233
|
+
G_GNUC_UNUSED gpointer user_data)
|
238
234
|
{
|
239
235
|
GValue *val;
|
240
236
|
|
@@ -248,13 +244,14 @@ DEF_G_VALUE_CONVERTERS(int_range, GST_TYPE_INT_RANGE, IntRange)
|
|
248
244
|
|
249
245
|
|
250
246
|
static VALUE
|
251
|
-
fourcc_get_superclass(
|
247
|
+
fourcc_get_superclass(G_GNUC_UNUSED gpointer user_data)
|
252
248
|
{
|
253
249
|
return rb_cObject;
|
254
250
|
}
|
255
251
|
|
256
252
|
static void
|
257
|
-
fourcc_rvalue2gvalue(VALUE value, GValue *result
|
253
|
+
fourcc_rvalue2gvalue(VALUE value, GValue *result,
|
254
|
+
G_GNUC_UNUSED gpointer user_data)
|
258
255
|
{
|
259
256
|
gst_value_set_fourcc(result,
|
260
257
|
gst_value_get_fourcc(RVAL2GOBJ(value)));
|
@@ -294,7 +291,8 @@ fourcc_to_i(VALUE self)
|
|
294
291
|
|
295
292
|
|
296
293
|
static void
|
297
|
-
fraction_rvalue2gvalue(VALUE value, GValue *result
|
294
|
+
fraction_rvalue2gvalue(VALUE value, GValue *result,
|
295
|
+
G_GNUC_UNUSED gpointer user_data)
|
298
296
|
{
|
299
297
|
gst_value_set_fraction(result,
|
300
298
|
NUM2INT(rb_funcall(value, rb_intern("numerator"), 0)),
|
@@ -303,7 +301,7 @@ fraction_rvalue2gvalue(VALUE value, GValue *result)
|
|
303
301
|
}
|
304
302
|
|
305
303
|
static VALUE
|
306
|
-
fraction_gvalue2rvalue(const GValue *value)
|
304
|
+
fraction_gvalue2rvalue(const GValue *value, G_GNUC_UNUSED gpointer user_data)
|
307
305
|
{
|
308
306
|
return rb_funcall(Qnil, rb_intern("Rational"), 2,
|
309
307
|
INT2NUM(gst_value_get_fraction_numerator(value)),
|
@@ -385,13 +383,14 @@ fraction_range_to_a(VALUE self)
|
|
385
383
|
}
|
386
384
|
|
387
385
|
static VALUE
|
388
|
-
fraction_range_get_superclass(
|
386
|
+
fraction_range_get_superclass(G_GNUC_UNUSED gpointer user_data)
|
389
387
|
{
|
390
388
|
return rb_cObject;
|
391
389
|
}
|
392
390
|
|
393
391
|
static void
|
394
|
-
fraction_range_rvalue2gvalue(VALUE value, GValue *result
|
392
|
+
fraction_range_rvalue2gvalue(VALUE value, GValue *result,
|
393
|
+
G_GNUC_UNUSED gpointer user_data)
|
395
394
|
{
|
396
395
|
GValue *val;
|
397
396
|
|
@@ -407,6 +406,13 @@ DEF_G_VALUE_CONVERTERS(fraction_range, GST_TYPE_FRACTION_RANGE, FractionRange)
|
|
407
406
|
void
|
408
407
|
Init_gst_value(VALUE mGst)
|
409
408
|
{
|
409
|
+
RGConvertTable value_list_table;
|
410
|
+
RGConvertTable value_array_table;
|
411
|
+
RGConvertTable int_range_table;
|
412
|
+
RGConvertTable fourcc_table;
|
413
|
+
RGConvertTable fraction_table;
|
414
|
+
RGConvertTable fraction_range_table;
|
415
|
+
|
410
416
|
memset(&value_list_table, 0, sizeof(value_list_table));
|
411
417
|
value_list_table.type = GST_TYPE_LIST;
|
412
418
|
value_list_table.klass = Qnil;
|
data/sample/gst-gi.rb
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
# Copyright (C) 2013 Ruby-GNOME2 Project Team
|
2
|
+
#
|
3
|
+
# This library is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU Lesser General Public
|
5
|
+
# License as published by the Free Software Foundation; either
|
6
|
+
# version 2.1 of the License, or (at your option) any later version.
|
7
|
+
#
|
8
|
+
# This library is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
11
|
+
# Lesser General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU Lesser General Public
|
14
|
+
# License along with this library; if not, write to the Free Software
|
15
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
|
+
|
17
|
+
require "gobject-introspection"
|
18
|
+
|
19
|
+
base_dir = Pathname.new(__FILE__).dirname.dirname.dirname.expand_path
|
20
|
+
vendor_dir = base_dir + "vendor" + "local"
|
21
|
+
vendor_bin_dir = vendor_dir + "bin"
|
22
|
+
GLib.prepend_environment_path(vendor_bin_dir)
|
23
|
+
|
24
|
+
module Gst
|
25
|
+
LOG_DOMAIN = "GStreamer"
|
26
|
+
GLib::Log.set_log_domain(LOG_DOMAIN)
|
27
|
+
|
28
|
+
class << self
|
29
|
+
@initialized = false
|
30
|
+
def init(argv=ARGV)
|
31
|
+
return if @initialized
|
32
|
+
@initialized = true
|
33
|
+
loader = Loader.new(self, argv)
|
34
|
+
loader.load("Gst")
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
class Loader < GObjectIntrospection::Loader
|
39
|
+
def initialize(base_module, init_arguments)
|
40
|
+
super(base_module)
|
41
|
+
@init_arguments = init_arguments
|
42
|
+
end
|
43
|
+
|
44
|
+
private
|
45
|
+
def pre_load(repository, namespace)
|
46
|
+
init = repository.find(namespace, "init")
|
47
|
+
argc, argv = init.invoke(1 + @init_arguments.size,
|
48
|
+
[$0] + @init_arguments)
|
49
|
+
@init_arguments.replace(argv)
|
50
|
+
end
|
51
|
+
|
52
|
+
def post_load(repository, namespace)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gstreamer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 1.
|
8
|
+
- 2
|
9
|
+
- 0
|
10
|
+
version: 1.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- The Ruby-GNOME2 Project Team
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2013-01-24 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: glib2
|
@@ -25,12 +25,12 @@ dependencies:
|
|
25
25
|
requirements:
|
26
26
|
- - ">="
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
hash:
|
28
|
+
hash: 31
|
29
29
|
segments:
|
30
30
|
- 1
|
31
|
-
-
|
32
|
-
-
|
33
|
-
version: 1.
|
31
|
+
- 2
|
32
|
+
- 0
|
33
|
+
version: 1.2.0
|
34
34
|
type: :runtime
|
35
35
|
version_requirements: *id001
|
36
36
|
description: Ruby/GStreamer is a Ruby binding for GStreamer.
|
@@ -95,6 +95,7 @@ files:
|
|
95
95
|
- ext/gstreamer/rbgst-element.c
|
96
96
|
- ext/gstreamer/rbgst-value.c
|
97
97
|
- sample/media-type.rb
|
98
|
+
- sample/gst-gi.rb
|
98
99
|
- sample/audio-player.rb
|
99
100
|
- sample/install-plugins.rb
|
100
101
|
- sample/xml-player.rb
|