Commit 5a462784 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: video filter helper for getting the filter type

Ref #11613

(cherry picked from commit 78ea3f23df02fa470d0d9de50ab9306348014d2f)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent a5b13591
...@@ -354,39 +354,34 @@ static void ChangeAFiltersString( struct intf_thread_t *p_intf, const char *psz_ ...@@ -354,39 +354,34 @@ static void ChangeAFiltersString( struct intf_thread_t *p_intf, const char *psz_
free( psz_string ); free( psz_string );
} }
static void ChangeVFiltersString( struct intf_thread_t *p_intf, const char *psz_name, bool b_add ) static const char* GetVFilterType( struct intf_thread_t *p_intf, const char *psz_name )
{ {
char *psz_string;
const char *psz_filter_type;
module_t *p_obj = module_find( psz_name ); module_t *p_obj = module_find( psz_name );
if( !p_obj ) if( !p_obj )
{ {
msg_Err( p_intf, "Unable to find filter module \"%s\".", psz_name ); msg_Err( p_intf, "Unable to find filter module \"%s\".", psz_name );
return; return NULL;
} }
if( module_provides( p_obj, "video splitter" ) ) if( module_provides( p_obj, "video splitter" ) )
{ return "video-splitter";
psz_filter_type = "video-splitter";
}
else if( module_provides( p_obj, "video filter2" ) ) else if( module_provides( p_obj, "video filter2" ) )
{ return "video-filter";
psz_filter_type = "video-filter";
}
else if( module_provides( p_obj, "sub source" ) ) else if( module_provides( p_obj, "sub source" ) )
{ return "sub-source";
psz_filter_type = "sub-source";
}
else if( module_provides( p_obj, "sub filter" ) ) else if( module_provides( p_obj, "sub filter" ) )
{ return "sub-filter";
psz_filter_type = "sub-filter";
}
else else
{ {
msg_Err( p_intf, "Unknown video filter type." ); msg_Err( p_intf, "Unknown video filter type." );
return; return NULL;
} }
}
static void ChangeVFiltersString( struct intf_thread_t *p_intf, const char *psz_name, bool b_add )
{
char *psz_string;
const char *psz_filter_type = GetVFilterType( p_intf, psz_name );
psz_string = ChangeFiltersString( p_intf, psz_filter_type, psz_name, b_add ); psz_string = ChangeFiltersString( p_intf, psz_filter_type, psz_name, b_add );
if( !psz_string ) if( !psz_string )
......
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