filter_chain: remove always NULL parameter from AppendConverter

This commit is contained in:
Steve Lhomme 2019-11-07 12:50:28 +01:00
parent 6a3eb7adad
commit 46b94a5d6c
8 changed files with 16 additions and 22 deletions

View File

@ -381,13 +381,12 @@ VLC_API filter_t *filter_chain_AppendFilter(filter_chain_t *chain,
* Append a conversion to the chain.
*
* \param chain filter chain to append a filter to
* \param fmt_in filter input format
* \param fmt_out filter output format
* \retval 0 on success
* \retval -1 on failure
*/
VLC_API int filter_chain_AppendConverter(filter_chain_t *chain,
const es_format_t *fmt_in, const es_format_t *fmt_out);
const es_format_t *fmt_out);
/**
* Append new filter to filter chain from string.

View File

@ -517,7 +517,7 @@ filter_chain_t * VideoDecodedStream::VideoFilterCreate(const es_format_t *p_srcf
if(p_srcfmt->video.i_chroma != requestedoutput.video.i_chroma)
{
if(filter_chain_AppendConverter(p_chain, NULL, &requestedoutput) != VLC_SUCCESS)
if(filter_chain_AppendConverter(p_chain, &requestedoutput) != VLC_SUCCESS)
{
filter_chain_Delete(p_chain);
return NULL;

View File

@ -101,7 +101,7 @@ static int video_update_format_decoder( decoder_t *p_dec, vlc_video_context *vct
test_chain = filter_chain_NewVideo( p_obj, false, NULL );
filter_chain_Reset( test_chain, &p_dec->fmt_out, &p_dec->fmt_out );
int chain_works = filter_chain_AppendConverter( test_chain, NULL, p_enc_in );
int chain_works = filter_chain_AppendConverter( test_chain, p_enc_in );
filter_chain_Delete( test_chain );
msg_Dbg( p_obj, "Filter chain testing done, input chroma %4.4s seems to be %s for transcode",
@ -289,7 +289,7 @@ static int transcode_video_set_conversions( sout_stream_t *p_stream,
return VLC_EGENERIC;
filter_chain_Reset( *pp_chain, *pp_src, p_tmpdst );
if( filter_chain_AppendConverter( *pp_chain, NULL, p_tmpdst ) != VLC_SUCCESS )
if( filter_chain_AppendConverter( *pp_chain, p_tmpdst ) != VLC_SUCCESS )
return VLC_EGENERIC;
*pp_src = filter_chain_GetFmtOut( *pp_chain );

View File

@ -390,7 +390,7 @@ static int BuildFilterChain( filter_t *p_filter )
video_format_FixRgb(&fmt_mid.video);
if( filter_chain_AppendConverter( p_sys->p_chain,
NULL, &fmt_mid ) == VLC_SUCCESS )
&fmt_mid ) == VLC_SUCCESS )
{
p_sys->p_video_filter =
filter_chain_AppendFilter( p_sys->p_chain,
@ -435,8 +435,7 @@ static int CreateChain( filter_t *p_filter, const es_format_t *p_fmt_mid )
}
else
{
if( filter_chain_AppendConverter( p_sys->p_chain,
NULL, p_fmt_mid ) )
if( filter_chain_AppendConverter( p_sys->p_chain, p_fmt_mid ) )
return VLC_EGENERIC;
}
@ -448,8 +447,7 @@ static int CreateChain( filter_t *p_filter, const es_format_t *p_fmt_mid )
}
else
{
if( filter_chain_AppendConverter( p_sys->p_chain,
NULL, &p_filter->fmt_out ) )
if( filter_chain_AppendConverter( p_sys->p_chain, &p_filter->fmt_out ) )
goto error;
}
return VLC_SUCCESS;
@ -464,8 +462,7 @@ static int CreateResizeChromaChain( filter_t *p_filter, const es_format_t *p_fmt
filter_sys_t *p_sys = p_filter->p_sys;
filter_chain_Reset( p_sys->p_chain, &p_filter->fmt_in, &p_filter->fmt_out );
int i_ret = filter_chain_AppendConverter( p_sys->p_chain,
NULL, p_fmt_mid );
int i_ret = filter_chain_AppendConverter( p_sys->p_chain, p_fmt_mid );
if( i_ret != VLC_SUCCESS )
return i_ret;
@ -480,13 +477,11 @@ static int CreateResizeChromaChain( filter_t *p_filter, const es_format_t *p_fmt
filter_chain_GetFmtOut( p_sys->p_chain ) );
fmt_out.video.i_chroma = p_filter->fmt_out.video.i_chroma;
i_ret = filter_chain_AppendConverter( p_sys->p_chain,
NULL, &fmt_out );
i_ret = filter_chain_AppendConverter( p_sys->p_chain, &fmt_out );
es_format_Clean( &fmt_out );
}
else
i_ret = filter_chain_AppendConverter( p_sys->p_chain,
NULL, &p_filter->fmt_out );
i_ret = filter_chain_AppendConverter( p_sys->p_chain, &p_filter->fmt_out );
if( i_ret != VLC_SUCCESS )
filter_chain_Clear( p_sys->p_chain );

View File

@ -335,7 +335,7 @@ static int Activate( vlc_object_t *p_this )
filter_chain_Reset( p_sys->p_chain, &p_filter->fmt_in, &fmt );
/* Append scaling module */
if ( filter_chain_AppendConverter( p_sys->p_chain, NULL, NULL ) )
if ( filter_chain_AppendConverter( p_sys->p_chain, NULL ) )
{
msg_Err( p_filter, "Could not append scaling filter" );
free( p_sys );

View File

@ -278,10 +278,10 @@ filter_t *filter_chain_AppendFilter( filter_chain_t *chain,
}
int filter_chain_AppendConverter( filter_chain_t *chain,
const es_format_t *fmt_in, const es_format_t *fmt_out )
const es_format_t *fmt_out )
{
return filter_chain_AppendInner( chain, NULL, chain->conv_cap, NULL,
fmt_in, fmt_out ) != NULL ? 0 : -1;
NULL, fmt_out ) != NULL ? 0 : -1;
}
void filter_chain_DeleteFilter( filter_chain_t *chain, filter_t *filter )

