gstreamer 3.4.6 → 3.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gst/base-loader.rb +4 -6
- data/lib/gst/controller-loader.rb +4 -6
- data/lib/gst/loader.rb +129 -0
- data/lib/gst.rb +13 -120
- data/sample/mp3parselaunch.rb +1 -1
- data/test/run-test.rb +1 -4
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a073759cb85992427d69583a85e06d15b07677480b3aa255592cba18a751014a
|
4
|
+
data.tar.gz: acf2fcb0c922f4298afe51763b58201775074ea0847bbb1cc52e8fa18b867f75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 495ab1ebbee5566602d06e15be8ffdc8545ee656396cd7d47b796da78098de3e7a948a6886f32a2cf5cdcc3fba681d96da2d76c6837e07fc2890549a2de887a7
|
7
|
+
data.tar.gz: 435f16f3e819ae460d786c6c0fe287d0e127cf25b9a21f8003b537c70549500e7b5154199323398f471b544b4241cef0a51beb9c29d2108681ff8a6559ac0b3b
|
data/lib/gst/base-loader.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2013-
|
1
|
+
# Copyright (C) 2013-2021 Ruby-GNOME Project Team
|
2
2
|
#
|
3
3
|
# This library is free software; you can redistribute it and/or
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -14,12 +14,10 @@
|
|
14
14
|
# License along with this library; if not, write to the Free Software
|
15
15
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
16
|
|
17
|
-
module
|
18
|
-
class
|
19
|
-
NAMESPACE = "GstBase"
|
20
|
-
|
17
|
+
module GstBase
|
18
|
+
class Loader < GObjectIntrospection::Loader
|
21
19
|
def load
|
22
|
-
super(
|
20
|
+
super("GstBase")
|
23
21
|
end
|
24
22
|
end
|
25
23
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2013-
|
1
|
+
# Copyright (C) 2013-2021 Ruby-GNOME Project Team
|
2
2
|
#
|
3
3
|
# This library is free software; you can redistribute it and/or
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -14,12 +14,10 @@
|
|
14
14
|
# License along with this library; if not, write to the Free Software
|
15
15
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
16
|
|
17
|
-
module
|
18
|
-
class
|
19
|
-
NAMESPACE = "GstController"
|
20
|
-
|
17
|
+
module GstController
|
18
|
+
class Loader < GObjectIntrospection::Loader
|
21
19
|
def load
|
22
|
-
super(
|
20
|
+
super("GstController")
|
23
21
|
end
|
24
22
|
end
|
25
23
|
end
|
data/lib/gst/loader.rb
ADDED
@@ -0,0 +1,129 @@
|
|
1
|
+
# Copyright (C) 2013-2021 Ruby-GNOME 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
|
+
module Gst
|
18
|
+
class Loader < GObjectIntrospection::Loader
|
19
|
+
def initialize(base_module, init_arguments)
|
20
|
+
super(base_module)
|
21
|
+
@init_arguments = init_arguments
|
22
|
+
end
|
23
|
+
|
24
|
+
def load
|
25
|
+
super("Gst")
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
def pre_load(repository, namespace)
|
30
|
+
call_init_function(repository, namespace)
|
31
|
+
define_value_modules
|
32
|
+
end
|
33
|
+
|
34
|
+
def call_init_function(repository, namespace)
|
35
|
+
init_check = repository.find(namespace, "init_check")
|
36
|
+
arguments = [
|
37
|
+
[$0] + @init_arguments,
|
38
|
+
]
|
39
|
+
succeeded, argv, error = init_check.invoke(arguments)
|
40
|
+
@init_arguments.replace(argv[1..-1])
|
41
|
+
raise error unless succeeded
|
42
|
+
end
|
43
|
+
|
44
|
+
def define_value_modules
|
45
|
+
@value_functions_module = define_methods_module(:ValueFunctions)
|
46
|
+
@value_methods_module = define_methods_module(:ValueMethods)
|
47
|
+
end
|
48
|
+
|
49
|
+
def post_load(repository, namespace)
|
50
|
+
post_methods_module(@value_functions_module)
|
51
|
+
post_methods_module(@value_methods_module)
|
52
|
+
require_extension
|
53
|
+
require_libraries
|
54
|
+
self.class.start_callback_dispatch_thread
|
55
|
+
end
|
56
|
+
|
57
|
+
def require_extension
|
58
|
+
require "gstreamer.so"
|
59
|
+
end
|
60
|
+
|
61
|
+
def require_libraries
|
62
|
+
require "gst/bin"
|
63
|
+
require "gst/bus"
|
64
|
+
require "gst/caps"
|
65
|
+
require "gst/element"
|
66
|
+
require "gst/element-factory"
|
67
|
+
require "gst/plugin-feature"
|
68
|
+
require "gst/registry"
|
69
|
+
require "gst/structure"
|
70
|
+
require "gst/tag-list"
|
71
|
+
require "gst/type-find-factory"
|
72
|
+
require "gst/version"
|
73
|
+
end
|
74
|
+
|
75
|
+
def load_function_info(info)
|
76
|
+
case info.name
|
77
|
+
when "init"
|
78
|
+
# ignore
|
79
|
+
when /\Avalue_/
|
80
|
+
method_name = $POSTMATCH
|
81
|
+
load_value_function_info(info, method_name)
|
82
|
+
else
|
83
|
+
super
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
def load_value_function_info(info, method_name)
|
88
|
+
value_functions_module = @value_functions_module
|
89
|
+
define_module_function(value_functions_module, method_name, info)
|
90
|
+
@value_methods_module.module_eval do
|
91
|
+
define_method(method_name) do |*arguments, &block|
|
92
|
+
value_functions_module.send(method_name, self, *arguments, &block)
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
def load_method_info(info, klass, method_name)
|
98
|
+
case method_name
|
99
|
+
when "ref", "unref"
|
100
|
+
# Ignore
|
101
|
+
else
|
102
|
+
super
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
RENAME_MAP = {
|
107
|
+
"uri_protocol_is_valid" => "valid_uri_protocol?",
|
108
|
+
"uri_protocol_is_supported" => "supported_uri_protocol?",
|
109
|
+
"uri_is_valid" => "valid_uri?",
|
110
|
+
"uri_has_protocol" => "uri_has_protocol?",
|
111
|
+
}
|
112
|
+
def rubyish_method_name(function_info)
|
113
|
+
RENAME_MAP[function_info.name] || super
|
114
|
+
end
|
115
|
+
|
116
|
+
UNLOCK_GVL_METHODS = {
|
117
|
+
"Gst::Element#set_state" => true,
|
118
|
+
"Gst::Element#get_state" => true,
|
119
|
+
"Gst::Element#query_state" => true,
|
120
|
+
"Gst::Element#send_event" => true,
|
121
|
+
}
|
122
|
+
def prepare_function_info_lock_gvl(function_info, klass)
|
123
|
+
super
|
124
|
+
key = "#{klass}\##{function_info.name}"
|
125
|
+
return unless UNLOCK_GVL_METHODS.key?(key)
|
126
|
+
function_info.lock_gvl_default = false
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
data/lib/gst.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2013-
|
1
|
+
# Copyright (C) 2013-2021 Ruby-GNOME Project Team
|
2
2
|
#
|
3
3
|
# This library is free software; you can redistribute it and/or
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -18,13 +18,17 @@ require "English"
|
|
18
18
|
|
19
19
|
require "gobject-introspection"
|
20
20
|
|
21
|
+
require "gst/loader"
|
22
|
+
require "gst/base-loader"
|
23
|
+
require "gst/controller-loader"
|
24
|
+
|
21
25
|
module Gst
|
22
26
|
LOG_DOMAIN = "GStreamer"
|
23
27
|
GLib::Log.set_log_domain(LOG_DOMAIN)
|
24
28
|
|
25
29
|
class << self
|
26
30
|
def const_missing(name)
|
27
|
-
init
|
31
|
+
init
|
28
32
|
if const_defined?(name)
|
29
33
|
const_get(name)
|
30
34
|
else
|
@@ -33,7 +37,7 @@ module Gst
|
|
33
37
|
end
|
34
38
|
|
35
39
|
def method_missing(name, *args, &block)
|
36
|
-
init
|
40
|
+
init
|
37
41
|
if respond_to?(name)
|
38
42
|
__send__(name, *args, &block)
|
39
43
|
else
|
@@ -55,126 +59,15 @@ module Gst
|
|
55
59
|
|
56
60
|
private
|
57
61
|
def init_base
|
58
|
-
|
59
|
-
|
60
|
-
|
62
|
+
loader = GstBase::Loader.new(GstBase)
|
63
|
+
loader.load
|
64
|
+
Gst.include(GstBase)
|
61
65
|
end
|
62
66
|
|
63
67
|
def init_controller
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
class Loader < GObjectIntrospection::Loader
|
71
|
-
NAMESPACE = "Gst"
|
72
|
-
|
73
|
-
def initialize(base_module, init_arguments)
|
74
|
-
super(base_module)
|
75
|
-
@init_arguments = init_arguments
|
76
|
-
end
|
77
|
-
|
78
|
-
def load
|
79
|
-
super(NAMESPACE)
|
80
|
-
end
|
81
|
-
|
82
|
-
private
|
83
|
-
def pre_load(repository, namespace)
|
84
|
-
call_init_function(repository, namespace)
|
85
|
-
define_value_modules
|
86
|
-
end
|
87
|
-
|
88
|
-
def call_init_function(repository, namespace)
|
89
|
-
init_check = repository.find(namespace, "init_check")
|
90
|
-
arguments = [
|
91
|
-
[$0] + @init_arguments,
|
92
|
-
]
|
93
|
-
succeeded, argv, error = init_check.invoke(arguments)
|
94
|
-
@init_arguments.replace(argv[1..-1])
|
95
|
-
raise error unless succeeded
|
96
|
-
end
|
97
|
-
|
98
|
-
def define_value_modules
|
99
|
-
@value_functions_module = Module.new
|
100
|
-
@value_methods_module = Module.new
|
101
|
-
@base_module.const_set("ValueFunctions", @value_functions_module)
|
102
|
-
@base_module.const_set("ValueMethods", @value_methods_module)
|
103
|
-
end
|
104
|
-
|
105
|
-
def post_load(repository, namespace)
|
106
|
-
require_extension
|
107
|
-
require_libraries
|
108
|
-
self.class.start_callback_dispatch_thread
|
109
|
-
end
|
110
|
-
|
111
|
-
def require_extension
|
112
|
-
require "gstreamer.so"
|
113
|
-
end
|
114
|
-
|
115
|
-
def require_libraries
|
116
|
-
require "gst/bin"
|
117
|
-
require "gst/bus"
|
118
|
-
require "gst/caps"
|
119
|
-
require "gst/element"
|
120
|
-
require "gst/element-factory"
|
121
|
-
require "gst/plugin-feature"
|
122
|
-
require "gst/registry"
|
123
|
-
require "gst/structure"
|
124
|
-
require "gst/tag-list"
|
125
|
-
require "gst/type-find-factory"
|
126
|
-
require "gst/version"
|
127
|
-
end
|
128
|
-
|
129
|
-
def load_function_info(info)
|
130
|
-
case info.name
|
131
|
-
when "init"
|
132
|
-
# ignore
|
133
|
-
when /\Avalue_/
|
134
|
-
method_name = $POSTMATCH
|
135
|
-
load_value_function_info(info, method_name)
|
136
|
-
else
|
137
|
-
super
|
138
|
-
end
|
139
|
-
end
|
140
|
-
|
141
|
-
def load_value_function_info(info, method_name)
|
142
|
-
value_functions_module = @value_functions_module
|
143
|
-
define_module_function(value_functions_module, method_name, info)
|
144
|
-
@value_methods_module.module_eval do
|
145
|
-
define_method(method_name) do |*arguments, &block|
|
146
|
-
value_functions_module.send(method_name, self, *arguments, &block)
|
147
|
-
end
|
148
|
-
end
|
149
|
-
end
|
150
|
-
|
151
|
-
def load_method_info(info, klass, method_name)
|
152
|
-
case method_name
|
153
|
-
when "ref", "unref"
|
154
|
-
# Ignore
|
155
|
-
else
|
156
|
-
super
|
157
|
-
end
|
158
|
-
end
|
159
|
-
|
160
|
-
RENAME_MAP = {
|
161
|
-
"uri_protocol_is_valid" => "valid_uri_protocol?",
|
162
|
-
"uri_protocol_is_supported" => "supported_uri_protocol?",
|
163
|
-
"uri_is_valid" => "valid_uri?",
|
164
|
-
"uri_has_protocol" => "uri_has_protocol?",
|
165
|
-
}
|
166
|
-
def rubyish_method_name(function_info)
|
167
|
-
RENAME_MAP[function_info.name] || super
|
168
|
-
end
|
169
|
-
|
170
|
-
UNLOCK_GVL_METHODS = {
|
171
|
-
"Gst::Element#set_state" => true,
|
172
|
-
"Gst::Element#get_state" => true,
|
173
|
-
"Gst::Element#query_state" => true,
|
174
|
-
"Gst::Element#send_event" => true,
|
175
|
-
}
|
176
|
-
def should_unlock_gvl?(function_info, klass)
|
177
|
-
UNLOCK_GVL_METHODS["#{klass}\##{function_info.name}"] || super
|
68
|
+
loader = GstController::Loader.new(GstController)
|
69
|
+
loader.load
|
70
|
+
Gst.include(GstController)
|
178
71
|
end
|
179
72
|
end
|
180
73
|
end
|
data/sample/mp3parselaunch.rb
CHANGED
@@ -53,7 +53,7 @@ if ARGV.length < 1
|
|
53
53
|
exit(false)
|
54
54
|
end
|
55
55
|
|
56
|
-
bin, error = Gst.parse_launch("filesrc name=my_filesrc !
|
56
|
+
bin, error = Gst.parse_launch("filesrc name=my_filesrc ! avdec_mp3 ! autoaudiosink")
|
57
57
|
if bin.nil?
|
58
58
|
$stderr.puts "Parse error: #{error.message}"
|
59
59
|
exit(false)
|
data/test/run-test.rb
CHANGED
@@ -26,13 +26,10 @@ run_test(__dir__,
|
|
26
26
|
]) do
|
27
27
|
require_relative "gstreamer-test-utils"
|
28
28
|
|
29
|
-
repository = GObjectIntrospection::Repository.default
|
30
29
|
begin
|
31
|
-
|
30
|
+
Gst.init
|
32
31
|
rescue GObjectIntrospection::RepositoryError
|
33
32
|
puts("Omit because typelib file doesn't exist: #{$!.message}")
|
34
33
|
exit(true)
|
35
34
|
end
|
36
|
-
|
37
|
-
Gst.init
|
38
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gstreamer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Ruby-GNOME Project Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gobject-introspection
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.
|
19
|
+
version: 3.5.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 3.
|
26
|
+
version: 3.5.0
|
27
27
|
description: Ruby/GStreamer is a Ruby binding for GStreamer.
|
28
28
|
email: ruby-gnome2-devel-en@lists.sourceforge.net
|
29
29
|
executables: []
|
@@ -49,6 +49,7 @@ files:
|
|
49
49
|
- lib/gst/controller-loader.rb
|
50
50
|
- lib/gst/element-factory.rb
|
51
51
|
- lib/gst/element.rb
|
52
|
+
- lib/gst/loader.rb
|
52
53
|
- lib/gst/plugin-feature.rb
|
53
54
|
- lib/gst/registry.rb
|
54
55
|
- lib/gst/structure.rb
|
@@ -95,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
96
|
- !ruby/object:Gem::Version
|
96
97
|
version: '0'
|
97
98
|
requirements: []
|
98
|
-
rubygems_version: 3.
|
99
|
+
rubygems_version: 3.4.0.dev
|
99
100
|
signing_key:
|
100
101
|
specification_version: 4
|
101
102
|
summary: Ruby/GStreamer is a Ruby binding for GStreamer.
|