+static int ChromaCreate( vout_thread_t *p_vout )
+{
+ static const char typename[] = "chroma";
+ filter_t *p_chroma;
+
+ /* Choose the best module */
+ p_chroma = p_vout->p_chroma =
+ vlc_custom_create( p_vout, sizeof(filter_t), VLC_OBJECT_GENERIC,
+ typename );
+
+ vlc_object_attach( p_chroma, p_vout );
+
+ /* TODO: Set the fmt_in and fmt_out stuff here */
+ p_chroma->fmt_in.video = p_vout->fmt_render;
+ p_chroma->fmt_out.video = p_vout->fmt_out;
+ ChromaCopyRgbInfo( &p_chroma->fmt_in, &p_vout->render );
+ ChromaCopyRgbInfo( &p_chroma->fmt_out, &p_vout->output );
+
+ p_chroma->p_module = module_Need( p_chroma, "video filter2", NULL, 0 );
+
+ if( p_chroma->p_module == NULL )
+ {
+ msg_Err( p_vout, "no chroma module for %4.4s to %4.4s i=%dx%d o=%dx%d",
+ (char*)&p_vout->render.i_chroma,
+ (char*)&p_vout->output.i_chroma,
+ p_chroma->fmt_in.video.i_width, p_chroma->fmt_in.video.i_height,
+ p_chroma->fmt_out.video.i_width, p_chroma->fmt_out.video.i_height
+ );
+
+ vlc_object_release( p_vout->p_chroma );
+ p_vout->p_chroma = NULL;
+ return VLC_EGENERIC;
+ }
+ p_chroma->pf_vout_buffer_new = ChromaGetPicture;
+ return VLC_SUCCESS;
+}
+
+static void ChromaDestroy( vout_thread_t *p_vout )
+{
+ assert( !p_vout->b_direct );
+
+ if( !p_vout->p_chroma )
+ return;
+
+ module_Unneed( p_vout->p_chroma, p_vout->p_chroma->p_module );
+ vlc_object_release( p_vout->p_chroma );
+ p_vout->p_chroma = NULL;
+}
+
+
+