- vout_sys_t *p_sys = p_vout->p_sys;
- IDirectFBSurface *p_primary = (IDirectFBSurface *) p_vout->p_sys->p_primary;
- uint8_t* p_pixels = NULL;
- picture_t *p_pic = NULL;
- int i_rlength, i_glength, i_blength;
- int i_roffset, i_goffset, i_boffset;
- int i_line_pitch;
- int i_size;
- int i_index;
-
- I_OUTPUTPICTURES = 0;
-
- switch( p_sys->p_pixel_format )
- {
- case DSPF_RGB332:
- /* 8 bit RGB (1 byte, red 3@5, green 3@2, blue 2@0) */
- /* i_pixel_pitch = 1; */
- i_rlength = 3;
- i_roffset = 5;
- i_glength = 3;
- i_goffset = 2;
- i_blength = 2;
- i_boffset = 0;
- p_vout->output.i_chroma = VLC_CODEC_RGB8;
- break;
-
- case DSPF_RGB16:
- /* 16 bit RGB (2 byte, red 5@11, green 6@5, blue 5@0) */
- /* i_pixel_pitch = 2; */
- i_rlength = 5;
- i_roffset = 11;
- i_glength = 6;
- i_goffset = 5;
- i_blength = 5;
- i_boffset = 0;
- p_vout->output.i_chroma = VLC_CODEC_RGB16;
- break;
-
- case DSPF_RGB24:
- /* 24 bit RGB (3 byte, red 8@16, green 8@8, blue 8@0) */
- /* i_pixel_pitch = 3; */
- i_rlength = 8;
- i_roffset = 16;
- i_glength = 8;
- i_goffset = 8;
- i_blength = 8;
- i_boffset = 0;
- p_vout->output.i_chroma = VLC_CODEC_RGB24;
- break;
-
- case DSPF_RGB32:
- /* 24 bit RGB (4 byte, nothing@24, red 8@16, green 8@8, blue 8@0) */
- /* i_pixel_pitch = 4; */
- i_rlength = 8;
- i_roffset = 16;
- i_glength = 8;
- i_goffset = 8;
- i_blength = 8;
- i_boffset = 0;
- p_vout->output.i_chroma = VLC_CODEC_RGB32;
- break;
-
- default:
- msg_Err( p_vout, "unknown screen depth %i",
- p_sys->p_pixel_format );
- return VLC_EGENERIC;
- }
- /* Set the RGB masks */
- p_vout->output.i_rmask = ( (1 << i_rlength) - 1 ) << i_roffset;
- p_vout->output.i_gmask = ( (1 << i_glength) - 1 ) << i_goffset;
- p_vout->output.i_bmask = ( (1 << i_blength) - 1 ) << i_boffset;
-
- /* Width and height */
- p_vout->output.i_width = p_sys->i_width;
- p_vout->output.i_height = p_sys->i_height;
-
- /* The aspect */
- p_vout->output.i_aspect = (p_sys->i_width * VOUT_ASPECT_FACTOR) /
- p_sys->i_height;
-
- /* Try to initialize 1 buffer */
- /* Find an empty picture slot */
- for( i_index = 0 ; i_index < VOUT_MAX_PICTURES ; i_index++ )
- {
- if( p_vout->p_picture[ i_index ].i_status == FREE_PICTURE )
- {
- p_pic = p_vout->p_picture + i_index;
- break;
- }
- }