+ switch (chroma)
+ {
+ case VLC_CODEC_RGB15:
+ p_dec->fmt_out.video.i_rmask = 0x001f;
+ p_dec->fmt_out.video.i_gmask = 0x03e0;
+ p_dec->fmt_out.video.i_bmask = 0x7c00;
+ pitch = p_sys->i_width * 2;
+ break;
+ case VLC_CODEC_RGB16:
+ p_dec->fmt_out.video.i_rmask = 0x001f;
+ p_dec->fmt_out.video.i_gmask = 0x07e0;
+ p_dec->fmt_out.video.i_bmask = 0xf800;
+ pitch = p_sys->i_width * 2;
+ break;
+ case VLC_CODEC_RGB24:
+ p_dec->fmt_out.video.i_rmask = 0xff0000;
+ p_dec->fmt_out.video.i_gmask = 0x00ff00;
+ p_dec->fmt_out.video.i_bmask = 0x0000ff;
+ pitch = p_sys->i_width * 3;
+ break;
+ case VLC_CODEC_RGB32:
+ p_dec->fmt_out.video.i_rmask = 0xff0000;
+ p_dec->fmt_out.video.i_gmask = 0x00ff00;
+ p_dec->fmt_out.video.i_bmask = 0x0000ff;
+ pitch = p_sys->i_width * 4;
+ break;
+ default:
+ p_dec->fmt_out.video.i_rmask = 0;
+ p_dec->fmt_out.video.i_gmask = 0;
+ p_dec->fmt_out.video.i_bmask = 0;
+ pitch = 0;
+ msg_Warn( p_dec, "Unknown chroma %s", chromaStr );
+ goto error;
+ }
+
+ free( chromaStr );
+
+ p_dec->fmt_out.i_codec = chroma;