Beispiel #1
0
/*
 * This method registers a list of new extensions.  
 * It avoids same extension getting registered multiple times. 
 * The order is not preserved if multiple extensions are
 * registered at one-go.
 */
void
rfbRegisterProtocolExtension(rfbProtocolExtension* extension)
{
	rfbProtocolExtension *head = rfbExtensionHead, *next = NULL;

	if(extension == NULL)
		return;

	next = extension->next;

	if (! extMutex_initialized) {
		INIT_MUTEX(extMutex);
		extMutex_initialized = 1;
	}

	LOCK(extMutex);

	while(head != NULL) {
		if(head == extension) {
			UNLOCK(extMutex);
			rfbRegisterProtocolExtension(next);
			return;
		}

		head = head->next;
	}

	extension->next = rfbExtensionHead;
	rfbExtensionHead = extension;

	UNLOCK(extMutex);
	rfbRegisterProtocolExtension(next);
}
Beispiel #2
0
//! called after plug-in is loaded and scenegraph is initialized
bool VncServer::init(int w, int h, unsigned short port) {

   lightsUpdateCount = 0;

   m_appHandler = nullptr;

   m_tileWidth = 256;
   m_tileHeight = 256;

   m_numTimesteps = 0;

   m_numClients = 0;
   m_numRhrClients = 0;
   m_boundCenter = vistle::Vector3(0., 0., 0.);
   m_boundRadius = 1.;

   rfbRegisterProtocolExtension(&matricesExt);
   rfbRegisterProtocolExtension(&lightsExt);
   rfbRegisterProtocolExtension(&boundsExt);
   rfbRegisterProtocolExtension(&tileExt);
   rfbRegisterProtocolExtension(&applicationExt);

   m_delay = 0;
   std::string config("COVER.Plugin.VncServer");

   m_benchmark = false;
   m_errormetric = false;
   m_compressionrate = false;

   m_imageParam.depthPrecision = 32;
   m_imageParam.depthQuant = true;
   m_imageParam.depthSnappy = true;
   m_imageParam.rgbaSnappy = true;
   m_imageParam.depthFloat = true;

   m_resizeBlocked = false;
   m_resizeDeferred = false;
   m_queuedTiles = 0;
   m_firstTile = false;

   int argc = 1;
   char *argv[] = { (char *)"DisCOVERay", NULL };

   m_screen = rfbGetScreen(&argc, argv, 0, 0, 8, 3, 4);
   m_screen->desktopName = "DisCOVERay";

   m_screen->autoPort = FALSE;
   m_screen->port = port;
   m_screen->ipv6port = port;

   m_screen->kbdAddEvent = &keyEvent;
   m_screen->ptrAddEvent = &pointerEvent;
   m_screen->newClientHook = &newClientHook;

   m_screen->deferUpdateTime = 0;
   m_screen->maxRectsPerUpdate = 10000000;
   rfbInitServer(m_screen);
   m_screen->deferUpdateTime = 0;
   m_screen->maxRectsPerUpdate = 10000000;
   m_screen->handleEventsEagerly = 1;

   m_screen->cursor = NULL; // don't show a cursor

   resize(0, w, h);

   return true;
}
void rfbRegisterTightVNCFileTransferExtension() {
	rfbRegisterProtocolExtension(&tightVncFileTransferExtension);
	rfbRegisterSecurityHandler(&tightVncSecurityHandler);
}