Jump to content
  • Advertisement
Sign in to follow this  
DavidOL

Copy a buffer to a surface!

This topic is 3693 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there, When playing movies, we can get 20-40 frames per second. Suppose every time we get a frame buffer, i want copy this buffer to a directdraw surface, how to do this? Does the surface's media type must be accord with the media type of the frame? If the frame's media type is YUY2 or UYVY, how to do it? Thanks very much!

Share this post


Link to post
Share on other sites
Advertisement
Take a look at VMR9. Other than that using a SampleGrabber filter in DirectShow uses RGB color space only AFAIK. So you would have to convert each frame manually. VMR9 on the other hand will support RGB or YUV and convert them if necessary. A custom allocator running in renderless mode and a custom allocator allows you to use a callback to copy the frames grabbed to your own surface.

Oh hang on you said that's the frame's media type is YUY2 or UYVY not the surface your copying to. In that case Sample Grabber should be fine as it will convert it to RGB for you.

Either way take a look at DirectShow examples in the Platform SDK.

Share this post


Link to post
Share on other sites
Hi Headkaze,

Thanks for your reply! Now i use VMR7 and i get buffers using the GetCurrentImage method of the IVMRWindowlessControl interface. I copy the got buffer directly to an overlay surface and it displays some distorted images.

Thanks!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!