Thanks very much for the reply. Do happen to have any samples or examples of
how this is done?
Not the 100% of it, I’ve an example of player based on avcodec but for SDL
1.2
If i am using my own windows, do i still make a call to SDL_SetVideoMode()
to create my surface or will a call to SDL_CreateRGBSurface() suffice?
SDL_CreateRGBSurfaceFrom should be better in this situation. Maybe u can
also use a SDL_Texture, but I don’t know how well the OpenGL backend will
work in a multiple windows enviroment.
My general understanding is that i will create my window
SDL_CreateWindowFrom() using my MFC created hWnd, then create a surface with
the Rect of that window. I will then use FFMpeg to get my frames, convert
the frames to RGB and then BLIT them onto the surface?
I cannot help you with this, maybe someone else on the list can, because SDL
1.3 is not yet well documented and I’ve not yet tried to integrate it in a
gui enviroment.
I think SDL_CreateWindowFrom() is the equivalent of SDL_WINDOWID=
/ SDL_SetVideoMode(X,Y,0, flags) you’d use on SDL 1.2 to get control of a
window.
Is this correct? How does one Blit the RGB surface to the Rect. Will
SDL_BlitSurface() work or is there a better way. If using SDL_BlitSurface()
do i need multiple surfaces to call SDL_BlitSurface(), and if so, how do i
create the surfaces correctly?
I’ll do it this way:
Get your AVPicture allocated with his buffers, and size (this may occur to
the first iframe you decode or may be already available as soon as u
initialize the decoder depending the codec you are using).
Once you have an AVPicture with valid datas, create a RGB surface with the
exact pixel and size of the AVPicture, you’ll find that width may not be the
one of the movie and that your surface may be BGR, RGB, BGRA, ARGB…
To create the surface use SDL_CreateRGBSurfaceFrom and use the AVPicture
buffer as “source”.
Then blit the surface to your screen, if the format is different SDL will
take care of converting it to the correct pixel format of your windows.–
Ing. Gabriele Greco, DARTS Engineering
Tel: +39-0105761240 Fax: +39-0105760224
s-mail: Via G.T. Invrea 14 - 16129 GENOVA (ITALY)