- Timestamp:
- 10/26/11 14:29:38 (19 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgPlugins/vnc/ReaderWriterVNC.cpp
r12850 r12851 50 50 static void updateImage(rfbClient* client,int x,int y,int w,int h); 51 51 52 static void passwordCheck(rfbClient* client,const char* encryptedPassWord,int len); 53 static char* getPassword(rfbClient* client); 54 55 std::string _username; 56 std::string _password; 52 57 double _timeOfLastUpdate; 53 58 double _timeOfLastRender; … … 138 143 139 144 _inactiveBlock = new osg::RefBlock; 140 141 145 } 142 146 … … 198 202 } 199 203 204 void LibVncImage::passwordCheck(rfbClient* client,const char* encryptedPassWord,int len) 205 { 206 OSG_NOTICE<<"LibVncImage::passwordCheck"<<std::endl; 207 } 208 209 char* LibVncImage::getPassword(rfbClient* client) 210 { 211 LibVncImage* image = (LibVncImage*)(rfbClientGetClientData(client, 0)); 212 OSG_NOTICE<<"LibVncImage::getPassword "<<image->_password<<std::endl; 213 return strdup(image->_password.c_str()); 214 } 215 200 216 201 217 bool LibVncImage::connect(const std::string& hostname) … … 212 228 _client->HandleTextChat = 0; 213 229 230 // provide the password if we have one assigned 231 if (!_password.empty()) _client->GetPassword = getPassword; 232 214 233 rfbClientSetClientData(_client, 0, this); 215 234 … … 268 287 PrintPixelFormat(&(client->format)); 269 288 289 #ifdef __APPLE__ 290 // feedback is that Mac's have an endian swap even though the PixelFormat results see under OSX are identical. 291 bool swap = true; 292 #else 270 293 bool swap = client->format.redShift!=0; 294 #endif 295 271 296 GLenum gl_pixelFormat = swap ? GL_BGRA : GL_RGBA; 272 297 … … 349 374 350 375 osg::ref_ptr<LibVncImage> image = new LibVncImage; 351 image->setDataVariance(osg::Object::DYNAMIC); 352 376 image->setDataVariance(osg::Object::DYNAMIC); 353 377 image->setOrigin(osg::Image::TOP_LEFT); 378 379 const osgDB::AuthenticationMap* authenticationMap = (options && options->getAuthenticationMap()) ? 380 options->getAuthenticationMap() : 381 osgDB::Registry::instance()->getAuthenticationMap(); 382 383 const osgDB::AuthenticationDetails* details = authenticationMap ? 384 authenticationMap->getAuthenticationDetails(hostname) : 385 0; 386 387 // configure authentication if required. 388 if (details) 389 { 390 OSG_NOTICE<<"Passing in password = "<<details->password<<std::endl; 391 392 image->_username = details->username; 393 image->_password = details->password; 394 } 354 395 355 396 if (!image->connect(hostname))
