| 651 | | /* Choose the best module */ |
|---|
| 652 | | p_vout->p_chroma = vlc_object_create( p_vout, sizeof(filter_t) ); |
|---|
| 653 | | filter_t *p_chroma = p_vout->p_chroma; |
|---|
| 654 | | vlc_object_attach( p_chroma, p_vout ); |
|---|
| 655 | | /* TODO: Set the fmt_in and fmt_out stuff here */ |
|---|
| 656 | | p_chroma->fmt_in.video = p_vout->fmt_render; |
|---|
| 657 | | p_chroma->fmt_out.video = p_vout->fmt_out; |
|---|
| 658 | | |
|---|
| 659 | | /* TODO: put in a function */ |
|---|
| 660 | | p_chroma->fmt_out.video.i_rmask = p_vout->output.i_rmask; |
|---|
| 661 | | p_chroma->fmt_out.video.i_gmask = p_vout->output.i_gmask; |
|---|
| 662 | | p_chroma->fmt_out.video.i_bmask = p_vout->output.i_bmask; |
|---|
| 663 | | p_chroma->fmt_out.video.i_rrshift = p_vout->output.i_rrshift; |
|---|
| 664 | | p_chroma->fmt_out.video.i_lrshift = p_vout->output.i_lrshift; |
|---|
| 665 | | p_chroma->fmt_out.video.i_rgshift = p_vout->output.i_rgshift; |
|---|
| 666 | | p_chroma->fmt_out.video.i_lgshift = p_vout->output.i_lgshift; |
|---|
| 667 | | p_chroma->fmt_out.video.i_rbshift = p_vout->output.i_rbshift; |
|---|
| 668 | | p_chroma->fmt_out.video.i_lbshift = p_vout->output.i_lbshift; |
|---|
| 669 | | p_chroma->p_module = module_Need( p_chroma, "video filter2", NULL, 0 ); |
|---|
| 670 | | |
|---|
| 671 | | if( p_chroma->p_module == NULL ) |
|---|
| 672 | | { |
|---|
| 673 | | msg_Err( p_vout, "no chroma module for %4.4s to %4.4s", |
|---|
| 674 | | (char*)&p_vout->render.i_chroma, |
|---|
| 675 | | (char*)&p_vout->output.i_chroma ); |
|---|
| 676 | | |
|---|
| 677 | | vlc_object_release( p_vout->p_chroma ); |
|---|
| 678 | | p_vout->p_chroma = NULL; |
|---|
| | 648 | if( ChromaCreate( p_vout ) ) |
|---|
| | 649 | { |
|---|
| | 1219 | |
|---|
| | 1220 | /* Thread helpers */ |
|---|
| | 1221 | static picture_t *ChromaGetPicture( filter_t *p_filter ) |
|---|
| | 1222 | { |
|---|
| | 1223 | picture_t *p_pic = (picture_t *)p_filter->p_owner; |
|---|
| | 1224 | p_filter->p_owner = NULL; |
|---|
| | 1225 | return p_pic; |
|---|
| | 1226 | } |
|---|
| | 1227 | |
|---|
| | 1228 | static int ChromaCreate( vout_thread_t *p_vout ) |
|---|
| | 1229 | { |
|---|
| | 1230 | filter_t *p_chroma; |
|---|
| | 1231 | |
|---|
| | 1232 | /* Choose the best module */ |
|---|
| | 1233 | p_chroma = p_vout->p_chroma = vlc_object_create( p_vout, sizeof(filter_t) ); |
|---|
| | 1234 | |
|---|
| | 1235 | vlc_object_attach( p_chroma, p_vout ); |
|---|
| | 1236 | |
|---|
| | 1237 | /* TODO: Set the fmt_in and fmt_out stuff here */ |
|---|
| | 1238 | p_chroma->fmt_in.video = p_vout->fmt_render; |
|---|
| | 1239 | p_chroma->fmt_out.video = p_vout->fmt_out; |
|---|
| | 1240 | |
|---|
| | 1241 | p_chroma->fmt_out.video.i_rmask = p_vout->output.i_rmask; |
|---|
| | 1242 | p_chroma->fmt_out.video.i_gmask = p_vout->output.i_gmask; |
|---|
| | 1243 | p_chroma->fmt_out.video.i_bmask = p_vout->output.i_bmask; |
|---|
| | 1244 | p_chroma->fmt_out.video.i_rrshift = p_vout->output.i_rrshift; |
|---|
| | 1245 | p_chroma->fmt_out.video.i_lrshift = p_vout->output.i_lrshift; |
|---|
| | 1246 | p_chroma->fmt_out.video.i_rgshift = p_vout->output.i_rgshift; |
|---|
| | 1247 | p_chroma->fmt_out.video.i_lgshift = p_vout->output.i_lgshift; |
|---|
| | 1248 | p_chroma->fmt_out.video.i_rbshift = p_vout->output.i_rbshift; |
|---|
| | 1249 | p_chroma->fmt_out.video.i_lbshift = p_vout->output.i_lbshift; |
|---|
| | 1250 | p_chroma->p_module = module_Need( p_chroma, "video filter2", NULL, 0 ); |
|---|
| | 1251 | |
|---|
| | 1252 | if( p_chroma->p_module == NULL ) |
|---|
| | 1253 | { |
|---|
| | 1254 | msg_Err( p_vout, "no chroma module for %4.4s to %4.4s", |
|---|
| | 1255 | (char*)&p_vout->render.i_chroma, |
|---|
| | 1256 | (char*)&p_vout->output.i_chroma ); |
|---|
| | 1257 | |
|---|
| | 1258 | vlc_object_release( p_vout->p_chroma ); |
|---|
| | 1259 | p_vout->p_chroma = NULL; |
|---|
| | 1260 | return VLC_EGENERIC; |
|---|
| | 1261 | } |
|---|
| | 1262 | p_chroma->pf_vout_buffer_new = ChromaGetPicture; |
|---|
| | 1263 | return VLC_SUCCESS; |
|---|
| | 1264 | } |
|---|
| | 1265 | static void ChromaDestroy( vout_thread_t *p_vout ) |
|---|
| | 1266 | { |
|---|
| | 1267 | assert( !p_vout->b_direct && p_vout->p_chroma ); |
|---|
| | 1268 | |
|---|
| | 1269 | module_Unneed( p_vout->p_chroma, p_vout->p_chroma->p_module ); |
|---|
| | 1270 | vlc_object_release( p_vout->p_chroma ); |
|---|
| | 1271 | p_vout->p_chroma = NULL; |
|---|
| | 1272 | } |
|---|
| | 1273 | |
|---|
| | 1274 | |
|---|