Date: Sun, 06 Feb 2011 20:39:41 -0800 From: Charlie Kester <corky1951@comcast.net> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/154565: [NEW PORT] py-mlt: python bindings for MLT framework Message-ID: <20110207043945.7C912106566C@hub.freebsd.org> Resent-Message-ID: <201102070440.p174e6du075551@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 154565 >Category: ports >Synopsis: [NEW PORT] py-mlt: python bindings for MLT framework >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Feb 07 04:40:06 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Charlie Kester >Release: FreeBSD 8.2-PRERELEASE i386 >Organization: >Environment: System: FreeBSD atom.local 8.2-PRERELEASE FreeBSD 8.2-PRERELEASE #0: Thu Feb 3 17:45:33 PST 2011 root@atom.local:/usr/obj/usr/src/sys/ATOM i386 >Description: Install the python bindings for the MLT framework (multimedia/mlt). mlt.i was borrowed from multimedia/mlt's ${WRKSRC}/src/swig directory, and the do-build steps are a lightly-modified version of the build script in that same ports's ${WRKSRC}/src/swig/python. The license of this port reflects the license info found in mlt.i >How-To-Repeat: >Fix: --- py-mlt.shar begins here --- # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # py-mlt # py-mlt/pkg-descr # py-mlt/Makefile # py-mlt/files # py-mlt/files/mlt.i # echo c - py-mlt mkdir -p py-mlt > /dev/null 2>&1 echo x - py-mlt/pkg-descr sed 's/^X//' >py-mlt/pkg-descr << 'e68892ed3ab7c94b43e9bbb91995bd94' XPython bindings for the MLT framework. X XMLT is an open source multimedia framework, designed and developed for Xtelevision broadcasting. It provides a toolkit for broadcasters, video Xeditors, media players, transcoders, web streamers and many more types Xof applications. The functionality of the system is provided via an Xassortment of ready to use tools, XML authoring components, and an Xextensible plug-in based API. X XWWW: http://www.mltframework.org e68892ed3ab7c94b43e9bbb91995bd94 echo x - py-mlt/Makefile sed 's/^X//' >py-mlt/Makefile << '29b2e87932a689d63459a853941c7a9d' X# ex:ts=8 X# Ports collection makefile for: mlt X# Date created: 2011-02-06 X# Whom: Charlie Kester <corky1951@comcast.net> X# X# $FreeBSD$ X# X XPORTNAME= mlt XPORTVERSION= 0.6.0 XCATEGORIES= multimedia python XMASTER_SITES= # empty XPKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} XDISTFILES= # none X XMAINTAINER= corky1951@comcast.net XCOMMENT= Python bindings for the MLT multimedia framework X XBUILD_DEPENDS= swig:${PORTSDIR}/devel/swig13 XLIB_DEPENDS= mlt.3:${PORTSDIR}/multimedia/mlt X XUSE_PYTHON= yes X XLICENSE= GPLv2 X XPLIST_FILES= %%PYTHON_SITELIBDIR%%/_mlt.so \ X %%PYTHON_SITELIBDIR%%/mlt.py X Xpost-patch: X @${MKDIR} ${WRKSRC} X @${CP} ${FILESDIR}/mlt.i ${WRKSRC} X Xdo-build: X (cd ${WRKSRC} && \ X swig -c++ -I${LOCALBASE}/include/mlt -I${LOCALBASE}/include/mlt++ -python mlt.i && \ X g++ -fPIC -D_GNU_SOURCE -c -rdynamic -pthread -I${LOCALBASE}/include -I${LOCALBASE}/include/mlt -I${PYTHON_INCLUDEDIR} mlt_wrap.cxx && \ X g++ -shared mlt_wrap.o -L${LOCALBASE}/lib -lmlt++ -o _mlt.so) X Xdo-install: X ${INSTALL_LIB} ${WRKSRC}/_mlt.so ${PYTHONPREFIX_SITELIBDIR} X ${INSTALL_SCRIPT} ${WRKSRC}/mlt.py ${PYTHONPREFIX_SITELIBDIR} X X.include <bsd.port.mk> 29b2e87932a689d63459a853941c7a9d echo c - py-mlt/files mkdir -p py-mlt/files > /dev/null 2>&1 echo x - py-mlt/files/mlt.i sed 's/^X//' >py-mlt/files/mlt.i << '67e0d1170794d930d7e0084564bf7b16' X/** X * mlt.i - Swig Bindings for mlt++ X * Copyright (C) 2004-2005 Charles Yates X * Author: Charles Yates <charles.yates@pandora.be> X * X * This program is free software; you can redistribute it and/or modify X * it under the terms of the GNU Lesser General Public License as published X * by the Free Software Foundation; either version 2 of the License, or X * (at your option) any later version. X * X * This program is distributed in the hope that it will be useful, X * but WITHOUT ANY WARRANTY; without even the implied warranty of X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X * GNU General Public License for more details. X * X * You should have received a copy of the GNU General Public License X * along with this program; if not, write to the Free Software Foundation, X * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. X */ X X%module mlt X%include "carrays.i" X%array_class(unsigned char, unsignedCharArray); X X%{ X#include <mlt++/Mlt.h> Xint mlt_log_get_level( void ); Xvoid mlt_log_set_level( int ); X%} X X/** These methods return objects which should be gc'd. X */ X Xnamespace Mlt { X%newobject Factory::init( const char * ); X%newobject Factory::producer( Profile &, char *, char * ); X%newobject Factory::filter( Profile &, char *, char * ); X%newobject Factory::transition( Profile &, char *, char * ); X%newobject Factory::consumer( Profile &, char *, char * ); X%newobject Properties::listen( const char *, void *, mlt_listener ); X%newobject Properties::setup_wait_for( const char * ); X%newobject Properties::parse_yaml( const char * ); X%newobject Service::producer( ); X%newobject Service::consumer( ); X%newobject Service::get_frame( int ); X%newobject Service::filter( int ); X%newobject Producer::filter( int ); X%newobject Producer::cut( int, int ); X%newobject Playlist::current( ); X%newobject Playlist::clip_info( int ); X%newobject Playlist::get_clip( int ); X%newobject Multitrack::track( int ); X%newobject Tractor::multitrack( ); X%newobject Tractor::field( ); X%newobject Tractor::track( int ); X%newobject Frame::get_original_producer( ); X%newobject Repository::consumers( ); X%newobject Repository::filters( ); X%newobject Repository::producers( ); X%newobject Repository::transitions( ); X%newobject Repository::metadata( mlt_service_type, const char * ); X%newobject Repository::languages( ); X} X X/** Classes to wrap. X */ X X%include <framework/mlt_types.h> X%include <framework/mlt_factory.h> X%include <framework/mlt_version.h> Xint mlt_log_get_level( void ); Xvoid mlt_log_set_level( int ); X%include <MltFactory.h> X%include <MltRepository.h> X%include <MltEvent.h> X%include <MltProperties.h> X%include <MltFrame.h> X%include <MltGeometry.h> X%include <MltService.h> X%include <MltProducer.h> X%include <MltProfile.h> X%include <MltPlaylist.h> X%include <MltConsumer.h> X%include <MltFilter.h> X%include <MltTransition.h> X%include <MltMultitrack.h> X%include <MltField.h> X%include <MltTractor.h> X%include <MltParser.h> X%include <MltFilteredConsumer.h> X X#if defined(SWIGRUBY) X X%{ X Xstatic void ruby_listener( mlt_properties owner, void *object ); X Xclass RubyListener X{ X private: X VALUE callback; X Mlt::Event *event; X X public: X RubyListener( Mlt::Properties &properties, char *id, VALUE callback ) : X callback( callback ) X { X event = properties.listen( id, this, ( mlt_listener )ruby_listener ); X } X X ~RubyListener( ) X { X delete event; X } X X void mark( ) X { X ((void (*)(VALUE))(rb_gc_mark))( callback ); X } X X void doit( ) X { X ID method = rb_intern( "call" ); X rb_funcall( callback, method, 0 ); X } X}; X Xstatic void ruby_listener( mlt_properties owner, void *object ) X{ X RubyListener *o = static_cast< RubyListener * >( object ); X o->doit( ); X} X Xvoid markRubyListener( void* p ) X{ X RubyListener *o = static_cast<RubyListener*>( p ); X o->mark( ); X} X X%} X X// Ruby wrapper X%rename( Listener ) RubyListener; X%markfunc RubyListener "markRubyListener"; X Xclass RubyListener X{ X public: X RubyListener( Mlt::Properties &properties, char *id, VALUE callback ); X}; X X#endif X X#if defined(SWIGPYTHON) X%{ Xtypedef struct { X int size; X char* data; X} binary_data; X Xbinary_data frame_get_waveform( Mlt::Frame &frame, int w, int h ) X{ X binary_data result = { X w * h, X (char*) frame.get_waveform( w, h ) X }; X return result; X} X X%} X X%typemap(out) binary_data { X $result = PyString_FromStringAndSize( $1.data, $1.size ); X} X Xbinary_data frame_get_waveform(Mlt::Frame&, int, int); X X#endif 67e0d1170794d930d7e0084564bf7b16 exit --- py-mlt.shar ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110207043945.7C912106566C>