Ejemplo n.º 1
0
void CameraFeed::StartCapturing(int device_id) {
  if (device_.isOpened()) {
    device_.release();
  }

  if (!device_.open(device_id)) {
    throw std::runtime_error("Unable to capture from device id " + device_id);
  }

  StartCapturing();
}
Ejemplo n.º 2
0
VideoInput::VideoInput(int in_w, int in_h)
{
	w = in_w;
	h = in_h;

	dev_name = "/dev/video0";

	io	= IO_METHOD_MMAP;
	fd = -1;
	buffers = NULL;
	videobuffer = NULL;
	n_buffers = 0;

	errored = false;
	playing = false;

	OpenDevice();
	InitDevice();
	StartCapturing();
}