gstreamer 4.2.3 → 4.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +2 -2
  3. data/sample/audio-extract.rb +75 -0
  4. metadata +6 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bae85b5c453ca3e52346bd9d1c08a98352f73f6a284b861e7c3f1bfb2136bb6c
4
- data.tar.gz: 9c82568de947d359318e4435de5b1dccb7ec1e338ace47072087285f29bce133
3
+ metadata.gz: 19d2d0d2f3ed1a74905374073caf4b7c66d466b5fd712c213a27e60ccf775fae
4
+ data.tar.gz: fc112efd7a3fe32845772cc51085b1562f92147997e66e6b1312d67d2bcf1abd
5
5
  SHA512:
6
- metadata.gz: 2ec7322f60a5c2ce316acb2c420610c6f4476526d7e3ab19e007e450cde74d0e9cfcc4abb1a802ceaf9dd066b6a5692029b4856d5901e99bcb5dc819c3fcf97b
7
- data.tar.gz: 2878a891080e3c2dd0db060732d1a2d05ce3d2b11e61e46034c9b0acaa62feeaaa4754c050fa8e0968fbd4230f8fcea65aa0f0fb5be3f6f83ed2e9a594f44f55
6
+ metadata.gz: d642128fee3e8839e78bafc913bdfef6814cbf4eef223968006c8215523bfb8cf88a1d3e6e0d610cb814a95ded1e93f936a97e48ac1a696768b7090d3c6f6d85
7
+ data.tar.gz: c734c84a25d0d86be292110f2616e19b868b8d594bb6ad54ce457026de47fb1580bd17812e8c384c2449e964d79187aeb5cca90254618235e7260df5a0937dd7
data/Rakefile CHANGED
@@ -17,10 +17,10 @@
17
17
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
18
 
19
19
  $LOAD_PATH.unshift("./../glib2/lib")
20
- require "gnome2/rake/package-task"
20
+ require "gnome/rake/package-task"
21
21
 
22
22
  package_name = File.basename(__dir__)
23
23
  spec = Gem::Specification.load("#{package_name}.gemspec")
24
24
 
25
- GNOME2::Rake::PackageTask.define(spec, __dir__) do |package|
25
+ GNOME::Rake::PackageTask.define(spec, __dir__) do |package|
26
26
  end
@@ -0,0 +1,75 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Copyright (C) 2024 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
18
+
19
+ require "gst"
20
+
21
+ pipeline = Gst::Pipeline.new("audio-extractor")
22
+ src = Gst::ElementFactory.make("autoaudiosrc", nil)
23
+ raise "need audiotestsrc from gst-plugins-good" if src.nil?
24
+ resample = Gst::ElementFactory.make("audioresample", nil)
25
+ raise "need audioresample from gst-plugins-base" if resample.nil?
26
+ sink = Gst::ElementFactory.make("appsink", nil)
27
+ raise "need appsink from gst-plugins-base" if sink.nil?
28
+
29
+ # See https://gstreamer.freedesktop.org/documentation/additional/design/mediatype-audio-raw.html
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)
34
+ sink.caps = caps
35
+
36
+ sink.emit_signals = true
37
+ sink.signal_connect(:new_sample) do |_|
38
+ sample = sink.pull_sample
39
+ buffer = sample.buffer
40
+ success, map = buffer.map(:read)
41
+ p map.data
42
+ buffer.unmap(map)
43
+ Gst::FlowReturn::OK
44
+ end
45
+
46
+ pipeline << src << resample << sink
47
+ src >> resample >> sink
48
+
49
+ loop = GLib::MainLoop.new
50
+
51
+ bus = pipeline.bus
52
+ bus.add_watch do |bus, message|
53
+ case message.type
54
+ when Gst::MessageType::EOS
55
+ puts "End-of-stream"
56
+ loop.quit
57
+ when Gst::MessageType::ERROR
58
+ error, debug = message.parse_error
59
+ puts "Debugging info: #{debug || 'none'}"
60
+ puts "Error: #{error.message}"
61
+ loop.quit
62
+ end
63
+ true
64
+ end
65
+
66
+ pipeline.play
67
+ begin
68
+ loop.run
69
+ rescue Interrupt
70
+ puts "Interrupt"
71
+ rescue => error
72
+ puts "Error: #{error.message}"
73
+ ensure
74
+ pipeline.stop
75
+ end
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gstreamer
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.3
4
+ version: 4.2.5
5
5
  platform: ruby
6
+ original_platform: ''
6
7
  authors:
7
8
  - The Ruby-GNOME Project Team
8
9
  bindir: bin
9
10
  cert_chain: []
10
- date: 2024-09-19 00:00:00.000000000 Z
11
+ date: 2024-12-15 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: gobject-introspection
@@ -15,14 +16,14 @@ dependencies:
15
16
  requirements:
16
17
  - - '='
17
18
  - !ruby/object:Gem::Version
18
- version: 4.2.3
19
+ version: 4.2.5
19
20
  type: :runtime
20
21
  prerelease: false
21
22
  version_requirements: !ruby/object:Gem::Requirement
22
23
  requirements:
23
24
  - - '='
24
25
  - !ruby/object:Gem::Version
25
- version: 4.2.3
26
+ version: 4.2.5
26
27
  description: Ruby/GStreamer is a Ruby binding for GStreamer.
27
28
  email: ruby-gnome2-devel-en@lists.sourceforge.net
28
29
  executables: []
@@ -58,6 +59,7 @@ files:
58
59
  - lib/gst/version.rb
59
60
  - lib/gstreamer.rb
60
61
  - sample/audio-example.rb
62
+ - sample/audio-extract.rb
61
63
  - sample/framestep1.rb
62
64
  - sample/gst-inspect.rb
63
65
  - sample/gtk-video.rb