class Gst::Loader - gstreamer-2.2.5 Documentation

# class Gst::Loader

### Constants

RENAME_MAP
UNLOCK_GVL_METHODS

### Public Class Methods

new(base_module, init_arguments) click to toggle source
Calls superclass method

    # File lib/gst.rb, line 92
    def initialize(base_module, init_arguments)
      super(base_module)
      @init_arguments = init_arguments
    end

### Private Instance Methods

call_init_function(repository, namespace) click to toggle source

    # File lib/gst.rb, line 103
    def call_init_function(repository, namespace)
      init_check = repository.find(namespace, "init_check")
      arguments = [
        [$0] + @init_arguments,
      ]
      succeeded, argv, error = init_check.invoke(:arguments => arguments)
      @init_arguments.replace(argv[1..-1])
      raise error unless succeeded
    end

define_value_modules() click to toggle source

    # File lib/gst.rb, line 113
    def define_value_modules
      @value_functions_module = Module.new
      @value_methods_module   = Module.new
      @base_module.const_set("ValueFunctions", @value_functions_module)
      @base_module.const_set("ValueMethods",   @value_methods_module)
    end

load_function_info(info) click to toggle source
Calls superclass method

    # File lib/gst.rb, line 134
    def load_function_info(info)
      case info.name
      when "init"
        # ignore
      when /\Avalue_/
        method_name = $POSTMATCH
        load_value_function_info(info, method_name)
      else
        super
      end
    end

load_value_function_info(info, method_name) click to toggle source

    # File lib/gst.rb, line 146
    def load_value_function_info(info, method_name)
      value_functions_module = @value_functions_module
      define_module_function(value_functions_module, method_name, info)
      @value_methods_module.module_eval do
        define_method(method_name) do |*arguments, &block|
          value_functions_module.send(method_name, self, *arguments, &block)
        end
      end
    end

post_load(repository, namespace) click to toggle source

    # File lib/gst.rb, line 120
    def post_load(repository, namespace)
      require_extension
      self.class.start_callback_dispatch_thread
    end

pre_load(repository, namespace) click to toggle source

    # File lib/gst.rb, line 98
    def pre_load(repository, namespace)
      call_init_function(repository, namespace)
      define_value_modules
    end

require_extension() click to toggle source

    # File lib/gst.rb, line 125
    def require_extension
      begin
        major, minor, _ = RUBY_VERSION.split(/\./)
        require "#{major}.#{minor}/gstreamer.so"
      rescue LoadError
        require "gstreamer.so"
      end
    end

rubyish_method_name(function_info) click to toggle source
Calls superclass method

    # File lib/gst.rb, line 162
    def rubyish_method_name(function_info)
      RENAME_MAP[function_info.name] || super
    end

should_unlock_gvl?(function_info, klass) click to toggle source
Calls superclass method

    # File lib/gst.rb, line 172
    def should_unlock_gvl?(function_info, klass)
      UNLOCK_GVL_METHODS["#{klass}\##{function_info.name}"] || super
    end