# 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/loader.rb, line 19
    def initialize(base_module, init_arguments)
      super(base_module)
      @init_arguments = init_arguments
    end

### Public Instance Methods

load() click to toggle source
Calls superclass method

    # File lib/gst/loader.rb, line 24
    def load
      super("Gst")
    end

### Private Instance Methods

call_init_function(repository, namespace) click to toggle source

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

define_value_modules() click to toggle source

    # File lib/gst/loader.rb, line 44
    def define_value_modules
      @value_functions_module = define_methods_module(:ValueFunctions)
      @value_methods_module   = define_methods_module(:ValueMethods)
    end

load_function_info(info) click to toggle source
Calls superclass method

    # File lib/gst/loader.rb, line 75
    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_method_info(info, klass, method_name) click to toggle source
Calls superclass method

    # File lib/gst/loader.rb, line 97
    def load_method_info(info, klass, method_name)
      case method_name
      when "ref", "unref"
        # Ignore
      else
        super
      end
    end

load_value_function_info(info, method_name) click to toggle source

    # File lib/gst/loader.rb, line 87
    def load_value_function_info(info, method_name)
      value_functions_module = @value_functions_module
      define_module_function(info, value_functions_module, method_name)
      @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/loader.rb, line 49
    def post_load(repository, namespace)
      post_methods_module(@value_functions_module)
      post_methods_module(@value_methods_module)
      require_extension
      require_libraries
      self.class.start_callback_dispatch_thread
    end

pre_load(repository, namespace) click to toggle source

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

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

    # File lib/gst/loader.rb, line 122
    def prepare_function_info_lock_gvl(function_info, klass)
      super
      key = "#{klass}\##{function_info.name}"
      return unless UNLOCK_GVL_METHODS.key?(key)
      function_info.lock_gvl_default = false
    end

require_extension() click to toggle source

    # File lib/gst/loader.rb, line 57
    def require_extension
      require "gstreamer.so"
    end

require_libraries() click to toggle source

    # File lib/gst/loader.rb, line 61
    def require_libraries
      require "gst/bin"
      require "gst/bus"
      require "gst/caps"
      require "gst/element"
      require "gst/element-factory"
      require "gst/plugin-feature"
      require "gst/registry"
      require "gst/structure"
      require "gst/tag-list"
      require "gst/type-find-factory"
      require "gst/version"
    end

rubyish_method_name(function_info) click to toggle source
Calls superclass method

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