gstreamer 3.3.8 → 3.3.9

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 83b300391904d49432f8a2ea83a08a9565331869eb3fb6f3c3fc0950b6e6f2a4
4
- data.tar.gz: 01b8f952ec98a455cf3ec450d345220045e4f2711857d4a10ac57ca0b16ab4ec
3
+ metadata.gz: 8044cab276a50e82aa764d63f254b22a53b55006858dce0aaea544747d69411b
4
+ data.tar.gz: febe2a0c9a1651062c1740bcf3e5c009968f9cfd6454ee17a77abc9221c3af56
5
5
  SHA512:
6
- metadata.gz: 54f5fdbf90373f9cb0e0b67f26109a029f507295f4c364a19d664e6681b251e0958c4c782efee64efe55d5d36f8005166461b6d043821fe8fa81361b878ffeb9
7
- data.tar.gz: 8bf217e20559dac1cbfcd7fac6ab48e04c74565a5a2146cec038ee30a9ea050633813df52c8cf63f274d0a1bbfaab3d3c04139e014b43c144a193c911715e3b3
6
+ metadata.gz: ae2ca3799d8e37060f1cd135535f3dc85d8481892be2797895e98e7b43246f98444d37669f5cdb854ec933fa81afdcd23418d1cf1243e0d6748dc7d89391e307
7
+ data.tar.gz: 11e14fbd2805de35e3d9413a9f65dd2606563bd251ed5d19f7a51a49430b1de09753955439836021b9003730c4462846c81b8fa3ac14ab0af5322ff4db7fcc17
@@ -1,6 +1,20 @@
1
- =begin
2
- extconf.rb for Ruby/GStreamer extention library
3
- =end
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Copyright (C) 2003-2019 Ruby-GNOME Project Team
4
+ #
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation; either
8
+ # version 2.1 of the License, or (at your option) any later version.
9
+ #
10
+ # This library is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ # Lesser General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Lesser General Public
16
+ # License along with this library; if not, write to the Free Software
17
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
4
18
 
5
19
  require 'pathname'
6
20
 
@@ -22,13 +36,7 @@ $LOAD_PATH.unshift(mkmf_gnome2_dir.to_s)
22
36
  module_name = "gstreamer"
23
37
  package_id = "gstreamer-1.0"
24
38
 
25
- begin
26
- require 'mkmf-gnome2'
27
- rescue LoadError
28
- require 'rubygems'
29
- gem 'glib2'
30
- require 'mkmf-gnome2'
31
- end
39
+ require "mkmf-gnome"
32
40
 
33
41
  ["glib2", "gobject-introspection"].each do |package|
34
42
  directory = "#{package}#{version_suffix}"
