Changeset 42944 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Aug 23, 2012 11:25:37 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/DisplayImpl.cpp
r42913 r42944 3286 3286 ULONG ulGuestHeight = 0; 3287 3287 ULONG ulGuestWidth = 0; 3288 ULONG ulBitsPerPixel; 3289 int rc; 3288 3290 DISPLAYFBINFO *pFBInfo = &pDisplay->maFramebuffers[VBOX_VIDEO_PRIMARY_SCREEN]; 3289 3291 … … 3292 3294 && pFBInfo->u32ResizeStatus == ResizeStatus_Void) 3293 3295 { 3294 HRESULT rc; 3295 ULONG ulPixelFormat = 0; 3296 rc = pFBInfo->pFramebuffer->COMGETTER(PixelFormat)(&ulPixelFormat); 3297 AssertComRC(rc); 3298 3299 ULONG ulBitsPerPixel; 3300 rc = pFBInfo->pFramebuffer->COMGETTER(BitsPerPixel)(&ulBitsPerPixel); 3301 AssertComRC(rc); 3302 3303 if (ulPixelFormat == FramebufferPixelFormat_FOURCC_RGB) 3296 if (pFBInfo->fVBVAEnabled && pFBInfo->pu8FramebufferVRAM) 3304 3297 { 3305 switch (ulBitsPerPixel) 3306 { 3307 case 32: 3308 u32VideoRecImgFormat = VPX_IMG_FMT_RGB32; 3309 Log2(("FFmpeg::RequestResize: setting ffmpeg pixel format to VPX_IMG_FMT_RGB32\n")); 3310 break; 3311 case 24: 3312 u32VideoRecImgFormat = VPX_IMG_FMT_RGB24; 3313 Log2(("FFmpeg::RequestResize: setting ffmpeg pixel format to VPX_IMG_FMT_RGB24\n")); 3314 break; 3315 case 16: 3316 u32VideoRecImgFormat = VPX_IMG_FMT_RGB565; 3317 Log2(("FFmpeg::RequestResize: setting ffmpeg pixel format to VPX_IMG_FMT_RGB565\n")); 3318 break; 3319 default: 3320 Log2(("No Proper Format detected\n")); 3321 break; 3322 } 3298 rc = VideoRecCopyToIntBuffer(pDisplay->mpVideoRecContext, 0, 0, 3299 FramebufferPixelFormat_FOURCC_RGB, pFBInfo->u16BitsPerPixel, 3300 pFBInfo->u32LineSize, pFBInfo->w, pFBInfo->h, 3301 pFBInfo->pu8FramebufferVRAM); 3302 ulGuestWidth = pFBInfo->w; 3303 ulGuestHeight = pFBInfo->h; 3304 ulBitsPerPixel = pFBInfo->u16BitsPerPixel; 3323 3305 } 3324 3325 if (u32VideoRecImgFormat != VPX_IMG_FMT_NONE) 3306 else 3326 3307 { 3327 if (pFBInfo->fVBVAEnabled && pFBInfo->pu8FramebufferVRAM) 3328 { 3329 rc = VideoRecCopyToIntBuffer(pDisplay->mpVideoRecContext, 0, 0, 3330 ulPixelFormat, pFBInfo->u16BitsPerPixel, pFBInfo->u32LineSize, 3331 pFBInfo->w, pFBInfo->h, pFBInfo->pu8FramebufferVRAM); 3332 ulGuestWidth = pFBInfo->w; 3333 ulGuestHeight = pFBInfo->h; 3334 } 3335 else 3336 { 3337 rc = VideoRecCopyToIntBuffer(pDisplay->mpVideoRecContext, 0, 0, 3338 ulPixelFormat, pDrv->IConnector.cBits, pDrv->IConnector.cbScanline, 3339 pDrv->IConnector.cx, pDrv->IConnector.cy, pDrv->IConnector.pu8Data); 3340 ulGuestWidth = pDrv->IConnector.cx; 3341 ulGuestHeight = pDrv->IConnector.cy; 3342 } 3308 rc = VideoRecCopyToIntBuffer(pDisplay->mpVideoRecContext, 0, 0, 3309 FramebufferPixelFormat_FOURCC_RGB, pDrv->IConnector.cBits, 3310 pDrv->IConnector.cbScanline, pDrv->IConnector.cx, 3311 pDrv->IConnector.cy, pDrv->IConnector.pu8Data); 3312 ulGuestWidth = pDrv->IConnector.cx; 3313 ulGuestHeight = pDrv->IConnector.cy; 3314 ulBitsPerPixel = pDrv->IConnector.cBits; 3315 } 3316 3317 switch (ulBitsPerPixel) 3318 { 3319 case 32: 3320 u32VideoRecImgFormat = VPX_IMG_FMT_RGB32; 3321 Log2(("FFmpeg::RequestResize: setting ffmpeg pixel format to VPX_IMG_FMT_RGB32\n")); 3322 break; 3323 case 24: 3324 u32VideoRecImgFormat = VPX_IMG_FMT_RGB24; 3325 Log2(("FFmpeg::RequestResize: setting ffmpeg pixel format to VPX_IMG_FMT_RGB24\n")); 3326 break; 3327 case 16: 3328 u32VideoRecImgFormat = VPX_IMG_FMT_RGB565; 3329 Log2(("FFmpeg::RequestResize: setting ffmpeg pixel format to VPX_IMG_FMT_RGB565\n")); 3330 break; 3331 default: 3332 Log2(("No Proper Format detected\n")); 3333 break; 3334 } 3343 3335 3344 3336 /* Just return in case of filure without any assertion */ 3345 if(rc) 3346 return; 3347 3348 if (!(VideoRecDoRGBToYUV(pDisplay->mpVideoRecContext, u32VideoRecImgFormat))) 3349 VideoRecEncodeAndWrite(pDisplay->mpVideoRecContext, ulGuestWidth, ulGuestHeight); 3350 } 3337 if( RT_SUCCESS(rc)) 3338 if (RT_SUCCESS(VideoRecDoRGBToYUV(pDisplay->mpVideoRecContext, u32VideoRecImgFormat))) 3339 VideoRecEncodeAndWrite(pDisplay->mpVideoRecContext, ulGuestWidth, ulGuestHeight); 3351 3340 } 3352 3341 }
Note:
See TracChangeset
for help on using the changeset viewer.