gstreamer 4.2.5 → 4.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 19d2d0d2f3ed1a74905374073caf4b7c66d466b5fd712c213a27e60ccf775fae
4
- data.tar.gz: fc112efd7a3fe32845772cc51085b1562f92147997e66e6b1312d67d2bcf1abd
3
+ metadata.gz: 5af17ec79557cd16dbda72e1d5999b2d27c49dafa76e78791ba3b92d33db8bee
4
+ data.tar.gz: ee6d14649868ad5dbaffc61eec891bdee76d53cad6de6fa222cbcac1daf08668
5
5
  SHA512:
6
- metadata.gz: d642128fee3e8839e78bafc913bdfef6814cbf4eef223968006c8215523bfb8cf88a1d3e6e0d610cb814a95ded1e93f936a97e48ac1a696768b7090d3c6f6d85
7
- data.tar.gz: c734c84a25d0d86be292110f2616e19b868b8d594bb6ad54ce457026de47fb1580bd17812e8c384c2449e964d79187aeb5cca90254618235e7260df5a0937dd7
6
+ metadata.gz: e1a4c8a9049f79360a1994c628d73471c048382cb4d8360436d03d6aa2ccb878920f889b5777e03def44fb9b2563f98f10097bc7f42dfc7d9cfdb57753248aa8
7
+ data.tar.gz: 0dae8b535966a556b1cc0f84f9e6c80d93b0a5cd6de958f5a65544cedc7aba25f1f1a509662ca21af14a55993911751ea937761aba5ec54fff5e8d7806eb00f3
@@ -0,0 +1,23 @@
1
+ # Copyright (C) 2024 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 GstAudio
18
+ class Loader < GObjectIntrospection::Loader
19
+ def load
20
+ super("GstAudio")
21
+ end
22
+ end
23
+ end
data/lib/gst/caps.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2013-2025 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
@@ -46,5 +46,18 @@ module Gst
46
46
  get_structure(i)
47
47
  end
48
48
  end
49
+
50
+ def set_int_value(name, value)
51
+ self[name, :int] = value
52
+ end
53
+
54
+ def []=(name, type=nil, value)
55
+ if type
56
+ value_type = GLib::Type.const_get(type.to_s.upcase)
57
+ set_value(name, GLib::Value.new(value_type, value))
58
+ else
59
+ set_value(name, value)
60
+ end
61
+ end
49
62
  end
50
63
  end
data/lib/gst/structure.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2013-2025 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
@@ -24,5 +24,9 @@ module Gst
24
24
  [field_name, value]
25
25
  end
26
26
  end
27
+
28
+ def [](name)
29
+ get_value(name)
30
+ end
27
31
  end
28
32
  end
data/lib/gst.rb CHANGED
@@ -21,6 +21,7 @@ require "gobject-introspection"
21
21
  require "gst/loader"
22
22
  require "gst/base-loader"
23
23
  require "gst/controller-loader"
24
+ require "gst/audio-loader"
24
25
 
25
26
  module Gst
26
27
  LOG_DOMAIN = "GStreamer"
@@ -55,6 +56,7 @@ module Gst
55
56
  loader.load
56
57
  init_base
57
58
  init_controller
59
+ init_audio
58
60
  end
59
61
 
60
62
  private
@@ -69,5 +71,11 @@ module Gst
69
71
  loader.load
70
72
  Gst.include(GstController)
71
73
  end
74
+
75
+ def init_audio
76
+ loader = GstAudio::Loader.new(GstAudio)
77
+ loader.load
78
+ Gst.include(GstAudio)
79
+ end
72
80
  end
73
81
  end
@@ -28,9 +28,9 @@ raise "need appsink from gst-plugins-base" if sink.nil?
28
28
 
29
29
  # See https://gstreamer.freedesktop.org/documentation/additional/design/mediatype-audio-raw.html
30
30
  caps = Gst::Caps.new("audio/x-raw")
31
- caps.set_value("format", "F32LE")
32
- caps.set_value("rate", 16 * 1000)
33
- caps.set_value("channels", 1)
31
+ caps["format"] = "F32LE"
32
+ caps["rate", :int] = 16 * 1000
33
+ caps["channels", :int] = 1
34
34
  sink.caps = caps
35
35
 
36
36
  sink.emit_signals = true
