/usr/include/mlt++/mlt.i is in libmlt++-dev 0.9.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | /**
* mlt.i - Swig Bindings for mlt++
* Copyright (C) 2004-2005 Charles Yates
* Author: Charles Yates <charles.yates@pandora.be>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
%module mlt
%include "carrays.i"
%array_class(unsigned char, unsignedCharArray);
%{
#include <mlt++/Mlt.h>
int mlt_log_get_level( void );
void mlt_log_set_level( int );
%}
/** These methods return objects which should be gc'd.
*/
namespace Mlt {
%newobject Factory::init( const char * );
%newobject Factory::producer( Profile &, char *, char * );
%newobject Factory::filter( Profile &, char *, char * );
%newobject Factory::transition( Profile &, char *, char * );
%newobject Factory::consumer( Profile &, char *, char * );
%newobject Properties::listen( const char *, void *, mlt_listener );
%newobject Properties::setup_wait_for( const char * );
%newobject Properties::parse_yaml( const char * );
%newobject Service::producer( );
%newobject Service::consumer( );
%newobject Service::get_frame( int );
%newobject Service::filter( int );
%newobject Producer::filter( int );
%newobject Producer::cut( int, int );
%newobject Playlist::current( );
%newobject Playlist::clip_info( int );
%newobject Playlist::get_clip( int );
%newobject Multitrack::track( int );
%newobject Tractor::multitrack( );
%newobject Tractor::field( );
%newobject Tractor::track( int );
%newobject Frame::get_original_producer( );
%newobject Repository::consumers( );
%newobject Repository::filters( );
%newobject Repository::producers( );
%newobject Repository::transitions( );
%newobject Repository::metadata( mlt_service_type, const char * );
%newobject Repository::languages( );
%newobject Profile::list();
%newobject Repository::presets();
#if defined(SWIGPYTHON)
%feature("shadow") Frame::get_waveform(int, int) %{
def get_waveform(*args): return _mlt.frame_get_waveform(*args)
%}
%feature("shadow") Frame::get_image(mlt_image_format&, int&, int&) %{
def get_image(*args): return _mlt.frame_get_image(*args)
%}
#endif
}
/** Classes to wrap.
*/
%include <framework/mlt_types.h>
%include <framework/mlt_factory.h>
%include <framework/mlt_version.h>
int mlt_log_get_level( void );
void mlt_log_set_level( int );
%include <MltFactory.h>
%include <MltRepository.h>
%include <MltEvent.h>
%include <MltProperties.h>
%include <MltFrame.h>
%include <MltGeometry.h>
%include <MltService.h>
%include <MltProducer.h>
%include <MltProfile.h>
%include <MltPlaylist.h>
%include <MltConsumer.h>
%include <MltFilter.h>
%include <MltTransition.h>
%include <MltMultitrack.h>
%include <MltField.h>
%include <MltTractor.h>
%include <MltParser.h>
%include <MltFilteredConsumer.h>
#if defined(SWIGRUBY)
%{
static void ruby_listener( mlt_properties owner, void *object );
class RubyListener
{
protected:
VALUE callback;
Mlt::Event *event;
public:
RubyListener( VALUE callback ) : callback( callback )
{}
RubyListener( Mlt::Properties &properties, char *id, VALUE callback ) :
callback( callback )
{
event = properties.listen( id, this, ( mlt_listener )ruby_listener );
}
virtual ~RubyListener( )
{
delete event;
}
void mark( )
{
((void (*)(VALUE))(rb_gc_mark))( callback );
}
void doit( )
{
ID method = rb_intern( "call" );
rb_funcall( callback, method, 0 );
}
};
static void ruby_listener( mlt_properties owner, void *object )
{
RubyListener *o = static_cast< RubyListener * >( object );
o->doit( );
}
void markRubyListener( void* p )
{
RubyListener *o = static_cast<RubyListener*>( p );
o->mark( );
}
static void on_playlist_next( mlt_properties owner, void *object, int i );
class PlaylistNextListener : RubyListener
{
private:
Mlt::Event *event;
public:
PlaylistNextListener( Mlt::Properties *properties, VALUE proc )
: RubyListener( proc )
{
event = properties->listen( "playlist-next", this, ( mlt_listener )on_playlist_next );
}
~PlaylistNextListener()
{
delete event;
}
void yield( int i )
{
ID method = rb_intern( "call" );
rb_funcall( callback, method, 1, INT2FIX( i ) );
}
};
static void on_playlist_next( mlt_properties owner, void *object, int i )
{
PlaylistNextListener *o = static_cast< PlaylistNextListener * >( object );
o->yield( i );
}
%}
// Ruby wrapper
%rename( Listener ) RubyListener;
%markfunc RubyListener "markRubyListener";
%markfunc PlaylistNextListener "markRubyListener";
class RubyListener
{
public:
RubyListener( Mlt::Properties &properties, char *id, VALUE callback );
};
class PlaylistNextListener
{
public:
PlaylistNextListener( Mlt::Properties *properties, VALUE proc );
};
#endif // SWIGGRUBY
#if defined(SWIGPYTHON)
%{
typedef struct {
int size;
char* data;
} binary_data;
binary_data frame_get_waveform( Mlt::Frame &frame, int w, int h )
{
binary_data result = {
w * h,
(char*) frame.get_waveform( w, h )
};
return result;
}
binary_data frame_get_image( Mlt::Frame &frame, mlt_image_format format, int w, int h )
{
binary_data result = {
mlt_image_format_size( format, w, h, NULL ),
(char*) frame.get_image( format, w, h )
};
return result;
}
%}
%typemap(out) binary_data {
$result = PyString_FromStringAndSize( $1.data, $1.size );
}
binary_data frame_get_waveform(Mlt::Frame&, int, int);
binary_data frame_get_image(Mlt::Frame&, mlt_image_format, int, int);
#endif
|