|
|
#1 | |
|
Registered User
Join Date: Sep 2009
Posts: 57
|
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[0], pPictureInfo->stride[1], pPictureInfo->stride[2], pPictureInfo->stride[3] to videoWidth. Does anybody have any clue why it might causes the crash? I would appreciate if anybody could help. Thanks |
|
|
|
|
|
|
#2 | |
|
Moderator
Join Date: Aug 2005
Posts: 1,327
|
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[0] to a valid value; there's only a single plane. |
|
|
|
|
|
|
#3 | ||
|
Registered User
Join Date: Sep 2009
Posts: 57
|
Quote:
Quote:
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. |
||
|
|
|
![]() |
| Thread Tools | |
|
|