Commit e7eaa33c authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Add filter_chain_AppendConverter()

parent da9ae5d6
......@@ -310,7 +310,7 @@ VLC_API void filter_chain_Delete( filter_chain_t * );
VLC_API void filter_chain_Reset( filter_chain_t *, const es_format_t *, const es_format_t * );
/**
* Append filter to the end of the chain.
* Append a filter to the chain.
*
* \param chain filter chain to append a filter to
* \param name filter name
......@@ -322,6 +322,18 @@ VLC_API filter_t *filter_chain_AppendFilter(filter_chain_t *chain,
const char *name, config_chain_t *cfg, const es_format_t *fmt_in,
const es_format_t *fmt_out);
/**
* 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);
/**
* Append new filter to filter chain from string.
*
......
......@@ -108,6 +108,7 @@ es_format_Init
es_format_InitFromVideo
es_format_IsSimilar
filter_Blend
filter_chain_AppendConverter
filter_chain_AppendFilter
filter_chain_AppendFromString
filter_chain_Delete
......
......@@ -241,10 +241,9 @@ static filter_t *filter_chain_AppendInner( filter_chain_t *chain,
error:
if( name != NULL )
msg_Err( parent, "Failed to create %s '%s'", chain->filter_cap,
name );
msg_Err( parent, "Failed to create %s '%s'", capability, name );
else
msg_Err( parent, "Failed to create %s", chain->filter_cap );
msg_Err( parent, "Failed to create %s", capability );
es_format_Clean( &filter->fmt_out );
es_format_Clean( &filter->fmt_in );
vlc_object_release( filter );
......@@ -259,6 +258,13 @@ filter_t *filter_chain_AppendFilter( filter_chain_t *chain,
fmt_in, fmt_out );
}
int filter_chain_AppendConverter( filter_chain_t *chain,
const es_format_t *fmt_in, const es_format_t *fmt_out )
{
return filter_chain_AppendInner( chain, NULL, chain->filter_cap, NULL,
fmt_in, fmt_out ) != NULL ? 0 : -1;
}
void filter_chain_DeleteFilter( filter_chain_t *chain, filter_t *filter )
{
vlc_object_t *obj = chain->callbacks.sys;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment