gstreamer 3.4.9 → 4.0.0
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 +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/audio-example.rb +2 -2
 - data/sample/mp3parselaunch.rb +1 -1
 - data/test/run-test.rb +1 -4
 - metadata +9 -8
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: d07ba0bace2f7893df3b69a48e8584ffd43852a55445b9f594017e49b0e51c06
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 8b71ab0c135b7e7be87d5031e82519a3673a018e17ce52f74bdc1859ded551e1
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 7b3a4ca0978091ec92f22f56bbe2979c1d96e10d1d93ae64f0b6cefefd355e07f3c8c54181ee794af6738d42082d6098ddb56d592de380a630a873cf138deb13
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 738d4313ceed6278dca3d58c371390e95eed59cf26331e5e43a33d3de82c0f1aeb80d7cd8caa66ed330a47e5ce0d6f33fcc247c2f1b93186d799ba024d76afd8
         
     | 
    
        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/audio-example.rb
    CHANGED
    
    | 
         @@ -32,7 +32,7 @@ 
     | 
|
| 
       32 
32 
     | 
    
         
             
            require "gst"
         
     | 
| 
       33 
33 
     | 
    
         | 
| 
       34 
34 
     | 
    
         
             
            bin = Gst::Pipeline.new("pipeline")
         
     | 
| 
       35 
     | 
    
         
            -
            clock = bin. 
     | 
| 
      
 35 
     | 
    
         
            +
            clock = bin.pipeline_clock
         
     | 
| 
       36 
36 
     | 
    
         
             
            src = Gst::ElementFactory.make("audiotestsrc", nil)
         
     | 
| 
       37 
37 
     | 
    
         
             
            raise "need audiotestsrc from gst-plugins-base" if src.nil?
         
     | 
| 
       38 
38 
     | 
    
         
             
            sink = Gst::ElementFactory.make("autoaudiosink", nil)
         
     | 
| 
         @@ -64,5 +64,5 @@ cs2.set(6 * Gst::SECOND,  440.0 / 20000.0) 
     | 
|
| 
       64 
64 
     | 
    
         
             
            clock_id = clock.new_single_shot_id(clock.time + (7 * Gst::SECOND))
         
     | 
| 
       65 
65 
     | 
    
         
             
            bin.play
         
     | 
| 
       66 
66 
     | 
    
         
             
            wait_ret, jitter = Gst::Clock.id_wait(clock_id)
         
     | 
| 
       67 
     | 
    
         
            -
             
     | 
| 
      
 67 
     | 
    
         
            +
            warn "Clock::id_wait returned: #{wait_ret}" if wait_ret != Gst::ClockReturn::OK
         
     | 
| 
       68 
68 
     | 
    
         
             
            bin.stop
         
     | 
    
        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:  
     | 
| 
      
 4 
     | 
    
         
            +
              version: 4.0.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - The Ruby-GNOME Project Team
         
     | 
| 
       8 
     | 
    
         
            -
            autorequire: 
     | 
| 
      
 8 
     | 
    
         
            +
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2022-09-01 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:  
     | 
| 
      
 19 
     | 
    
         
            +
                    version: 4.0.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:  
     | 
| 
      
 26 
     | 
    
         
            +
                    version: 4.0.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
         
     | 
| 
         @@ -80,7 +81,7 @@ licenses: 
     | 
|
| 
       80 
81 
     | 
    
         
             
            - LGPL-2.1+
         
     | 
| 
       81 
82 
     | 
    
         
             
            metadata:
         
     | 
| 
       82 
83 
     | 
    
         
             
              msys2_mingw_dependencies: gstreamer
         
     | 
| 
       83 
     | 
    
         
            -
            post_install_message: 
     | 
| 
      
 84 
     | 
    
         
            +
            post_install_message:
         
     | 
| 
       84 
85 
     | 
    
         
             
            rdoc_options: []
         
     | 
| 
       85 
86 
     | 
    
         
             
            require_paths:
         
     | 
| 
       86 
87 
     | 
    
         
             
            - lib
         
     | 
| 
         @@ -95,8 +96,8 @@ 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 
     | 
    
         
            -
            signing_key: 
     | 
| 
      
 99 
     | 
    
         
            +
            rubygems_version: 3.4.0.dev
         
     | 
| 
      
 100 
     | 
    
         
            +
            signing_key:
         
     | 
| 
       100 
101 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       101 
102 
     | 
    
         
             
            summary: Ruby/GStreamer is a Ruby binding for GStreamer.
         
     | 
| 
       102 
103 
     | 
    
         
             
            test_files: []
         
     |