X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Favformat%2Ffactory.c;fp=src%2Fmodules%2Favformat%2Ffactory.c;h=2b6d234ba4028bb3e0653acbbedabdd4b65b663f;hb=6fd86f1596d75ebaa4703ca6e9735813331e5c2f;hp=fe2d65f2e487ecd63770b44c9200992af3128626;hpb=f036d9cbc8d532ba82db51142b749f370c28d2b5;p=melted diff --git a/src/modules/avformat/factory.c b/src/modules/avformat/factory.c index fe2d65f..2b6d234 100644 --- a/src/modules/avformat/factory.c +++ b/src/modules/avformat/factory.c @@ -20,6 +20,7 @@ #include #include +#include #include @@ -113,6 +114,31 @@ static void *create_service( mlt_profile profile, mlt_service_type type, const c return NULL; } +static mlt_properties avformat_metadata( mlt_service_type type, const char *id, void *data ) +{ + char file[ PATH_MAX ]; + char *service_type = NULL; + switch ( type ) + { + case consumer_type: + service_type = "consumer"; + break; + case filter_type: + service_type = "filter"; + break; + case producer_type: + service_type = "producer"; + break; + case transition_type: + service_type = "transition"; + break; + default: + return NULL; + } + snprintf( file, PATH_MAX, "%s/avformat/%s_%s.yml", mlt_environment( "MLT_DATA" ), service_type, id ); + return mlt_properties_parse_yaml( file ); +} + MLT_REPOSITORY { MLT_REGISTER( consumer_type, "avformat", create_service ); @@ -121,4 +147,6 @@ MLT_REPOSITORY MLT_REGISTER( filter_type, "avcolor_space", create_service ); MLT_REGISTER( filter_type, "avdeinterlace", create_service ); MLT_REGISTER( filter_type, "avresample", create_service ); + + MLT_REGISTER_METADATA( producer_type, "avformat", avformat_metadata, NULL ); }