View File

@ -338,7 +338,7 @@ static int VoutDisplayCreateRender(vout_display_t *vd)
es_format_InitFromVideo(&dst, i == 0 ? &v_dst : &v_dst_cmp);
filter_chain_Reset(osys->converters, &src, &dst);
ret = filter_chain_AppendConverter(osys->converters, NULL, &dst);
ret = filter_chain_AppendConverter(osys->converters, &dst);
es_format_Clean(&dst);
if (ret == 0)
break;

View File

@ -850,7 +850,7 @@ static void ThreadChangeFilters(vout_thread_t *vout,
if (!es_format_IsSimilar(p_fmt_current, &fmt_target)) {
msg_Dbg(vout, "Adding a filter to compensate for format changes");
if (filter_chain_AppendConverter(vout->p->filter.chain_interactive,
NULL, &fmt_target) != 0) {
&fmt_target) != 0) {
msg_Err(vout, "Failed to compensate for the format changes, removing all filters");
ThreadDelAllFilterCallbacks(vout);
filter_chain_Reset(vout->p->filter.chain_static, &fmt_target, &fmt_target);
@ -979,7 +979,7 @@ static picture_t *ConvertRGB32AndBlend(vout_thread_t *vout, picture_t *pic,
filter_chain_Reset(filterc, &src, &dst);
if (filter_chain_AppendConverter(filterc, NULL, &dst) != 0)
if (filter_chain_AppendConverter(filterc, &dst) != 0)
{
filter_chain_Delete(filterc);
return NULL;