Hi, I am developing an app to decode/render video with VDPAU. While the decoding/rendering work flawlessly, when I call vdp_output_surface_get_bits_native to dump decoded data to a malloc'ed buffer, it crashes. If I enable VDPAU_TRACE and
VDPAU_NVIDIA_DEBUG, it hangs on that function call without printing any information on the console. Here is the line that causes the crash:
vdp_st = pVDPAUCntx->vdp_output_surface_get_bits_native( output_surface, NULL, (void *) pRendererSession->getPicCbackParam->pData, (uint32_t *) pPictureInfo->stride );
prior to calling this, I malloc pRendererSession->getPicCbackParam->pData of videoWidth*videoHeight*4 (the native RGB format for the video surface is VDP_RGBA_FORMAT_B8G8R8A8). I also set pPictureInfo->stride, pPictureInfo->stride, pPictureInfo->stride, pPictureInfo->stride to videoWidth.
Does anybody have any clue why it might causes the crash? I would appreciate if anybody could help.
Are you sure that videoWidth/videoHeight (and hence stride) exactly match the surface size that VDPAU internally allocated?
Note that when you allocate a surface in VDPAU, the implementation is free to round up the actual surface size to meet implementation requirements. You should use VdpOutputSurfaceGetParameters to retrieve the exact allocated width/height. The put/get bits functions default size (i.e. when rect is NULL) is the entire allocated surface size, not the user-requested surface size.
Also, pitch should be width * pixel_size (i.e. width * 4), not just width; it's bytes, not pixels.
Failing that, it's probably best to run under a debugger, and check the address that VDPAU is accessing when the segfault occurs. You may be able to work back from that to work out why it's attempting to write that location based on pointers and pitch.
This isn't an issue, but for that format, you only need to set pitch to a valid value; there's only a single plane.
Is it possible to get your direct email address, we are emerging OEM company of EVGA/NVIDIA and I have some basic questions regarding openGL integration with VDPAU.
|All times are GMT -5. The time now is 03:04 AM.|
Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright ©1998 - 2014, nV News.