Hi! I’ ve manage to do some progress in videos (got working video with sound almost synced), but problem is - as You pointed - renderer error after playback. It seems that renderer is damaged after first call to RenderCopy, when texture is in YUV format, and I’ve tried to tackle it in various ways without any success (creating new renderers, switching renderers etc.)… Which is weird, because in normal c++ app SDL renderer is working - movie is ended and app is being able to show textures in other pixel formats
Here are sources, maybe someone could fix this error ^^ If not, there are OGV cpp and h files, they could be used in other apps with SDL2 and OpenAL:
–link is in next post–
Here is working app in neko (far quicker to compile, and it is displaying move and shows the problem -> lime texture should be visible after movie ends):
And here is just cpp version of movie player sources with compiled exe to check that after movie is ended bitmap is displayed correctly in cpp:
#edit
Well, it is not working on linux renderer is badly rendered from the start, and app crashes after movie is finished but I do not have a clue where error could be.
Generally drawing functions in sdl needs a pointer to texture and renderer. I got renderer pointer from function I added to lime/graphics/Renderer.hx:
public function getBackend ():Dynamic {
return backend.handle;
}
I assume it is a pointer to SDLRenderer object from lime.ndll.
It is passed as Dynamic to lime, casted to void* and passed to OGV constructor, and finally pointers to SDL_Renderer and SDL_Window are extracted from it (SDL_Windows is needed for setting proper scale boundaries). Window dimension are readed properly, so I think pointers are correct.
In ExternalInterface I added two functions - lime_video_load and lime_video_load_frame.
If somebody could check it/help, I would be appreciated
cheers:)