Changeset 54380 in vbox for trunk/src/VBox/ExtPacks
- Timestamp:
- Feb 23, 2015 11:24:25 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ExtPacks/VNC/VBoxVNC.cpp
r51231 r54380 80 80 if (mCursor) 81 81 rfbFreeCursor(mCursor); 82 memset(szVNCPassword, '\0', sizeof(szVNCPassword));82 RT_ZERO(szVNCPassword); 83 83 if (mVNCServer) 84 84 rfbScreenCleanup(mVNCServer); … … 261 261 LogFlowFunc(("enter\n")); 262 262 263 // query server for the framebuffer 263 // At this point, VRDECallbackFramebufferQuery will not succeed. 264 // Initialize VNC with 640x480 and wait for VRDEResize to get actual size. 265 int dummyWidth = 640, dummyHeight = 480; 266 267 rfbScreenInfoPtr vncServer = rfbGetScreen(0, NULL, dummyWidth, dummyHeight, 8, 3, VNC_SIZEOFRGBA); 268 instance->mVNCServer = vncServer; 269 264 270 VRDEFRAMEBUFFERINFO info; 265 int rc = instance->mCallbacks->VRDECallbackFramebufferQuery(instance->mCallback, 0, &info); 266 267 rfbScreenInfoPtr vncServer = rfbGetScreen(0, NULL, info.cWidth, info.cHeight, 8, 3, VNC_SIZEOFRGBA); 268 instance->mVNCServer = vncServer; 271 RT_ZERO(info); 272 info.cWidth = dummyWidth, info.cHeight = dummyHeight; 273 info.cBitsPerPixel = 24; 274 info.pu8Bits = NULL; 275 unsigned char *FrameBuffer = (unsigned char *)RTMemAlloc(info.cWidth * info.cHeight * VNC_SIZEOFRGBA); // RGBA 276 rfbNewFramebuffer(instance->mVNCServer, (char *)FrameBuffer, info.cWidth, info.cHeight, 8, 3, VNC_SIZEOFRGBA); 277 instance->mFrameBuffer = FrameBuffer; 278 instance->mScreenBuffer = (unsigned char *)info.pu8Bits; 279 instance->FrameInfo = info; 280 269 281 vncServer->serverFormat.redShift = 16; 270 282 vncServer->serverFormat.greenShift = 8; … … 278 290 char szAddress[VNC_ADDRESSSIZE + 1] = {0}; 279 291 uint32_t cbOut = 0; 280 rc = instance->mCallbacks->VRDECallbackProperty(instance->mCallback,292 int rc = instance->mCallbacks->VRDECallbackProperty(instance->mCallback, 281 293 VRDE_QP_NETWORK_ADDRESS, 282 294 &szAddress, sizeof(szAddress), &cbOut); … … 716 728 VNCServerImpl *instance = (VNCServerImpl *)hServer; 717 729 VRDEFRAMEBUFFERINFO info; 718 int rc = instance->mCallbacks->VRDECallbackFramebufferQuery(instance->mCallback, 0, &info); 719 if (!RT_SUCCESS(rc)) 720 { 730 bool fAvail = instance->mCallbacks->VRDECallbackFramebufferQuery(instance->mCallback, 0, &info); 731 if (!fAvail) 721 732 return; 722 }723 733 724 734 LogRel(("VNCServerImpl::VRDEResize to %dx%dx%dbpp\n", info.cWidth, info.cHeight, info.cBitsPerPixel));
Note:
See TracChangeset
for help on using the changeset viewer.