View Single Post
Old 01-04-10, 01:30 PM   #2
Stephen Warren
Moderator
 
Stephen Warren's Avatar
 
Join Date: Aug 2005
Posts: 1,327
Default Re: vdp_output_surface_get_bits_native

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.
Stephen Warren is offline   Reply With Quote