Beispiel #1
0
	void
	V4LFrameSource::open() {
		if (isOpen()) return;

		if (m_deviceName.length() < 1) throw IOException("V4LFrameSource device not set");
		if (m_width < 0 || m_height < 0) throw IOException("V4LFrameSource width or height invalid");
		
		bool wasReset = usbReset();
		
		for (int i = 0; i < 5 && m_fd < 0; i++) {
			//m_fd = ::open(m_deviceName.c_str(), O_RDWR | O_NONBLOCK, 0);
			m_fd = ::open(m_deviceName.c_str(), O_RDWR, 0);
			if (m_fd < 0 && wasReset) {
				sleep(1);
			}
		}
		
		if (m_fd < 0) {
			throw IOException("Failed to open v4l camera");
		}

		checkCapabilities();
		updateCropping();
		updateVideoFormat();
		updateExposureTime(m_exposureTime);
		updateStreamParameters(m_frameRate);

		mmapBuffers();
	}
Beispiel #2
0
gboolean mprisPlayer_get_caps(MprisPlayer* pInstance, gint* pCaps, GError** pError)
{
    checkCapabilities(pInstance);

    *pCaps = pInstance->capabilities;
    return TRUE;
}
Beispiel #3
0
gboolean mprisPlayer_emit_caps_change(MprisPlayer* pInstance)
{
    if (checkCapabilities(pInstance))
    {
        g_signal_emit(pInstance, capabilitiesChangedSignal, 0, pInstance->capabilities);
        return TRUE;
    }

    return FALSE;
}
Beispiel #4
0
ceDeviceGL20::ceDeviceGL20 ()
  : _capable (false)
  , _indices (0)
  , _vertexDeclaration (0)
  , _program (0)
	, _effectTechnique (0)
  , _renderTarget (0)
  , _defaultAnisotropic (1)
  , _defaultMipMap (true)
  , _defaultFilter (F_Trilinear)
  , _defaultWrapMode (WM_Repeat)
  , _shadowOverlayer(0)
  , _useBlend (false)
{
  glewInit ();
  checkCapabilities ();

  glPixelStorei (GL_UNPACK_ALIGNMENT, 1);

  for (unsigned i = 0; i < MaxStreams; i++)
		{
			_vertexStreams[i] = 0;
		}
  for (unsigned i = 0; i < TS_Count; i++)
		{
			_textures[i] = 0;
		}
	_shadowMap[0].ShadowMap = 0;
	_shadowMap[1].ShadowMap = 0;
	_shadowMap[2].ShadowMap = 0;

  _light = 0;

  glMatrixMode (GL_MODELVIEW);
  while (glGetError() != GL_STACK_UNDERFLOW && glGetError() != GL_STACK_OVERFLOW)
    {
      glPopMatrix();
    }
  glPushMatrix();


	_shadowBias = ceMatrix4f (0.5f, 0.0f, 0.0f, 0.0f,
													 0.0f, 0.5f, 0.0f, 0.0f,
													 0.0f, 0.0f, 0.5f, 0.0f,
													 0.5f, 0.5f, 0.495f, 1.0f);
}