X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmisc%2Ffilter.c;h=d769b60265b992d8f41c3006ef0e920a620e6494;hb=3953586c057cb4cbecb2c5d5aa7631ec17e40d1f;hp=801fae786ebf8f1e3b329bb6254d11925257613d;hpb=1df51e7c7cf55ea8fa4e8e24885d14978bc112fb;p=vlc diff --git a/src/misc/filter.c b/src/misc/filter.c index 801fae786e..d769b60265 100644 --- a/src/misc/filter.c +++ b/src/misc/filter.c @@ -30,7 +30,7 @@ #include filter_t *filter_NewBlend( vlc_object_t *p_this, - vlc_fourcc_t i_chroma_dst ) + const video_format_t *p_dst_chroma ) { filter_t *p_blend = vlc_custom_create( p_this, sizeof(*p_blend), VLC_OBJECT_GENERIC, "blend" ); @@ -42,7 +42,16 @@ filter_t *filter_NewBlend( vlc_object_t *p_this, es_format_Init( &p_blend->fmt_out, VIDEO_ES, 0 ); p_blend->fmt_out.i_codec = - p_blend->fmt_out.video.i_chroma = i_chroma_dst; + p_blend->fmt_out.video.i_chroma = p_dst_chroma->i_chroma; + p_blend->fmt_out.video.i_rmask = p_dst_chroma->i_rmask; + p_blend->fmt_out.video.i_gmask = p_dst_chroma->i_gmask; + p_blend->fmt_out.video.i_bmask = p_dst_chroma->i_bmask; + p_blend->fmt_out.video.i_rrshift= p_dst_chroma->i_rrshift; + p_blend->fmt_out.video.i_rgshift= p_dst_chroma->i_rgshift; + p_blend->fmt_out.video.i_rbshift= p_dst_chroma->i_rbshift; + p_blend->fmt_out.video.i_lrshift= p_dst_chroma->i_lrshift; + p_blend->fmt_out.video.i_lgshift= p_dst_chroma->i_lgshift; + p_blend->fmt_out.video.i_lbshift= p_dst_chroma->i_lbshift; /* The blend module will be loaded when needed with the real * input format */ @@ -102,7 +111,43 @@ void filter_DeleteBlend( filter_t *p_blend ) if( p_blend->p_module ) module_unneed( p_blend, p_blend->p_module ); - vlc_object_detach( p_blend ); vlc_object_release( p_blend ); } +/* */ +#include + +video_splitter_t *video_splitter_New( vlc_object_t *p_this, + const char *psz_name, + const video_format_t *p_fmt ) +{ + video_splitter_t *p_splitter = vlc_custom_create( p_this, sizeof(*p_splitter), + VLC_OBJECT_GENERIC, "video splitter" ); + if( !p_splitter ) + return NULL; + + video_format_Copy( &p_splitter->fmt, p_fmt ); + + /* */ + vlc_object_attach( p_splitter, p_this ); + + p_splitter->p_module = module_need( p_splitter, "video splitter", psz_name, true ); + if( ! p_splitter->p_module ) + { + video_splitter_Delete( p_splitter ); + return NULL; + } + + return p_splitter; +} + +void video_splitter_Delete( video_splitter_t *p_splitter ) +{ + if( p_splitter->p_module ) + module_unneed( p_splitter, p_splitter->p_module ); + + video_format_Clean( &p_splitter->fmt ); + + vlc_object_release( p_splitter ); +} +