From: lilo_booter Date: Mon, 16 Aug 2004 06:14:45 +0000 (+0000) Subject: Build and docs modifications X-Git-Url: http://research.m1stereo.tv/gitweb?a=commitdiff_plain;h=23ecec6406d4b4f953dfa72994169207a5fbb610;p=melted Build and docs modifications git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt++@364 d19143bc-622f-0410-bfdd-b5b2a6649095 --- diff --git a/mlt++/AUTHORS b/mlt++/AUTHORS new file mode 100644 index 0000000..437d8c1 --- /dev/null +++ b/mlt++/AUTHORS @@ -0,0 +1,8 @@ +MLT was developed by: + +Charles Yates +Dan Dennedy + +MLT++ was developed by + +Charles Yates diff --git a/mlt++/Makefile b/mlt++/Makefile new file mode 100644 index 0000000..a8a65ac --- /dev/null +++ b/mlt++/Makefile @@ -0,0 +1,3 @@ +all clean install: + $(MAKE) -C src $@ + diff --git a/mlt++/README b/mlt++/README new file mode 100644 index 0000000..26cc441 --- /dev/null +++ b/mlt++/README @@ -0,0 +1,92 @@ +MLT++ +----- + + This mlt sub-project provides a C++ wrapping for the MLT library. + +INSTALLATION +------------ + + ./configure [ --prefix=path ] + make + make install + +USAGE +----- + + Use the following definitions in a Makefile to compile and link with mlt++: + + CXXFLAGS=`mlt-config -Wall` + LDFLAGS=-lmlt++ + + All definitions are placed in an Mlt namespace, and adhere closely to the C + naming convention. Mappings always follow the pattern: + + Factory methods: + + mlt_factory_init => Mlt::Factory::init + mlt_factory_producer => Mlt::Factory::producer + etc + + Types: + + mlt_producer ==> Mlt::Producer + mlt_consumer ==> Mlt::Consumer + etc + + Methods: + + mlt_type_method ==> Mlt:Type.method + ie: mlt_playlist_append ==> Mlt::Playlist.append + etc + + Enumerators and macros are reused directly from the C library. + +CLASS HIERARCHY +--------------- + + The currently mapped objects are shown in the following hierarchy: + + Factory + Properties + Frame + Service + Consumer + Filter + Producer + Playlist + Transition + +SPECIAL CASES +------------- + + Care should be taken with wrapper objects. + + Taking, as an example, the C function that returns the immediate consumer of + a service: + + mlt_service mlt_service_consumer( mlt_service ); + + This maps to: + + Mlt::Service *Mlt::Service.consumer( ); + + Note that you get an object back - it is never the original object, but a + wrapping object. This is done to keep consistency with the C api which may + instantiate C instances - therefore there it cannot be assumed that a C++ + object exists for all mlt service instances. + + As such, it is mandatory that you delete these objects. The original will + not be affected. Further to that, all modifications (to properties or its + state of connection) will be reflected in the original object. + + This excludes the use of the RTTI to determine the real type of the object - + this can only be done by parsing the objects properties. + +LIMITATIONS +----------- + + The mechanisms for the definition of new services have deliberately not + been exposed by the C++ wrappings - this is done to ensure that service + networks constructed can be serialised and used by existing applications + which are based on the C API (such as miracle). + diff --git a/mlt++/configure b/mlt++/configure new file mode 100755 index 0000000..8cda969 --- /dev/null +++ b/mlt++/configure @@ -0,0 +1,18 @@ +#!/bin/sh + +path=`which mlt-config 2>/dev/null` +[ $? != 0 ] && echo "MLT not installed - aborting" && exit 1 + +# Determine default prefix +prefix=`dirname $path` +prefix=`dirname $prefix` + +# Allow override from command line +[ "$1" != "" ] && prefix="${1#--prefix=}" + +# Sanity check +[ ! -d "$prefix" ] && echo "Invalid prefix $prefix - aborting" && exit 1 + +echo "prefix=$prefix" > config.mak +echo "MLT++ configured - installed in $prefix." + diff --git a/mlt++/src/Makefile b/mlt++/src/Makefile index a52bde9..d4161ad 100644 --- a/mlt++/src/Makefile +++ b/mlt++/src/Makefile @@ -1,4 +1,4 @@ -prefix = /usr/local +include ../config.mak CXXFLAGS = -Wall -pthread `mlt-config --cflags` LDFLAGS = `mlt-config --libs` INSTALL = install @@ -33,3 +33,5 @@ install: $(INSTALL) -m 755 $(TARGET) $(prefix)/lib $(INSTALL) -d "$(prefix)/include/mlt++" $(INSTALL) -m 644 $(HEADERS) "$(prefix)/include/mlt++" + /sbin/ldconfig || exit 0 + diff --git a/mlt++/src/MltService.cpp b/mlt++/src/MltService.cpp index b836bea..03f8261 100644 --- a/mlt++/src/MltService.cpp +++ b/mlt++/src/MltService.cpp @@ -33,12 +33,18 @@ int Service::connect_producer( Service &producer, int index ) Service *Service::producer( ) { - return new ServiceInstance( mlt_service_producer( get_service( ) ) ); + if ( get_service( ) != NULL ) + return new ServiceInstance( mlt_service_producer( get_service( ) ) ); + else + return NULL; } Service *Service::consumer( ) { - return new ServiceInstance( mlt_service_consumer( get_service( ) ) ); + if ( get_service( ) != NULL ) + return new ServiceInstance( mlt_service_consumer( get_service( ) ) ); + else + return NULL; } Frame *Service::get_frame( int index ) diff --git a/mlt++/test/play.cpp b/mlt++/test/play.cpp index 4f08026..5920a4b 100644 --- a/mlt++/test/play.cpp +++ b/mlt++/test/play.cpp @@ -18,14 +18,13 @@ int main( int argc, char **argv ) filter->connect( *producer ); consumer->connect( *filter ); consumer->start( ); + struct timespec tm = { 1, 0 }; while ( !consumer->is_stopped( ) ) - { - struct timespec tm = { 1, 0 }; nanosleep( &tm, NULL ); - } consumer->stop( ); delete consumer; delete producer; delete filter; + Factory::close( ); return 0; }