Frame grabbing through using CUDA

Hi! How can I get video frame through using CUDA? Which methods should I use?
I’d like to see something look like:
Bitmap bitmap = GetVideoFrame(int indexFrame);
or:
Bitmap bitmap = GetVideoFrame(double secondFrame);
I can use in my project DirectShow library.
Thank you.