Yuv overlay?

not really sure how to set up a yuv overlay. this is how i am trying.

if i do:
screen = SDL_SetVideoMode(width, height, 0, SDL_HWSURFACE );
i get a flat green screen.

if i do
screen = SDL_SetVideoMode(width, height,24, SDL_HWSURFACE );
i see some of the data. but i have the feeling it is not being drawn in
an overlay.

any ideas?---------------------------------

SDL_Surface *screen;
SDL_Overlay *yuv_overlay;
SDL_Rect rect;

if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
fprintf(stderr, “Unable to init SDL: %s\n”, SDL_GetError());
//exit(1);
}

screen = SDL_SetVideoMode(width, height, 0, SDL_SWSURFACE );
if (!screen)
printf(“SDL: problems intiting the screen.\n”);

yuv_overlay = SDL_CreateYUVOverlay( width, height,
SDL_YV12_OVERLAY, screen );
if ( yuv_overlay->hw_overlay )
printf(“SDL: Using hardware overlay.\n”);

rect.x =0; rect.y =0; rect.w =width; rect.h =height;

unsigned char *video_buffer = new unsigned char[video_buffer_size];
unsigned char *row = new unsigned char[height];

for(int i = 0; i < height; i++) {
row[i] = &video_buffer[i * width *3];
}

yuv_overlay->pixels = row;
for (int x =0; x < 100; x++) {
	SDL_LockYUVOverlay(yuv_overlay);
	decode_data(qtfile, row, 0);
	SDL_UnlockYUVOverlay(yuv_overlay);
	SDL_DisplayYUVOverlay(yuv_overlay, &rect);
}