I am trying to develop a OpenGL based DirectShow transform filter that rotates image at arbitrary angle specified by user. I use very basic sample of image rotation making use of glRotatef. The rotation code works very well as standalone windows application. But gives error when calling through Directshow filters.
Additional Information:
I suspect it looks more or less like a threaded issues. I have sample directshow application that initializes capture filter, adds opengl rotation transform filter and video renderer. While initializing I used CoInitializeEx with COINIT_MULTITHREADED and also COINIT_APARTMENTTHREADED. Neither gives any improvement in threading.
What kind of approach would work out in fixing up this issue?
I have fixed this issue by creating OpenGL context during first call to Transform function. This makes OpenGL context to be of same thread as OpenGL drawing functions.
Reference links that helped
GlGenTextures keeps returing 0's
https://www.opengl.org/wiki/Common_Mistakes#Extensions_and_OpenGL_Versions
Textures not working with OpenGL
Thank you for people corrected my question posted.
EDIT: This such threading issues was due to problem in sharing of device context between threads. It can be handled by using wglShareList API to share context between two different thread. This has fixed the issue I have posted.
https://www.opengl.org/wiki/OpenGL_and_multithreading
https://www.opengl.org/wiki/Platform_specifics:_Windows
Hope this would be helpful for people who stuck in same boat:-)