Method: ActiveVlc::LibVlc::Instance#initialize
- Defined in:
- lib/activevlc/libvlc/instance.rb
#initialize(args = [""]) ⇒ Instance
Returns a new instance of Instance.
16 17 18 19 20 21 22 23 24 |
# File 'lib/activevlc/libvlc/instance.rb', line 16 def initialize(args = [""]) argc = args.length @argv = args.map{ |a| FFI::MemoryPointer.from_string a} test = FFI::MemoryPointer.new(:pointer, argc) test.put_array_of_pointer(0, @argv) @ptr = InstancePtr.new Api.libvlc_new(argc, test) raise "Unable to create a libvlc_instance_t" if @ptr.null? end |