From: lilo_booter Date: Thu, 23 Feb 2006 09:49:30 +0000 (+0000) Subject: + Win32 port - dev studio is required to avoid issues with C++ ABI compatibility X-Git-Url: http://research.m1stereo.tv/gitweb?a=commitdiff_plain;h=47fb1506a99bae1c9cb90f313176f9dab58d5854;p=melted + Win32 port - dev studio is required to avoid issues with C++ ABI compatibility + Fix for image render in NTSC NB: mlt patch to follow (this one isn't much use without it :-)) - mlt build is purely mingw32 of course git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt++@891 d19143bc-622f-0410-bfdd-b5b2a6649095 --- diff --git a/mlt++/mlt++.sln b/mlt++/mlt++.sln new file mode 100644 index 0000000..1820fb8 --- /dev/null +++ b/mlt++/mlt++.sln @@ -0,0 +1,21 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mlt++", "mlt++.vcproj", "{31B6CBDB-6A84-4BC7-AACF-A1BCE02444FD}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {31B6CBDB-6A84-4BC7-AACF-A1BCE02444FD}.Debug.ActiveCfg = Debug|Win32 + {31B6CBDB-6A84-4BC7-AACF-A1BCE02444FD}.Debug.Build.0 = Debug|Win32 + {31B6CBDB-6A84-4BC7-AACF-A1BCE02444FD}.Release.ActiveCfg = Release|Win32 + {31B6CBDB-6A84-4BC7-AACF-A1BCE02444FD}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/mlt++/mlt++.vcproj b/mlt++/mlt++.vcproj new file mode 100644 index 0000000..6faedb5 --- /dev/null +++ b/mlt++/mlt++.vcproj @@ -0,0 +1,265 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mlt++/src/Mlt.h b/mlt++/src/Mlt.h index 17621c8..7abb1dc 100644 --- a/mlt++/src/Mlt.h +++ b/mlt++/src/Mlt.h @@ -30,14 +30,18 @@ #include "MltFilteredConsumer.h" #include "MltFrame.h" #include "MltGeometry.h" +#ifndef WIN32 #include "MltMiracle.h" +#endif #include "MltMultitrack.h" #include "MltParser.h" #include "MltPlaylist.h" #include "MltProducer.h" #include "MltProperties.h" #include "MltPushConsumer.h" +#ifndef WIN32 #include "MltResponse.h" +#endif #include "MltService.h" #include "MltTokeniser.h" #include "MltTractor.h" diff --git a/mlt++/src/MltConsumer.h b/mlt++/src/MltConsumer.h index 17eda60..dc4c87d 100644 --- a/mlt++/src/MltConsumer.h +++ b/mlt++/src/MltConsumer.h @@ -21,6 +21,8 @@ #ifndef _MLTPP_CONSUMER_H_ #define _MLTPP_CONSUMER_H_ +#include "config.h" + #include #include "MltService.h" @@ -29,7 +31,7 @@ namespace Mlt { class Service; - class Consumer : public Service + class MLTPP_DECLSPEC Consumer : public Service { private: mlt_consumer instance; diff --git a/mlt++/src/MltDeque.h b/mlt++/src/MltDeque.h index 5323fd6..155bfd6 100644 --- a/mlt++/src/MltDeque.h +++ b/mlt++/src/MltDeque.h @@ -21,11 +21,13 @@ #ifndef _MLTPP_DEQUE_H #define _MLTPP_DEQUE_H +#include "config.h" + #include namespace Mlt { - class Deque + class MLTPP_DECLSPEC Deque { private: mlt_deque deque; diff --git a/mlt++/src/MltEvent.h b/mlt++/src/MltEvent.h index 66b189f..92b3917 100644 --- a/mlt++/src/MltEvent.h +++ b/mlt++/src/MltEvent.h @@ -21,11 +21,13 @@ #ifndef _MLTPP_EVENT_H_ #define _MLTPP_EVENT_H_ +#include "config.h" + #include namespace Mlt { - class Event + class MLTPP_DECLSPEC Event { private: mlt_event instance; diff --git a/mlt++/src/MltFactory.cpp b/mlt++/src/MltFactory.cpp index 51aa7f9..f32018a 100644 --- a/mlt++/src/MltFactory.cpp +++ b/mlt++/src/MltFactory.cpp @@ -55,6 +55,18 @@ Consumer *Factory::consumer( char *id, char *arg ) return new Consumer( id, arg ); } +#ifdef WIN32 +char *Factory::getenv( const char *name ) +{ + return mlt_getenv( name ); +} + +int Factory::setenv( const char *name, const char *value ) +{ + return mlt_setenv( name, value ); +} +#endif + void Factory::close( ) { mlt_factory_close( ); diff --git a/mlt++/src/MltFactory.h b/mlt++/src/MltFactory.h index 0128698..f493c74 100644 --- a/mlt++/src/MltFactory.h +++ b/mlt++/src/MltFactory.h @@ -21,6 +21,8 @@ #ifndef _MLTPP_FACTORY_H_ #define _MLTPP_FACTORY_H_ +#include "config.h" + #include namespace Mlt @@ -31,7 +33,7 @@ namespace Mlt class Transition; class Consumer; - class Factory + class MLTPP_DECLSPEC Factory { public: static int init( char *arg = NULL ); @@ -40,6 +42,10 @@ namespace Mlt static Filter *filter( char *id, char *arg = NULL ); static Transition *transition( char *id, char *arg = NULL ); static Consumer *consumer( char *id, char *arg = NULL ); +#ifdef WIN32 + static char *getenv( const char * ); + static int setenv( const char *, const char * ); +#endif static void close( ); }; } diff --git a/mlt++/src/MltField.h b/mlt++/src/MltField.h index 67a631b..06e2d46 100644 --- a/mlt++/src/MltField.h +++ b/mlt++/src/MltField.h @@ -21,6 +21,8 @@ #ifndef _MLTPP_FIELD_H_ #define _MLTPP_FIELD_H_ +#include "config.h" + #include #include "MltService.h" @@ -31,7 +33,7 @@ namespace Mlt class Filter; class Transition; - class Field : public Service + class MLTPP_DECLSPEC Field : public Service { private: mlt_field instance; diff --git a/mlt++/src/MltFilter.h b/mlt++/src/MltFilter.h index ac0a720..3be254c 100644 --- a/mlt++/src/MltFilter.h +++ b/mlt++/src/MltFilter.h @@ -21,6 +21,8 @@ #ifndef _MLTPP_FILTER_H_ #define _MLTPP_FILTER_H_ +#include "config.h" + #include #include "MltService.h" @@ -29,7 +31,7 @@ namespace Mlt { class Service; - class Filter : public Service + class MLTPP_DECLSPEC Filter : public Service { private: mlt_filter instance; diff --git a/mlt++/src/MltFilteredConsumer.h b/mlt++/src/MltFilteredConsumer.h index 1e48a36..f1c1fff 100644 --- a/mlt++/src/MltFilteredConsumer.h +++ b/mlt++/src/MltFilteredConsumer.h @@ -21,6 +21,8 @@ #ifndef _MLTPP_FILTERED_CONSUMER_H_ #define _MLTPP_FILTERED_CONSUMER_H_ +#include "config.h" + #include "MltConsumer.h" #include "MltFilter.h" #include "MltService.h" @@ -31,7 +33,7 @@ namespace Mlt class Service; class Filter; - class FilteredConsumer : public Consumer + class MLTPP_DECLSPEC FilteredConsumer : public Consumer { private: Service *first; diff --git a/mlt++/src/MltFilteredProducer.h b/mlt++/src/MltFilteredProducer.h index a13a0d3..ce76c86 100644 --- a/mlt++/src/MltFilteredProducer.h +++ b/mlt++/src/MltFilteredProducer.h @@ -21,6 +21,8 @@ #ifndef _MLTPP_FILTERED_PRODUCER_H_ #define _MLTPP_FILTERED_PRODUCER_H_ +#include "config.h" + #include "MltProducer.h" #include "MltFilter.h" #include "MltService.h" @@ -31,7 +33,7 @@ namespace Mlt class Service; class Filter; - class FilteredProducer : public Producer + class MLTPP_DECLSPEC FilteredProducer : public Producer { private: Service *last; diff --git a/mlt++/src/MltFrame.cpp b/mlt++/src/MltFrame.cpp index 546220d..5d974ce 100644 --- a/mlt++/src/MltFrame.cpp +++ b/mlt++/src/MltFrame.cpp @@ -52,8 +52,8 @@ mlt_properties Frame::get_properties( ) uint8_t *Frame::get_image( mlt_image_format &format, int &w, int &h, int writable ) { uint8_t *image = NULL; - if ( mlt_properties_get_int( get_properties( ), "consumer_aspect_ratio" ) == 0 ) - mlt_properties_set_int( get_properties( ), "consumer_aspect_ratio", 1 ); + if ( get_double( "consumer_aspect_ratio" ) == 0.0 ) + set( "consumer_aspect_ratio", 1.0 ); mlt_frame_get_image( get_frame( ), &image, &format, &w, &h, writable ); set( "format", format ); set( "writable", writable ); @@ -63,8 +63,8 @@ uint8_t *Frame::get_image( mlt_image_format &format, int &w, int &h, int writabl unsigned char *Frame::fetch_image( mlt_image_format f, int w, int h, int writable ) { uint8_t *image = NULL; - if ( mlt_properties_get_int( get_properties( ), "consumer_aspect_ratio" ) == 0 ) - mlt_properties_set_int( get_properties( ), "consumer_aspect_ratio", 1 ); + if ( get_double( "consumer_aspect_ratio" ) == 0.0 ) + set( "consumer_aspect_ratio", 1.0 ); mlt_frame_get_image( get_frame( ), &image, &f, &w, &h, writable ); set( "format", f ); set( "writable", writable ); diff --git a/mlt++/src/MltFrame.h b/mlt++/src/MltFrame.h index 030ae0d..9d564ab 100644 --- a/mlt++/src/MltFrame.h +++ b/mlt++/src/MltFrame.h @@ -21,6 +21,8 @@ #ifndef _MLTPP_FRAME_H_ #define _MLTPP_FRAME_H_ +#include "config.h" + #include #include "MltProperties.h" @@ -29,7 +31,7 @@ namespace Mlt class Properties; class Producer; - class Frame : public Properties + class MLTPP_DECLSPEC Frame : public Properties { private: mlt_frame instance; diff --git a/mlt++/src/MltGeometry.h b/mlt++/src/MltGeometry.h index fea20e1..0105467 100644 --- a/mlt++/src/MltGeometry.h +++ b/mlt++/src/MltGeometry.h @@ -21,18 +21,20 @@ #ifndef _MLTPP_GEOMETRY_H #define _MLTPP_GEOMETRY_H +#include "config.h" + #include namespace Mlt { // Just for consistent naming purposes - class GeometryItem + class MLTPP_DECLSPEC GeometryItem { private: struct mlt_geometry_item_s item; public: mlt_geometry_item get_item( ) { return &item; } - bool key( ) { return item.key; } + bool key( ) { return item.key != 0; } int frame( ) { return item.frame; } void frame( int value ) { item.frame = value; } float x( ) { return item.x; } @@ -47,7 +49,7 @@ namespace Mlt void mix( float value ) { item.f[4] = 1; item.mix = value; } }; - class Geometry + class MLTPP_DECLSPEC Geometry { private: mlt_geometry geometry; diff --git a/mlt++/src/MltMultitrack.h b/mlt++/src/MltMultitrack.h index 5d43468..75a49fa 100644 --- a/mlt++/src/MltMultitrack.h +++ b/mlt++/src/MltMultitrack.h @@ -21,6 +21,8 @@ #ifndef _MLTPP_MULTITRACK_H_ #define _MLTPP_MULTITRACK_H_ +#include "config.h" + #include #include "MltProducer.h" @@ -30,7 +32,7 @@ namespace Mlt class Service; class Producer; - class Multitrack : public Producer + class MLTPP_DECLSPEC Multitrack : public Producer { private: mlt_multitrack instance; diff --git a/mlt++/src/MltParser.h b/mlt++/src/MltParser.h index 397834e..b7ffc46 100644 --- a/mlt++/src/MltParser.h +++ b/mlt++/src/MltParser.h @@ -21,6 +21,8 @@ #ifndef _MLTPP_PARSER_H_ #define _MLTPP_PARSER_H_ +#include "config.h" + #include #include "MltProperties.h" @@ -35,16 +37,15 @@ namespace Mlt class Filter; class Transition; - class Parser : public Properties + class MLTPP_DECLSPEC Parser : public Properties { private: mlt_parser parser; - protected: - virtual mlt_properties get_properties( ); public: Parser( ); ~Parser( ); int start( Service &service ); + virtual mlt_properties get_properties( ); virtual int on_invalid( Service *object ); virtual int on_unknown( Service *object ); virtual int on_start_producer( Producer *object ); diff --git a/mlt++/src/MltPlaylist.cpp b/mlt++/src/MltPlaylist.cpp index 0d34acc..350e53b 100644 --- a/mlt++/src/MltPlaylist.cpp +++ b/mlt++/src/MltPlaylist.cpp @@ -167,6 +167,11 @@ ClipInfo *Playlist::clip_info( int index, ClipInfo *info ) return info; } +void Playlist::delete_clip_info( ClipInfo *info ) +{ + delete info; +} + int Playlist::insert( Producer &producer, int where, int in, int out ) { return mlt_playlist_insert( get_playlist( ), producer.get_producer( ), where, in, out ); @@ -241,12 +246,12 @@ bool Playlist::is_mix( int clip ) bool Playlist::is_blank( int clip ) { - return mlt_playlist_is_blank( get_playlist( ), clip ); + return mlt_playlist_is_blank( get_playlist( ), clip ) != 0; } bool Playlist::is_blank_at( int position ) { - return mlt_playlist_is_blank_at( get_playlist( ), position ); + return mlt_playlist_is_blank_at( get_playlist( ), position ) != 0; } Producer *Playlist::replace_with_blank( int clip ) diff --git a/mlt++/src/MltPlaylist.h b/mlt++/src/MltPlaylist.h index badc1d0..0cd17b0 100644 --- a/mlt++/src/MltPlaylist.h +++ b/mlt++/src/MltPlaylist.h @@ -21,6 +21,8 @@ #ifndef _MLTPP_PLAYLIST_H_ #define _MLTPP_PLAYLIST_H_ +#include "config.h" + #include #include "MltProducer.h" @@ -32,7 +34,7 @@ namespace Mlt class Playlist; class Transition; - class ClipInfo + class MLTPP_DECLSPEC ClipInfo { public: ClipInfo( ); @@ -52,7 +54,7 @@ namespace Mlt int repeat; }; - class Playlist : public Producer + class MLTPP_DECLSPEC Playlist : public Producer { private: mlt_playlist instance; @@ -72,6 +74,7 @@ namespace Mlt int current_clip( ); Producer *current( ); ClipInfo *clip_info( int index, ClipInfo *info = NULL ); + static void delete_clip_info( ClipInfo *info ); int insert( Producer &producer, int where, int in = -1, int out = -1 ); int remove( int where ); int move( int from, int to ); diff --git a/mlt++/src/MltProducer.cpp b/mlt++/src/MltProducer.cpp index 3a58819..1b06e91 100644 --- a/mlt++/src/MltProducer.cpp +++ b/mlt++/src/MltProducer.cpp @@ -167,12 +167,12 @@ Producer *Producer::cut( int in, int out ) bool Producer::is_cut( ) { - return mlt_producer_is_cut( get_producer( ) ); + return mlt_producer_is_cut( get_producer( ) ) != 0; } bool Producer::is_blank( ) { - return mlt_producer_is_blank( get_producer( ) ); + return mlt_producer_is_blank( get_producer( ) ) != 0; } bool Producer::same_clip( Producer &that ) diff --git a/mlt++/src/MltProducer.h b/mlt++/src/MltProducer.h index 81b4dad..35c2f0e 100644 --- a/mlt++/src/MltProducer.h +++ b/mlt++/src/MltProducer.h @@ -21,6 +21,8 @@ #ifndef _MLTPP_PRODUCER_H_ #define _MLTPP_PRODUCER_H_ +#include "config.h" + #include #include "MltService.h" @@ -30,7 +32,7 @@ namespace Mlt class Service; class Filter; - class Producer : public Service + class MLTPP_DECLSPEC Producer : public Service { private: mlt_producer instance; diff --git a/mlt++/src/MltProperties.cpp b/mlt++/src/MltProperties.cpp index a1452e2..f168eb9 100644 --- a/mlt++/src/MltProperties.cpp +++ b/mlt++/src/MltProperties.cpp @@ -206,6 +206,9 @@ void Properties::load( const char *file ) int Properties::save( const char *file ) { +#ifdef WIN32 + return mlt_properties_save( get_properties( ), file ); +#else int error = 0; FILE *f = fopen( file, "w" ); if ( f != NULL ) @@ -218,6 +221,7 @@ int Properties::save( const char *file ) error = 1; } return error; +#endif } #if defined( __DARWIN__ ) && GCC_VERSION < 40000 @@ -243,6 +247,11 @@ Event *Properties::setup_wait_for( char *id ) return new Event( mlt_events_setup_wait_for( get_properties( ), id ) ); } +void Properties::delete_event( Event *event ) +{ + delete event; +} + void Properties::wait_for( Event *event, bool destroy ) { mlt_events_wait_for( get_properties( ), event->get_event( ) ); diff --git a/mlt++/src/MltProperties.h b/mlt++/src/MltProperties.h index 9393992..4e51668 100644 --- a/mlt++/src/MltProperties.h +++ b/mlt++/src/MltProperties.h @@ -21,6 +21,8 @@ #ifndef _MLTPP_PROPERTIES_H_ #define _MLTPP_PROPERTIES_H_ +#include "config.h" + #include #include @@ -31,12 +33,10 @@ namespace Mlt /** Abstract Properties class. */ - class Properties + class MLTPP_DECLSPEC Properties { private: mlt_properties instance; - protected: - virtual mlt_properties get_properties( ); public: Properties( ); Properties( bool dummy ); @@ -44,6 +44,7 @@ namespace Mlt Properties( mlt_properties properties ); Properties( const char *file ); virtual ~Properties( ); + virtual mlt_properties get_properties( ); int inc_ref( ); int dec_ref( ); int ref_count( ); @@ -78,6 +79,7 @@ namespace Mlt #else Event *listen( char *id, void *object, mlt_listener ); #endif + static void delete_event( Event * ); Event *setup_wait_for( char *id ); void wait_for( Event *, bool destroy = true ); }; diff --git a/mlt++/src/MltPushConsumer.h b/mlt++/src/MltPushConsumer.h index abb8a3c..105d7fa 100644 --- a/mlt++/src/MltPushConsumer.h +++ b/mlt++/src/MltPushConsumer.h @@ -21,6 +21,8 @@ #ifndef MLTPP_PUSH_CONSUMER_H #define MLTPP_PUSH_CONSUMER_H +#include "config.h" + #include "MltConsumer.h" namespace Mlt @@ -29,7 +31,7 @@ namespace Mlt class Service; class PushPrivate; - class PushConsumer : public Consumer + class MLTPP_DECLSPEC PushConsumer : public Consumer { private: PushPrivate *m_private; diff --git a/mlt++/src/MltService.h b/mlt++/src/MltService.h index 69dd989..aa2c0e2 100644 --- a/mlt++/src/MltService.h +++ b/mlt++/src/MltService.h @@ -21,6 +21,8 @@ #ifndef _MLTPP_SERVICE_H_ #define _MLTPP_SERVICE_H_ +#include "config.h" + #include #include "MltProperties.h" @@ -32,7 +34,7 @@ namespace Mlt class Filter; class Frame; - class Service : public Properties + class MLTPP_DECLSPEC Service : public Properties { private: mlt_service instance; @@ -44,7 +46,7 @@ namespace Mlt virtual mlt_service get_service( ); void lock( ); void unlock( ); - mlt_properties get_properties( ); + virtual mlt_properties get_properties( ); int connect_producer( Service &producer, int index = 0 ); Service *consumer( ); Service *producer( ); diff --git a/mlt++/src/MltTokeniser.h b/mlt++/src/MltTokeniser.h index f3d127e..7b0bda9 100644 --- a/mlt++/src/MltTokeniser.h +++ b/mlt++/src/MltTokeniser.h @@ -21,11 +21,13 @@ #ifndef _MLTPP_TOKENISER_H #define _MLTPP_TOKENISER_H +#include "config.h" + #include namespace Mlt { - class Tokeniser + class MLTPP_DECLSPEC Tokeniser { private: mlt_tokeniser tokens; diff --git a/mlt++/src/MltTractor.h b/mlt++/src/MltTractor.h index 2bc8e99..3b220aa 100644 --- a/mlt++/src/MltTractor.h +++ b/mlt++/src/MltTractor.h @@ -21,6 +21,8 @@ #ifndef _MLTPP_TRACTOR_H_ #define _MLTPP_TRACTOR_H_ +#include "config.h" + #include #include "MltProducer.h" @@ -33,7 +35,7 @@ namespace Mlt class Transition; class Filter; - class Tractor : public Producer + class MLTPP_DECLSPEC Tractor : public Producer { private: mlt_tractor instance; @@ -44,7 +46,7 @@ namespace Mlt Tractor( Tractor &tractor ); Tractor( char *id, char *arg = NULL ); virtual ~Tractor( ); - mlt_tractor get_tractor( ); + virtual mlt_tractor get_tractor( ); mlt_producer get_producer( ); Multitrack *multitrack( ); Field *field( ); diff --git a/mlt++/src/MltTransition.h b/mlt++/src/MltTransition.h index 1ef8486..66ed23f 100644 --- a/mlt++/src/MltTransition.h +++ b/mlt++/src/MltTransition.h @@ -21,6 +21,8 @@ #ifndef _MLTPP_TRANSITION_H_ #define _MLTPP_TRANSITION_H_ +#include "config.h" + #include #include "MltService.h" @@ -28,7 +30,7 @@ namespace Mlt { class Service; - class Transition : public Service + class MLTPP_DECLSPEC Transition : public Service { private: mlt_transition instance;