@@ -44,7 +52,7 @@ end
44
52
  unless required_pkg_config_package(package_id,
45
53
  :alt_linux => "gstreamer1.0-devel",
46
54
  :debian => "libgstreamer1.0-dev",
47
- :redhat => "gstreamer1-devel",
55
+ :redhat => "pkgconfig(#{package_id})",
48
56
  :arch_linux => "gstreamer",
49
57
  :homebrew => "gstreamer",
50
58
  :macports => "gstreamer",
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2013-2018 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2013-2019 Ruby-GNOME Project Team
4
4
  *
5
5
  * This library is free software; you can redistribute it and/or
6
6
  * modify it under the terms of the GNU Lesser General Public
@@ -20,115 +20,6 @@
20
20
 
21
21
  #include "rbgst.h"
22
22
 
23
- static gboolean
24
- name_equal(GIArgInfo *info, const gchar *target_name)
25
- {
26
- GITypeInfo type_info;
27
- GIBaseInfo *interface_info;
28
- const gchar *namespace;
29
- const gchar *name;
30
- gboolean equal_name_p = FALSE;
31
-
32
- g_arg_info_load_type(info, &type_info);
33
- interface_info = g_type_info_get_interface(&type_info);
34
- namespace = g_base_info_get_namespace(interface_info);
35
- name = g_base_info_get_name(interface_info);
36
- if (strcmp(namespace, "Gst") == 0 && strcmp(name, target_name) == 0) {
37
- equal_name_p = TRUE;
38
- }
39
- g_base_info_unref(interface_info);
40
-
41
- return equal_name_p;
42
- }
43
-
44
- static gboolean
45
- rg_gst_bus_func_callback(GstBus *bus, GstMessage *message, gpointer user_data)
46
- {
47
- RBGICallbackData *callback_data = user_data;
48
- VALUE rb_keep;
49
- ID id_call;
50
-
51
- CONST_ID(id_call, "call");
52
- rb_keep = rb_funcall(rb_gi_callback_data_get_rb_callback(callback_data),
53
- id_call, 2,
54
- GOBJ2RVAL(bus),
55
- BOXED2RVAL(message, GST_MINI_OBJECT_TYPE(message)));
56
- if (rb_gi_callback_data_get_metadata(callback_data)->scope_type == GI_SCOPE_TYPE_ASYNC) {
57
- rb_gi_callback_data_free(callback_data);
58
- }
59
- return RVAL2CBOOL(rb_keep);
60
- }
61
-
62
- static gpointer
63
- rg_gst_bus_func_callback_finder(GIArgInfo *info)
64
- {
65
- if (!name_equal(info, "BusFunc")) {
66
- return NULL;
67
- }
68
- return rg_gst_bus_func_callback;
69
- }
70
-
71
- static gboolean
72
- rg_gst_bus_sync_handler_callback(GstBus *bus, GstMessage *message,
73
- gpointer user_data)
74
- {
75
- RBGICallbackData *callback_data = user_data;
76
- VALUE rb_bus_sync_reply;
77
- ID id_call;
78
-
79
- CONST_ID(id_call, "call");
80
- rb_bus_sync_reply =
81
- rb_funcall(rb_gi_callback_data_get_rb_callback(callback_data),
82
- id_call, 2,
83
- GOBJ2RVAL(bus),
84
- BOXED2RVAL(message, GST_MINI_OBJECT_TYPE(message)));
85
- if (rb_gi_callback_data_get_metadata(callback_data)->scope_type == GI_SCOPE_TYPE_ASYNC) {
86
- rb_gi_callback_data_free(callback_data);
87
- }
88
- return RVAL2GENUM(rb_bus_sync_reply, GST_TYPE_BUS_SYNC_REPLY);
89
- }
90
-
91
- static gpointer
92
- rg_gst_bus_sync_handler_callback_finder(GIArgInfo *info)
93
- {
94
- if (!name_equal(info, "BusSyncHandler")) {
95
- return NULL;
96
- }
97
- return rg_gst_bus_sync_handler_callback;
98
- }
99
-
100
- static void
101
- rg_gst_tag_foreach_func_callback(const GstTagList *list, const gchar *tag,
102
- gpointer user_data)
103
- {
104
- RBGICallbackData *callback_data = user_data;
105
- ID id_call;
106
-
107
- CONST_ID(id_call, "call");
108
- rb_funcall(rb_gi_callback_data_get_rb_callback(callback_data),
109
- id_call, 2,
110
- /*
111
- * XXX: Use gst_tag_list_copy() instead if we don't trust
112
- * users. Users should not use destructive methods such as
113
- * #insert. If many users use these methods, we shuold use
114
- * gst_tag_list_copy().
115
- */
116
- BOXED2RVAL((GstTagList *)list, GST_MINI_OBJECT_TYPE(list)),
117
- CSTR2RVAL(tag));
118
- if (rb_gi_callback_data_get_metadata(callback_data)->scope_type == GI_SCOPE_TYPE_ASYNC) {
119
- rb_gi_callback_data_free(callback_data);
120
- }
121
- }
122
-
123
- static gpointer
124
- rg_gst_tag_foreach_func_callback_finder(GIArgInfo *info)
125
- {
126
- if (!name_equal(info, "TagForeachFunc")) {
127
- return NULL;
128
- }
129
- return rg_gst_tag_foreach_func_callback;
130
- }
131
-
132
23
  static void
133
24
  rg_gst_value_list_r2g(VALUE from, GValue *to)
134
25
  {
@@ -176,10 +67,6 @@ rg_gst_value_list_g2r(const GValue *from)
176
67
  void
177
68
  Init_gstreamer (void)
178
69
  {
179
- rb_gi_callback_register_finder(rg_gst_bus_func_callback_finder);
180
- rb_gi_callback_register_finder(rg_gst_bus_sync_handler_callback_finder);
181
- rb_gi_callback_register_finder(rg_gst_tag_foreach_func_callback_finder);
182
-
183
70
  rbgobj_register_r2g_func(GST_TYPE_LIST, rg_gst_value_list_r2g);
184
71
  rbgobj_register_g2r_func(GST_TYPE_LIST, rg_gst_value_list_g2r);
185
72
 
data/lib/gst.rb CHANGED
@@ -121,6 +121,7 @@ module Gst
121
121
  require "gst/plugin-feature"
122
122
  require "gst/registry"
123
123
  require "gst/structure"
124
+ require "gst/tag-list"
124
125
  require "gst/type-find-factory"
125
126
  require "gst/version"
126
127
  end
@@ -0,0 +1,32 @@
1
+ # Copyright (C) 2019 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 TagList
19
+ include Enumerable
20
+
21
+ alias_method :each_raw, :each
22
+ def each
23
+ each_raw do |_tag_list, tag|
24
+ n_values = get_tag_size(tag)
25
+ values = n_values.times.collect do |i|
26
+ get_value_index(tag, i).value
27
+ end
28
+ yield(tag, values)
29
+ end
30
+ end
31
+ end
32
+ end
@@ -100,7 +100,7 @@ end
100
100
  bin.play
101
101
 
102
102
  # run event loop listening for bus messages until EOS or ERROR
103
- event_loop(bus, bin)
103
+ event_loop(bin.bus, bin)
104
104
 
105
105
  # stop the bin
106
106
  bin.stop
@@ -0,0 +1,41 @@
1
+ # Copyright (C) 2019 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
+ class TestBus < Test::Unit::TestCase
18
+ def setup
19
+ @pipeline = Gst::Pipeline.new("my-pipeline")
20
+ @source = Gst::ElementFactory.make("fakesrc", "source")
21
+ @filter = Gst::ElementFactory.make("identity", "filter")
22
+ @sink = Gst::ElementFactory.make("fakesink", "sink")
23
+ @pipeline.add_elements(@source, @filter, @sink)
24
+ @source.link(@filter, @sink)
25
+ @bus = @pipeline.bus
26
+ end
27
+
28
+ def test_add_watch
29
+ message_types = []
30
+ loop = GLib::MainLoop.new
31
+ @bus.add_watch do |_bus, message|
32
+ message_types << message.type
33
+ loop.quit
34
+ GLib::Source::REMOVE
35
+ end
36
+ @pipeline.play
37
+ loop.run
38
+ assert_equal([Gst::MessageType::STATE_CHANGED],
39
+ message_types)
40
+ end
41
+ end
@@ -0,0 +1,33 @@
1
+ # Copyright (C) 2019 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
+ class TestTagList < Test::Unit::TestCase
18
+ def setup
19
+ @tag_list = Gst::TagList.new
20
+ @tag_list.add_value(:append, "title", "Hello")
21
+ end
22
+
23
+ def test_each
24
+ tags = []
25
+ @tag_list.each do |name, values|
26
+ tags << [name, values]
27
+ end
28
+ assert_equal([
29
+ ["title", ["Hello"]],
30
+ ],
31
+ tags)
32
+ end
33
+ 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.3.8
4
+ version: 3.3.9
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: 2019-09-09 00:00:00.000000000 Z
11
+ date: 2019-10-10 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.3.8
19
+ version: 3.3.9
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.3.8
26
+ version: 3.3.9
27
27
  description: Ruby/GStreamer is a Ruby binding for GStreamer.
28
28
  email: ruby-gnome2-devel-en@lists.sourceforge.net
29
29
  executables: []
@@ -53,6 +53,7 @@ files:
53
53
  - lib/gst/plugin-feature.rb
54
54
  - lib/gst/registry.rb
55
55
  - lib/gst/structure.rb
56
+ - lib/gst/tag-list.rb
56
57
  - lib/gst/type-find-factory.rb
57
58
  - lib/gst/version.rb
58
59
  - lib/gstreamer.rb
@@ -69,9 +70,11 @@ files:
69
70
  - test/gstreamer-test-utils.rb
70
71
  - test/run-test.rb
71
72
  - test/test-bin.rb
73
+ - test/test-bus.rb
72
74
  - test/test-caps.rb
73
75
  - test/test-child-proxy.rb
74
76
  - test/test-element-factory.rb
77
+ - test/test-tag-list.rb
75
78
  - test/test-version.rb
76
79
  homepage: https://ruby-gnome2.osdn.jp/
77
80
  licenses:
@@ -93,7 +96,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
96
  - !ruby/object:Gem::Version
94
97
  version: '0'
95
98
  requirements: []
96
- rubygems_version: 3.1.0.pre1
99
+ rubyforge_project:
100
+ rubygems_version: 2.7.6.2
97
101
  signing_key:
98
102
  specification_version: 4
99
103
  summary: Ruby/GStreamer is a Ruby binding for GStreamer.