X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=mlt%2B%2B%2Fsrc%2FMltService.cpp;h=88751ab54f325dfc9e0c8247463ab3a18d809d31;hb=55757b000043f6e370b9e963ce2e3542962c03c0;hp=b20b6b1610c1399f8f8c4a08baa4962e7c8902b0;hpb=36d013c2a170699e957cde8e65d161714cbd16cb;p=melted diff --git a/mlt++/src/MltService.cpp b/mlt++/src/MltService.cpp index b20b6b1..88751ab 100644 --- a/mlt++/src/MltService.cpp +++ b/mlt++/src/MltService.cpp @@ -21,6 +21,7 @@ #include #include "MltService.h" #include "MltFilter.h" +#include "MltProfile.h" using namespace Mlt; Service::Service( ) : @@ -58,6 +59,16 @@ mlt_properties Service::get_properties( ) return mlt_service_properties( get_service( ) ); } +void Service::lock( ) +{ + mlt_service_lock( get_service( ) ); +} + +void Service::unlock( ) +{ + mlt_service_unlock( get_service( ) ); +} + int Service::connect_producer( Service &producer, int index ) { return mlt_service_connect_producer( get_service( ), producer.get_service( ), index ); @@ -73,6 +84,11 @@ Service *Service::consumer( ) return new Service( mlt_service_consumer( get_service( ) ) ); } +Profile *Service::profile( ) +{ + return new Profile( mlt_service_profile( get_service() ) ); +} + Frame *Service::get_frame( int index ) { mlt_frame frame = NULL; @@ -82,38 +98,9 @@ Frame *Service::get_frame( int index ) return result; } -service_type Service::type( ) -{ - service_type type = invalid_type; - if ( is_valid( ) ) - { - char *mlt_type = get( "mlt_type" ); - char *resource = get( "resource" ); - if ( mlt_type == NULL ) - type = unknown_type; - else if ( !strcmp( mlt_type, "producer" ) ) - type = producer_type; - else if ( !strcmp( mlt_type, "mlt_producer" ) ) - { - if ( resource == NULL ) - type = producer_type; - else if ( !strcmp( resource, "" ) ) - type = playlist_type; - else if ( !strcmp( resource, "" ) ) - type = tractor_type; - else if ( !strcmp( resource, "" ) ) - type = multitrack_type; - } - else if ( !strcmp( mlt_type, "filter" ) ) - type = filter_type; - else if ( !strcmp( mlt_type, "transition" ) ) - type = transition_type; - else if ( !strcmp( mlt_type, "consumer" ) ) - type = consumer_type; - else - type = unknown_type; - } - return type; +mlt_service_type Service::type( ) +{ + return mlt_service_identify( get_service( ) ); } int Service::attach( Filter &filter ) @@ -128,6 +115,7 @@ int Service::detach( Filter &filter ) Filter *Service::filter( int index ) { - return new Filter( mlt_service_filter( get_service( ), index ) ); + mlt_filter result = mlt_service_filter( get_service( ), index ); + return result == NULL ? NULL : new Filter( result ); }