@@ -0,0 +1,54 @@
1
+ # Copyright (C) 2024-2025 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 TestAudio < Test::Unit::TestCase
18
+ include GStreamerTestUtils
19
+
20
+ def test_audio_info
21
+ audio_info = Gst::AudioInfo.new
22
+ audio_info.set_format(:encoded, 44100, 2)
23
+ structure = audio_info.to_caps.structures[0]
24
+ assert_equal("ENCODED", structure["format"].value)
25
+ assert_equal(44100, audio_info.rate)
26
+ assert_equal(2, audio_info.channels)
27
+
28
+ audio_info.set_format(:f32le, 16000, 1)
29
+ modified_structure = audio_info.to_caps.structures[0]
30
+ assert_equal("F32LE", modified_structure["format"].value)
31
+ assert_equal(16000, audio_info.rate)
32
+ assert_equal(1, audio_info.channels)
33
+ end
34
+
35
+ def test_audio_info_from_caps
36
+ only_gstreamer_version(1, 20)
37
+
38
+ caps = Gst::Caps.new("audio/ogg")
39
+ caps["rate", :int] = 44100
40
+ caps["channels", :int] = 2
41
+
42
+ audio_info = Gst::AudioInfo.new(caps)
43
+ structure = audio_info.to_caps.structures[0]
44
+ assert_equal("ENCODED", structure["format"].value)
45
+ assert_equal(44100, audio_info.rate)
46
+ assert_equal(2, audio_info.channels)
47
+
48
+ audio_info.set_format(:f32le, 16000, 1)
49
+ modified_structure = audio_info.to_caps.structures[0]
50
+ assert_equal("F32LE", modified_structure["format"].value)
51
+ assert_equal(16000, audio_info.rate)
52
+ assert_equal(1, audio_info.channels)
53
+ end
54
+ end
data/test/test-caps.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2014-2025 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
@@ -27,5 +27,32 @@ class TestCaps < Test::Unit::TestCase
27
27
  def test_media_type
28
28
  assert_equal("audio/ogg", Gst::Caps.new("audio/ogg").to_s)
29
29
  end
30
+
31
+ def test_set_int_value
32
+ caps = Gst::Caps.new("audio/ogg")
33
+ caps.set_int_value("rate", 44100)
34
+ structure = caps.structures[0]
35
+ value = structure["rate"]
36
+ assert_equal([GLib::Type::INT, 44100],
37
+ [value.type, value.value])
38
+ end
39
+
40
+ def test_array_set_no_type
41
+ caps = Gst::Caps.new("audio/ogg")
42
+ caps["rate"] = 44100
43
+ structure = caps.structures[0]
44
+ value = structure["rate"]
45
+ assert_equal([GLib::Type::UINT, 44100],
46
+ [value.type, value.value])
47
+ end
48
+
49
+ def test_array_set_int
50
+ caps = Gst::Caps.new("audio/ogg")
51
+ caps["rate", :int] = 44100
52
+ structure = caps.structures[0]
53
+ value = structure["rate"]
54
+ assert_equal([GLib::Type::INT, 44100],
55
+ [value.type, value.value])
56
+ end
30
57
  end
31
58
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gstreamer
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.5
4
+ version: 4.2.6
5
5
  platform: ruby
6
- original_platform: ''
7
6
  authors:
8
7
  - The Ruby-GNOME Project Team
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-12-15 00:00:00.000000000 Z
10
+ date: 2025-01-25 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: gobject-introspection
@@ -16,14 +15,14 @@ dependencies:
16
15
  requirements:
17
16
  - - '='
18
17
  - !ruby/object:Gem::Version
19
- version: 4.2.5
18
+ version: 4.2.6
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - '='
25
24
  - !ruby/object:Gem::Version
26
- version: 4.2.5
25
+ version: 4.2.6
27
26
  description: Ruby/GStreamer is a Ruby binding for GStreamer.
28
27
  email: ruby-gnome2-devel-en@lists.sourceforge.net
29
28
  executables: []
@@ -43,6 +42,7 @@ files:
43
42
  - extconf.rb
44
43
  - gstreamer.gemspec
45
44
  - lib/gst.rb
45
+ - lib/gst/audio-loader.rb
46
46
  - lib/gst/base-loader.rb
47
47
  - lib/gst/bin.rb
48
48
  - lib/gst/bus.rb
@@ -71,6 +71,7 @@ files:
71
71
  - sample/typefind.rb
72
72
  - test/gstreamer-test-utils.rb
73
73
  - test/run-test.rb
74
+ - test/test-audio.rb
74
75
  - test/test-bin.rb
75
76
  - test/test-bus.rb
76
77
  - test/test-caps.rb
@@ -98,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
99
  - !ruby/object:Gem::Version
99
100
  version: '0'
100
101
  requirements: []
101
- rubygems_version: 3.6.0.dev
102
+ rubygems_version: 3.6.2
102
103
  specification_version: 4
103
104
  summary: Ruby/GStreamer is a Ruby binding for GStreamer.
104
105
  test_files: []