+ {
+ const char* service_name = mlt_properties_get_name( services, j );
+ if( !is_service_hidden(repo, type, service_name ) )
+ fprintf( stdout, " - %s\n", service_name );
+ }
+ }
+ fprintf( stdout, "...\n" );
+}
+
+static void query_profiles()
+{
+ mlt_properties profiles = mlt_profile_list();
+ fprintf( stdout, "---\nprofiles:\n" );
+ if ( profiles )
+ {
+ int j;
+ for ( j = 0; j < mlt_properties_count( profiles ); j++ )
+ fprintf( stdout, " - %s\n", mlt_properties_get_name( profiles, j ) );
+ }
+ fprintf( stdout, "...\n" );
+ mlt_properties_close( profiles );
+}
+
+static void query_profile( const char *id )
+{
+ mlt_properties profiles = mlt_profile_list();
+ mlt_properties profile = mlt_properties_get_data( profiles, id, NULL );
+ if ( profile )
+ {
+ char *s = mlt_properties_serialise_yaml( profile );
+ fprintf( stdout, "%s", s );
+ free( s );
+ }
+ else
+ {
+ fprintf( stdout, "# No metadata for profile \"%s\"\n", id );
+ }
+ mlt_properties_close( profiles );
+}
+
+static void query_presets()
+{
+ mlt_properties presets = mlt_repository_presets();
+ fprintf( stdout, "---\npresets:\n" );
+ if ( presets )
+ {
+ int j;
+ for ( j = 0; j < mlt_properties_count( presets ); j++ )
+ fprintf( stdout, " - %s\n", mlt_properties_get_name( presets, j ) );
+ }
+ fprintf( stdout, "...\n" );
+ mlt_properties_close( presets );
+}
+
+static void query_preset( const char *id )
+{
+ mlt_properties presets = mlt_repository_presets();
+ mlt_properties preset = mlt_properties_get_data( presets, id, NULL );
+ if ( preset )
+ {
+ char *s = mlt_properties_serialise_yaml( preset );
+ fprintf( stdout, "%s", s );
+ free( s );
+ }
+ else
+ {
+ fprintf( stdout, "# No metadata for preset \"%s\"\n", id );
+ }
+ mlt_properties_close( presets );
+}
+
+static void query_formats( )
+{
+ mlt_consumer consumer = mlt_factory_consumer( NULL, "avformat", NULL );
+ if ( consumer )
+ {
+ mlt_properties_set( MLT_CONSUMER_PROPERTIES(consumer), "f", "list" );
+ mlt_consumer_start( consumer );
+ mlt_consumer_close( consumer );
+ }
+ else
+ {
+ fprintf( stdout, "# No formats - failed to load avformat consumer\n" );
+ }
+}
+
+static void query_acodecs( )
+{
+ mlt_consumer consumer = mlt_factory_consumer( NULL, "avformat", NULL );
+ if ( consumer )
+ {
+ mlt_properties_set( MLT_CONSUMER_PROPERTIES(consumer), "acodec", "list" );
+ mlt_consumer_start( consumer );
+ mlt_consumer_close( consumer );
+ }
+ else
+ {
+ fprintf( stdout, "# No audio codecs - failed to load avformat consumer\n" );