swig/configure, swig/php/*: add php bindings
authorddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 26 Jan 2009 18:32:03 +0000 (18:32 +0000)
committerddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 26 Jan 2009 18:32:03 +0000 (18:32 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt++@1325 d19143bc-622f-0410-bfdd-b5b2a6649095

mlt++/swig/configure
mlt++/swig/php/build [new file with mode: 0644]
mlt++/swig/php/play.php [new file with mode: 0755]

index 971a5c2..794113a 100755 (executable)
@@ -7,14 +7,14 @@ pkg-config mlt-framework --cflags > /dev/null 2>&1
 [ $? != 0 ] && echo "Please install mlt" && exit 1
 
 if [ "$1" = "all" ]
-then languages="perl python ruby tcl"
+then languages="perl php python ruby tcl"
 elif [ "$1" != "" ]
 then languages=$*
 else echo "Usage: ./configure [ all | language * ]"
         exit 0
 fi
 
-for i in perl python ruby tcl
+for i in perl php python ruby tcl
 do
        rm -f .$i
 done
diff --git a/mlt++/swig/php/build b/mlt++/swig/php/build
new file mode 100644 (file)
index 0000000..a06ed48
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+ln -s ../mltpp.i
+swig -c++ -I../../src `pkg-config --cflags mlt-framework` -php5 -noproxy mltpp.i
+g++ -fPIC -DPIC -D_GNU_SOURCE -c -rdynamic -pthread `pkg-config --cflags mlt-framework` `php-config --includes` mltpp_wrap.cpp
+
diff --git a/mlt++/swig/php/play.php b/mlt++/swig/php/play.php
new file mode 100755 (executable)
index 0000000..7cfa2fd
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+$filename = $argv[1];
+dl("mltpp.so");
+mlt_factory_init(NULL);
+$profile = new_profile("dv_ntsc");
+$p = new_producer( $profile, $filename );
+if ( $p ) {
+       $c = new_consumer( $profile, "sdl" );
+       consumer_connect( $c, $p );
+       $e = properties_setup_wait_for( $c, "consumer-stopped" );
+       consumer_start( $c );
+       properties_wait_for( $c, $e );
+       consumer_stop( $c );
+       $e = NULL;
+       $c = NULL;
+}
+$p = NULL;
+$profile = NULL;
+mlt_factory_close();
+?>
+