- Timestamp:
- Aug 6, 2012 1:32:24 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/DisplayImpl.cpp
r42479 r42619 3246 3246 } 3247 3247 #ifdef VBOX_WITH_VPX_MAIN 3248 VideoRecCopyToIntBuffer(pVideoRecContext, pDisplay->xOrigin, pDisplay->yOrigin, 3249 pDisplay->w, pDisplay->h, mPixelFormat, 3250 pDisplay->u16BitsPerPixel, mBytesPerLine, pDisplay->w, 3251 pDisplay->h, pDisplay->h, pDisplay->w, 3252 pu8Framebuffer, mTempRGBBuffer); 3248 ULONG u32PixelFormat; 3249 uint8_t *u8TmpBuf; 3250 uint32_t u32VideoRecImgFormat = VPX_IMG_FMT_NONE; 3251 DISPLAYFBINFO *pFBInfo = &pDisplay->maFramebuffers[VBOX_VIDEO_PRIMARY_SCREEN]; 3252 int rc; 3253 3254 3255 if (!pFBInfo->pFramebuffer.isNull() && !(pFBInfo->fDisabled) 3256 && pFBInfo->u32ResizeStatus==ResizeStatus_Void) 3257 { 3258 ULONG ulPixelFormat = 0; 3259 pFBInfo->pFramebuffer->COMGETTER(PixelFormat)(&ulPixelFormat); 3260 3261 ULONG ulBitsPerPixel; 3262 pFBInfo->pFramebuffer->COMGETTER(BitsPerPixel)(&ulBitsPerPixel); 3263 3264 ULONG ulFrameHeight = 0; 3265 pFBInfo->pFramebuffer->COMGETTER(Height)(&ulFrameHeight); 3266 3267 ULONG ulFrameWidth = 0; 3268 pFBInfo->pFramebuffer->COMGETTER(Width)(&ulFrameWidth); 3269 3270 BYTE *address = NULL; 3271 HRESULT hrc = pFBInfo->pFramebuffer->COMGETTER(Address) (&address); 3272 3273 3274 switch (ulBitsPerPixel) 3275 { 3276 case 32: 3277 case 24: 3278 case 16: 3279 u32PixelFormat = FramebufferPixelFormat_FOURCC_RGB; 3280 break; 3281 default: 3282 u32PixelFormat = FramebufferPixelFormat_Opaque; 3283 break; 3284 } 3285 3286 if(ulPixelFormat == FramebufferPixelFormat_FOURCC_RGB) 3287 { 3288 switch (ulBitsPerPixel) 3289 { 3290 case 32: 3291 u32VideoRecImgFormat = VPX_IMG_FMT_RGB32; 3292 Log2(("FFmpeg::RequestResize: setting ffmpeg pixel format to VPX_IMG_FMT_RGB32\n")); 3293 break; 3294 case 24: 3295 u32VideoRecImgFormat = VPX_IMG_FMT_RGB24; 3296 Log2(("FFmpeg::RequestResize: setting ffmpeg pixel format to VPX_IMG_FMT_RGB24\n")); 3297 break; 3298 case 16: 3299 u32VideoRecImgFormat = VPX_IMG_FMT_RGB565; 3300 Log2(("FFmpeg::RequestResize: setting ffmpeg pixel format to VPX_IMG_FMT_RGB565\n")); 3301 break; 3302 default: 3303 Log2(("No Proper Format detected\n")); 3304 3305 } 3306 } 3307 3308 LogFlow(("cp to IntBuf orgx=%d orgy=%d cx=%d cy=%d bpp=%d\n", 3309 pFBInfo->xOrigin, pFBInfo->yOrigin, pDrv->IConnector.cx, pDrv->IConnector.cy, 3310 pDrv->IConnector.cBits)); 3311 3312 3313 if (u32VideoRecImgFormat != VPX_IMG_FMT_NONE && address != NULL) 3314 { 3315 VideoRecCopyToIntBuffer(pVideoRecContext, pFBInfo->xOrigin, pFBInfo->yOrigin, 3316 u32PixelFormat, ulBitsPerPixel, pDrv->IConnector.cbScanline, 3317 ulFrameWidth, ulFrameHeight,address); 3318 3319 3320 LogFlow(("RGB:YUV\n")); 3321 VideoRecDoRGBToYUV(ulFrameWidth, ulFrameHeight, u32VideoRecImgFormat, 3322 pVideoRecContext->pu8TempYUVBuffer, 3323 pVideoRecContext->pu8TempRGBBuffer); 3324 LogFlow(("Encode\n")); 3325 VideoRecEncodeAndWrite(pVideoRecContext, ulFrameWidth, 3326 ulFrameHeight, pVideoRecContext->pu8TempYUVBuffer); 3327 } 3328 } 3253 3329 #endif 3254 3330 … … 4233 4309 #endif 4234 4310 #ifdef VBOX_WITH_VPX_MAIN 4235 rc = VideoRecContextCreate(&pVideoRecContext); 4236 rc = RTCritSectInit(&mCritSect); 4237 AssertReturn(rc == VINF_SUCCESS, E_UNEXPECTED); 4238 4239 if(rc == VINF_SUCCESS) 4240 rc = VideoRecContextInit(pVideoRecContext, "test.webm", 800, 720); 4311 LogFlow(("Init And Create\n")); 4312 int res = VideoRecContextCreate(&pVideoRecContext); 4313 res = RTCritSectInit(&pVideoRecContext->CritSect); 4314 AssertReturn(res == VINF_SUCCESS, E_UNEXPECTED); 4315 4316 if(res == VINF_SUCCESS) 4317 res = VideoRecContextInit(pVideoRecContext, "test.webm", 800, 720); 4241 4318 4242 4319 #endif
Note:
See TracChangeset
for help on using the changeset viewer.