Sha256: dbe5d6360a1f72c332349fcf688d155f2aa030840329f9cb49abed00e9f9e93f

Contents?: true

Size: 714 Bytes

Versions: 3

Compression:

Stored size: 714 Bytes

Contents

#include <rb_av_dev.h>

static VALUE initialize(VALUE self, VALUE dev) {
  AVCaptureDeviceInput * input;
  AVCaptureDevice * device;

  Data_Get_Struct(self, AVCaptureDeviceInput, input);
  Data_Get_Struct(dev, AVCaptureDevice, device);

  [input initWithDevice:device error: nil];

  return self;
}

static VALUE allocate(VALUE klass) {
  AVCaptureDeviceInput *input = [AVCaptureDeviceInput alloc];

  return Data_Wrap_Struct(klass, 0, 0, input);
}

VALUE Init_input(VALUE outer) {
  VALUE rb_cDeviceInput = rb_define_class_under(outer, "DeviceInput", rb_cObject);

  rb_define_alloc_func(rb_cDeviceInput, allocate);

  rb_define_method(rb_cDeviceInput, "initialize", initialize, 1);

  return rb_cDeviceInput;
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
av_capture-1.0.2 ext/av_capture/input.m
av_capture-1.0.1 ext/av_capture/input.m
av_capture-1.0.0 ext/av_capture/input.m