Well finally I could display an image using SDL_DisolayYUVOverlay, but I guessed well I had to do the RGB->YUV pixel conversion.
I based the conversion on which I read here: http://www.fourcc.org/fccyvrgb.php
(the one based on the "Video Demystified" book).
There are another formulas, I have no clear why this one works for me and why others do not. I could gess it has to do with the YUV scheme selected.
Besides that I had to the sheme conversion:
inline void ConvertRGBtoIYUV(SDL_Surface *s, SDL_Overlay *o)
/* Convert */
for(y=0; y < s->h && y < o->h; y++)
p = ((Uint8 *)s->pixels) + s->pitch*y;
for(x=0; x<s->w && x<o->w; x++)
if(x%2==0 && y%2==0)
Then I scale the bmp to display:
SDL_Surface* bmp = SDL_LoadBMP("cb.bmp");
SDL_Overlay *overlay = NULL;
overlay = SDL_CreateYUVOverlay(bmp->w,bmp->h, SDL_IYUV_OVERLAY , screen);
video_rect.x = 200;
video_rect.y = 0;
video_rect.w = bmp->w*3; // I scaled it by 3 times from its original length
video_rect.h = bmp->h*3;
// DRAWING ENDS HERE
Maybe there are better ways to do these, any suggestions are welcome. Thanks