+++ /dev/null
-include ../../config.mak
-
-TARGET = dan charlie pango pixbuf dissolve luma
-
-CFLAGS += -I.. $(RDYNAMIC)
-
-LDFLAGS += -L../modules
-LDFLAGS += -L../framework -lmlt
-
-all: $(TARGET)
-
-hello: hello.o
- $(CC) hello.o -o $@ -L../framework -L../modules -lmlt
-
-pango: pango.o
- $(CC) pango.o -o $@ $(LDFLAGS)
-
-pixbuf: pixbuf.o
- $(CC) pixbuf.o -o $@ $(LDFLAGS)
-
-dissolve: dissolve.o
- $(CC) dissolve.o -o $@ $(LDFLAGS)
-
-luma: luma.o
- $(CC) luma.o -o $@ $(LDFLAGS)
-
-dan: dan.o
- $(CC) dan.o -o $@ $(LDFLAGS)
-
-charlie: charlie.o io.o
- $(CC) charlie.o io.o -o $@ $(LDFLAGS)
-
-clean:
- rm -f dan.o io.o charlie.o dan charlie
-
-depend: dan.c charlie.c io.c
- $(CC) -MM $(CFLAGS) $^ 1>.depend
-
-ifneq ($(wildcard .depend),)
-include .depend
-endif
+++ /dev/null
-These files in tests/ are not meant to be working or even good examples.
\ No newline at end of file
+++ /dev/null
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <framework/mlt.h>
-
-#include "io.h"
-
-mlt_producer create_producer( char *file )
-{
- mlt_producer result = NULL;
-
- // 1st Line preferences
- if ( strstr( file, ".melt" ) )
- {
- char *args[ 2 ] = { file, NULL };
- result = mlt_factory_producer( "melt", args );
- }
- else if ( strstr( file, ".mpg" ) )
- result = mlt_factory_producer( "mcmpeg", file );
- else if ( strstr( file, ".mpeg" ) )
- result = mlt_factory_producer( "mcmpeg", file );
- else if ( strstr( file, ".dat" ) )
- result = mlt_factory_producer( "mcmpeg", file );
- else if ( strstr( file, ".dv" ) )
- result = mlt_factory_producer( "mcdv", file );
- else if ( strstr( file, ".dif" ) )
- result = mlt_factory_producer( "mcdv", file );
- else if ( strstr( file, ".jpg" ) )
- result = mlt_factory_producer( "pixbuf", file );
- else if ( strstr( file, ".JPG" ) )
- result = mlt_factory_producer( "pixbuf", file );
- else if ( strstr( file, ".jpeg" ) )
- result = mlt_factory_producer( "pixbuf", file );
- else if ( strstr( file, ".png" ) )
- result = mlt_factory_producer( "pixbuf", file );
-
- // 2nd Line fallbacks
- if ( result == NULL && strstr( file, ".dv" ) )
- result = mlt_factory_producer( "libdv", file );
- else if ( result == NULL && strstr( file, ".dif" ) )
- result = mlt_factory_producer( "libdv", file );
-
- return result;
-}
-
-void transport_action( mlt_producer producer, char *value )
-{
- mlt_properties properties = mlt_producer_properties( producer );
-
- switch( value[ 0 ] )
- {
- case 'q':
- mlt_properties_set_int( properties, "done", 1 );
- break;
- case '0':
- mlt_producer_set_speed( producer, 1 );
- mlt_producer_seek( producer, 0 );
- break;
- case '1':
- mlt_producer_set_speed( producer, -5 );
- break;
- case '2':
- mlt_producer_set_speed( producer, -2.5 );
- break;
- case '3':
- mlt_producer_set_speed( producer, -1 );
- break;
- case '4':
- mlt_producer_set_speed( producer, -0.5 );
- break;
- case '5':
- mlt_producer_set_speed( producer, 0 );
- break;
- case '6':
- mlt_producer_set_speed( producer, 0.5 );
- break;
- case '7':
- mlt_producer_set_speed( producer, 1 );
- break;
- case '8':
- mlt_producer_set_speed( producer, 2.5 );
- break;
- case '9':
- mlt_producer_set_speed( producer, 5 );
- break;
- }
-}
-
-mlt_consumer create_consumer( char *id, mlt_producer producer )
-{
- char *arg = strchr( id, ':' );
- if ( arg != NULL )
- *arg ++ = '\0';
- mlt_consumer consumer = mlt_factory_consumer( id, arg );
- if ( consumer != NULL )
- {
- mlt_properties properties = mlt_consumer_properties( consumer );
- mlt_properties_set_data( properties, "transport_callback", transport_action, 0, NULL, NULL );
- mlt_properties_set_data( properties, "transport_producer", producer, 0, NULL, NULL );
- }
- return consumer;
-}
-
-void track_service( mlt_field field, void *service, mlt_destructor destructor )
-{
- mlt_properties properties = mlt_field_properties( field );
- int registered = mlt_properties_get_int( properties, "registered" );
- char *key = mlt_properties_get( properties, "registered" );
- mlt_properties_set_data( properties, key, service, 0, destructor, NULL );
- mlt_properties_set_int( properties, "registered", ++ registered );
-}
-
-void set_properties( mlt_service service, char *namevalue )
-{
- mlt_properties properties = mlt_service_properties( service );
- mlt_properties_parse( properties, namevalue );
-}
-
-void transport( mlt_producer producer )
-{
- mlt_properties properties = mlt_producer_properties( producer );
-
- term_init( );
- fprintf( stderr, "Press 'q' to continue\n" );
- while( mlt_properties_get_int( properties, "done" ) == 0 )
- {
- int value = term_read( );
- if ( value != -1 )
- transport_action( producer, ( char * )&value );
- }
-}
-
-int main( int argc, char **argv )
-{
- int i;
- mlt_service service = NULL;
- mlt_consumer consumer = NULL;
- mlt_producer producer = NULL;
- mlt_playlist playlist = NULL;
-
- // Construct the factory
- mlt_factory_init( getenv( "MLT_REPOSITORY" ) );
-
- // Set up containers
- playlist = mlt_playlist_init( );
-
- // Parse the arguments
- for ( i = 1; i < argc; i ++ )
- {
- if ( !strcmp( argv[ i ], "-consumer" ) )
- {
- consumer = create_consumer( argv[ ++ i ], mlt_playlist_producer( playlist ) );
- if ( consumer != NULL )
- service = mlt_consumer_service( consumer );
- }
- else if ( !strstr( argv[ i ], "=" ) )
- {
- if ( producer != NULL )
- mlt_playlist_append( playlist, producer );
- producer = create_producer( argv[ i ] );
- if ( producer != NULL )
- service = mlt_producer_service( producer );
- }
- else
- {
- set_properties( service, argv[ i ] );
- }
- }
-
- // If we have no consumer, default to sdl
- if ( consumer == NULL )
- consumer = create_consumer( "sdl", mlt_playlist_producer( playlist ) );
-
- // Connect producer to playlist
- if ( producer != NULL )
- mlt_playlist_append( playlist, producer );
-
- // Connect consumer to playlist
- mlt_consumer_connect( consumer, mlt_playlist_service( playlist ) );
-
- // Transport functionality
- transport( mlt_playlist_producer( playlist ) );
-
- // Close the services
- mlt_consumer_close( consumer );
- mlt_playlist_close( playlist );
-
- // Close the factory
- mlt_factory_close( );
-
- return 0;
-}
+++ /dev/null
-
-#include <framework/mlt.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-
-
-int main( int argc, char **argv )
-{
- mlt_properties p = mlt_properties_parse_yaml( argv[1] );
- mlt_properties q = mlt_properties_new();
- mlt_properties_set_data( q, "metadata", p, 0, ( mlt_destructor )mlt_properties_close, ( mlt_serialiser )mlt_properties_serialise_yaml );
- printf( "%s", mlt_properties_get( q, "metadata" ) );
- mlt_properties_close( q );
-
- mlt_repository repo = mlt_factory_init( NULL );
- mlt_properties metadata = mlt_repository_metadata( repo, producer_type, "avformat" );
- if ( metadata )
- {
- char *s = mlt_properties_serialise_yaml( metadata );
- printf( "%s", s );
- free( s );
- }
- mlt_factory_close();
- return 0;
-}
+++ /dev/null
-
-#include <framework/mlt.h>
-
-#include <stdio.h>
-
-int main( int argc, char **argv )
-{
- char temp[ 132 ];
- char *file1 = NULL;
- char *file2 = NULL;
-
- mlt_factory_init( "../modules" );
-
- if ( argc < 3 )
- {
- fprintf( stderr, "usage: dissolve file1.mpeg file2.mpeg\n" );
- return 1;
- }
- else
- {
- file1 = argv[ 1 ];
- file2 = argv[ 2 ];
- }
-
- // Start the consumer...
- mlt_consumer consumer = mlt_factory_consumer( "sdl", "PAL" );
-
- // Create the producer(s)
- mlt_producer dv1 = mlt_factory_producer( "mcmpeg", file1 );
- mlt_producer dv2 = mlt_factory_producer( "mcmpeg", file2 );
-
- mlt_playlist playlist1 = mlt_playlist_init();
- mlt_playlist_append_io( playlist1, dv1, 0.0, 5.0 );
-
- mlt_playlist playlist2 = mlt_playlist_init();
- mlt_playlist_blank( playlist2, 2.9 );
- mlt_playlist_append( playlist2, dv2 );
-
- // Register producers(s) with a multitrack object
- mlt_multitrack multitrack = mlt_multitrack_init( );
- mlt_multitrack_connect( multitrack, mlt_playlist_producer( playlist1 ), 0 );
- mlt_multitrack_connect( multitrack, mlt_playlist_producer( playlist2 ), 1 );
-
- // Define a transition
- mlt_transition transition = mlt_factory_transition( "luma", NULL );
- mlt_transition_connect( transition, mlt_multitrack_service( multitrack ), 0, 1 );
- mlt_transition_set_in_and_out( transition, 3.0, 5.0 );
-
- // Buy a tractor and connect it to the filter
- mlt_tractor tractor = mlt_tractor_init( );
- mlt_tractor_connect( tractor, mlt_transition_service( transition ) );
-
- // Connect the tractor to the consumer
- mlt_consumer_connect( consumer, mlt_tractor_service( tractor ) );
-
- // Do stuff until we're told otherwise...
- fprintf( stderr, "Press return to continue\n" );
- fgets( temp, 132, stdin );
-
- // Close everything...
- mlt_consumer_close( consumer );
- mlt_tractor_close( tractor );
- mlt_transition_close( transition );
- mlt_multitrack_close( multitrack );
- mlt_playlist_close( playlist1 );
- mlt_playlist_close( playlist2 );
- mlt_producer_close( dv1 );
- mlt_producer_close( dv2 );
-
- return 0;
-}
+++ /dev/null
-#include <stdio.h>
-#include <unistd.h>
-#include <framework/mlt.h>
-
-mlt_producer create_playlist( int argc, char **argv )
-{
- // We're creating a playlist here
- mlt_playlist playlist = mlt_playlist_init( );
-
- // We need the playlist properties to ensure clean up
- mlt_properties properties = mlt_playlist_properties( playlist );
-
- // Loop through each of the arguments
- int i = 0;
- for ( i = 1; i < argc; i ++ )
- {
- // Definie the unique key
- char key[ 256 ];
-
- // Create the producer
- mlt_producer producer = mlt_factory_producer( NULL, argv[ i ] );
-
- // Add it to the playlist
- mlt_playlist_append( playlist, producer );
-
- // Create a unique key for this producer
- sprintf( key, "producer%d", i );
-
- // Now we need to ensure the producers are destroyed
- mlt_properties_set_data( properties, key, producer, 0, ( mlt_destructor )mlt_producer_close, NULL );
- }
-
- // Return the playlist as a producer
- return mlt_playlist_producer( playlist );
-}
-
-mlt_producer create_tracks( int argc, char **argv )
-{
- // Create the field
- mlt_field field = mlt_field_init( );
-
- // Obtain the multitrack
- mlt_multitrack multitrack = mlt_field_multitrack( field );
-
- // Obtain the tractor
- mlt_tractor tractor = mlt_field_tractor( field );
-
- // Obtain a composite transition
- mlt_transition transition = mlt_factory_transition( "composite", "10%/10%:15%x15%" );
-
- // Create track 0
- mlt_producer track0 = create_playlist( argc, argv );
-
- // Get the length of track0
- mlt_position length = mlt_producer_get_playtime( track0 );
-
- // Create the watermark track
- mlt_producer track1 = mlt_factory_producer( NULL, "pango:" );
-
- // Get the properties of track1
- mlt_properties properties = mlt_producer_properties( track1 );
-
- // Set the properties
- mlt_properties_set( properties, "text", "Hello\nWorld" );
- mlt_properties_set_position( properties, "in", 0 );
- mlt_properties_set_position( properties, "out", length - 1 );
- mlt_properties_set_position( properties, "length", length );
-
- // Now set the properties on the transition
- properties = mlt_transition_properties( transition );
- mlt_properties_set_position( properties, "in", 0 );
- mlt_properties_set_position( properties, "out", length - 1 );
-
- // Add our tracks to the multitrack
- mlt_multitrack_connect( multitrack, track0, 0 );
- mlt_multitrack_connect( multitrack, track1, 1 );
-
- // Now plant the transition
- mlt_field_plant_transition( field, transition, 0, 1 );
-
- // Now set the properties on the transition
- properties = mlt_tractor_properties( tractor );
-
- // Ensure clean up and set properties correctly
- mlt_properties_set_data( properties, "multitrack", multitrack, 0, ( mlt_destructor )mlt_multitrack_close, NULL );
- mlt_properties_set_data( properties, "field", field, 0, ( mlt_destructor )mlt_field_close, NULL );
- mlt_properties_set_data( properties, "track0", track0, 0, ( mlt_destructor )mlt_producer_close, NULL );
- mlt_properties_set_data( properties, "track1", track1, 0, ( mlt_destructor )mlt_producer_close, NULL );
- mlt_properties_set_data( properties, "transition", transition, 0, ( mlt_destructor )mlt_transition_close, NULL );
- mlt_properties_set_position( properties, "length", length );
- mlt_properties_set_position( properties, "out", length - 1 );
-
- // Return the tractor
- return mlt_tractor_producer( tractor );
-}
-
-int main( int argc, char **argv )
-{
- // Initialise the factory
- if ( mlt_factory_init( NULL ) == 0 )
- {
- // Create the default consumer
- mlt_consumer hello = mlt_factory_consumer( NULL, NULL );
-
- // Create a producer using the default normalising selecter
- mlt_producer world = create_tracks( argc, argv );
-
- // Connect the producer to the consumer
- mlt_consumer_connect( hello, mlt_producer_service( world ) );
-
- // Start the consumer
- mlt_consumer_start( hello );
-
- // Wait for the consumer to terminate
- while( !mlt_consumer_is_stopped( hello ) )
- sleep( 1 );
-
- // Close the consumer
- mlt_consumer_close( hello );
-
- // Close the producer
- mlt_producer_close( world );
-
- // Close the factory
- mlt_factory_close( );
- }
- else
- {
- // Report an error during initialisation
- fprintf( stderr, "Unable to locate factory modules\n" );
- }
-
- // End of program
- return 0;
-}
-
+++ /dev/null
-/*
- * io.c -- dv1394d client demo input/output
- * Copyright (C) 2002-2003 Ushodaya Enterprises Limited
- * 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 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-/* System header files */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <termios.h>
-#include <unistd.h>
-
-/* Application header files */
-#include "io.h"
-
-char *chomp( char *input )
-{
- if ( input != NULL )
- {
- int length = strlen( input );
- if ( length && input[ length - 1 ] == '\n' )
- input[ length - 1 ] = '\0';
- if ( length > 1 && input[ length - 2 ] == '\r' )
- input[ length - 2 ] = '\0';
- }
- return input;
-}
-
-char *trim( char *input )
-{
- if ( input != NULL )
- {
- int length = strlen( input );
- int first = 0;
- while( first < length && isspace( input[ first ] ) )
- first ++;
- memmove( input, input + first, length - first + 1 );
- length = length - first;
- while ( length > 0 && isspace( input[ length - 1 ] ) )
- input[ -- length ] = '\0';
- }
- return input;
-}
-
-char *strip_quotes( char *input )
-{
- if ( input != NULL )
- {
- char *ptr = strrchr( input, '\"' );
- if ( ptr != NULL )
- *ptr = '\0';
- if ( input[ 0 ] == '\"' )
- strcpy( input, input + 1 );
- }
- return input;
-}
-
-char *get_string( char *output, int maxlength, char *use )
-{
- char *value = NULL;
- strcpy( output, use );
- if ( trim( chomp( fgets( output, maxlength, stdin ) ) ) != NULL )
- {
- if ( !strcmp( output, "" ) )
- strcpy( output, use );
- value = output;
- }
- return value;
-}
-
-int *get_int( int *output, int use )
-{
- int *value = NULL;
- char temp[ 132 ];
- *output = use;
- if ( trim( chomp( fgets( temp, 132, stdin ) ) ) != NULL )
- {
- if ( strcmp( temp, "" ) )
- *output = atoi( temp );
- value = output;
- }
- return value;
-}
-
-/** This stores the previous settings
-*/
-
-static struct termios oldtty;
-static int mode = 0;
-
-/** This is called automatically on application exit to restore the
- previous tty settings.
-*/
-
-void term_exit(void)
-{
- if ( mode == 1 )
- {
- tcsetattr( 0, TCSANOW, &oldtty );
- mode = 0;
- }
-}
-
-/** Init terminal so that we can grab keys without blocking.
-*/
-
-void term_init( )
-{
- struct termios tty;
-
- tcgetattr( 0, &tty );
- oldtty = tty;
-
- tty.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
- tty.c_oflag |= OPOST;
- tty.c_lflag &= ~(ECHO|ECHONL|ICANON|IEXTEN);
- tty.c_cflag &= ~(CSIZE|PARENB);
- tty.c_cflag |= CS8;
- tty.c_cc[ VMIN ] = 1;
- tty.c_cc[ VTIME ] = 0;
-
- tcsetattr( 0, TCSANOW, &tty );
-
- mode = 1;
-
- atexit( term_exit );
-}
-
-/** Check for a keypress without blocking infinitely.
- Returns: ASCII value of keypress or -1 if no keypress detected.
-*/
-
-int term_read( )
-{
- int n = 1;
- unsigned char ch;
- struct timeval tv;
- fd_set rfds;
-
- FD_ZERO( &rfds );
- FD_SET( 0, &rfds );
- tv.tv_sec = 0;
- tv.tv_usec = 250;
- n = select( 1, &rfds, NULL, NULL, &tv );
- if (n > 0)
- {
- n = read( 0, &ch, 1 );
- tcflush( 0, TCIFLUSH );
- if (n == 1)
- return ch;
- return n;
- }
- return -1;
-}
-
-char get_keypress( )
-{
- char value = '\0';
- int pressed = 0;
-
- fflush( stdout );
-
- term_init( );
- while ( ( pressed = term_read( ) ) == -1 ) ;
- term_exit( );
-
- value = (char)pressed;
-
- return value;
-}
-
-void wait_for_any_key( char *message )
-{
- if ( message == NULL )
- printf( "Press any key to continue: " );
- else
- printf( "%s", message );
-
- get_keypress( );
-
- printf( "\n\n" );
-}
-
-void beep( )
-{
- printf( "%c", 7 );
- fflush( stdout );
-}
+++ /dev/null
-/*
- * io.h -- dv1394d client demo input/output
- * Copyright (C) 2002-2003 Ushodaya Enterprises Limited
- * 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 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.
- */
-
-#ifndef _DEMO_IO_H_
-#define _DEMO_IO_H_
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-extern char *chomp( char * );
-extern char *trim( char * );
-extern char *strip_quotes( char * );
-extern char *get_string( char *, int, char * );
-extern int *get_int( int *, int );
-extern void term_init( );
-extern int term_read( );
-extern void term_exit( );
-extern char get_keypress( );
-extern void wait_for_any_key( char * );
-extern void beep( );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
+++ /dev/null
-
-#include <framework/mlt.h>
-
-#include <stdio.h>
-
-int main( int argc, char **argv )
-{
- char temp[ 132 ];
- char *file1 = NULL;
- char *file2 = NULL;
- char *wipe = NULL;
-
- mlt_factory_init( "../modules" );
-
- if ( argc < 4 )
- {
- fprintf( stderr, "usage: luma file1.mpeg file2.mpeg wipe.pgm\n" );
- return 1;
- }
- else
- {
- file1 = argv[ 1 ];
- file2 = argv[ 2 ];
- wipe = argv[ 3 ];
- }
-
- // Start the consumer...
- mlt_consumer consumer = mlt_factory_consumer( "bluefish", "NTSC" );
-
- // Create the producer(s)
- mlt_producer dv1 = mlt_factory_producer( "mcmpeg", file1 );
- mlt_producer dv2 = mlt_factory_producer( "mcmpeg", file2 );
-
- mlt_playlist playlist1 = mlt_playlist_init();
- mlt_playlist_append_io( playlist1, dv1, 0.0, 5.0 );
-
- mlt_playlist playlist2 = mlt_playlist_init();
- mlt_playlist_blank( playlist2, 2.9 );
- mlt_playlist_append( playlist2, dv2 );
-
- // Register producers(s) with a multitrack object
- mlt_multitrack multitrack = mlt_multitrack_init( );
- mlt_multitrack_connect( multitrack, mlt_playlist_producer( playlist1 ), 0 );
- mlt_multitrack_connect( multitrack, mlt_playlist_producer( playlist2 ), 1 );
-
- // Define a transition
- mlt_transition transition = mlt_factory_transition( "luma", wipe );
- mlt_properties_set( mlt_transition_properties( transition ), "filename", wipe );
- mlt_properties_set_double( mlt_transition_properties( transition ), "softness", 0.1 );
- mlt_transition_connect( transition, mlt_multitrack_service( multitrack ), 0, 1 );
- mlt_transition_set_in_and_out( transition, 3.0, 5.0 );
-
- // Buy a tractor and connect it to the filter
- mlt_tractor tractor = mlt_tractor_init( );
- mlt_tractor_connect( tractor, mlt_transition_service( transition ) );
-
- // Connect the tractor to the consumer
- mlt_consumer_connect( consumer, mlt_tractor_service( tractor ) );
-
- // Do stuff until we're told otherwise...
- fprintf( stderr, "Press return to continue\n" );
- fgets( temp, 132, stdin );
-
- // Close everything...
- mlt_consumer_close( consumer );
- mlt_tractor_close( tractor );
- mlt_transition_close( transition );
- mlt_multitrack_close( multitrack );
- mlt_playlist_close( playlist1 );
- mlt_playlist_close( playlist2 );
- mlt_producer_close( dv1 );
- mlt_producer_close( dv2 );
-
- return 0;
-}
+++ /dev/null
-
-#include <framework/mlt.h>
-
-#include <stdio.h>
-
-int main( int argc, char **argv )
-{
- char temp[ 132 ];
- char *file1 = NULL;
- char *text = NULL;
-
- mlt_factory_init( "../modules" );
-
- if ( argc < 3 )
- {
- fprintf( stderr, "usage: pango file.mpeg text_to_display\n" );
- return 1;
- }
- else
- {
- file1 = argv[ 1 ];
- text = argv[ 2 ];
- }
-
- // Start the consumer...
- mlt_consumer consumer = mlt_factory_consumer( "bluefish", "NTSC" );
-
- // Create the producer(s)
- mlt_playlist pl1 = mlt_playlist_init();
- mlt_producer dv1 = mlt_factory_producer( "mcmpeg", file1 );
- mlt_playlist_append( pl1, dv1 );
-
- mlt_playlist pl2 = mlt_playlist_init();
- mlt_producer title = mlt_factory_producer( "pango", NULL ); //"<span font_desc=\"Sans Bold 36\">Mutton <span font_desc=\"Luxi Serif Bold Oblique 36\">Lettuce</span> Tomato</span>" );
- mlt_playlist_append( pl2, title );
- mlt_properties_set( mlt_producer_properties( title ), "family", "Sans" );
- mlt_properties_set( mlt_producer_properties( title ), "size", "36" );
- mlt_properties_set( mlt_producer_properties( title ), "weight", "700" );
- mlt_properties_set( mlt_producer_properties( title ), "text", text );
- mlt_properties_set_int( mlt_producer_properties( title ), "bgcolor", 0x0000007f );
- mlt_properties_set_int( mlt_producer_properties( title ), "pad", 8 );
- mlt_properties_set_int( mlt_producer_properties( title ), "align", 1 );
- mlt_properties_set_int( mlt_producer_properties( title ), "x", 200 );
- mlt_properties_set_int( mlt_producer_properties( title ), "y", 40 );
- mlt_properties_set_double( mlt_producer_properties( title ), "mix", 0.8 );
-
- // Register producers(s) with a multitrack object
- mlt_multitrack multitrack = mlt_multitrack_init( );
- mlt_multitrack_connect( multitrack, mlt_playlist_producer( pl1 ), 0 );
- mlt_multitrack_connect( multitrack, mlt_playlist_producer( pl2 ), 1 );
-
- // Define a transition
- mlt_transition transition = mlt_factory_transition( "composite", NULL );
- mlt_transition_connect( transition, mlt_multitrack_service( multitrack ), 0, 1 );
- mlt_transition_set_in_and_out( transition, 0.0, 9999.0 );
-
- // Buy a tractor and connect it to the filter
- mlt_tractor tractor = mlt_tractor_init( );
- mlt_tractor_connect( tractor, mlt_transition_service( transition ) );
-
- // Connect the tractor to the consumer
- mlt_consumer_connect( consumer, mlt_tractor_service( tractor ) );
-
- // Do stuff until we're told otherwise...
- fprintf( stderr, "Press return to continue\n" );
- fgets( temp, 132, stdin );
-
- // Close everything...
- mlt_consumer_close( consumer );
- mlt_tractor_close( tractor );
- mlt_transition_close( transition );
- mlt_multitrack_close( multitrack );
- mlt_playlist_close( pl1 );
- mlt_playlist_close( pl2 );
- mlt_producer_close( dv1 );
- mlt_producer_close( title );
-
- return 0;
-}
+++ /dev/null
-
-#include <framework/mlt.h>
-
-#include <stdio.h>
-
-int main( int argc, char **argv )
-{
- char temp[ 132 ];
- char *file1 = NULL;
- char *file2 = NULL;
-
- mlt_factory_init( "../modules" );
-
- if ( argc < 3 )
- {
- fprintf( stderr, "usage: pixbuf file.mpeg file.{png,jpg,etc}\n" );
- return 1;
- }
- else
- {
- file1 = argv[ 1 ];
- file2 = argv[ 2 ];
- }
-
- // Start the consumer...
- mlt_consumer consumer = mlt_factory_consumer( "sdl", "PAL" );
-
- // Create the producer(s)
- mlt_playlist pl1 = mlt_playlist_init();
- mlt_producer dv1 = mlt_factory_producer( "mcmpeg", file1 );
- mlt_playlist_append( pl1, dv1 );
-
- mlt_playlist pl2 = mlt_playlist_init();
- mlt_producer overlay = mlt_factory_producer( "pixbuf", file2 );
- mlt_playlist_append( pl2, overlay );
- mlt_properties_set_int( mlt_producer_properties( overlay ), "x", 600 );
- mlt_properties_set_int( mlt_producer_properties( overlay ), "y", 460 );
- mlt_properties_set_double( mlt_producer_properties( overlay ), "mix", 0.8 );
-
- // Register producers(s) with a multitrack object
- mlt_multitrack multitrack = mlt_multitrack_init( );
- mlt_multitrack_connect( multitrack, mlt_playlist_producer( pl1 ), 0 );
- mlt_multitrack_connect( multitrack, mlt_playlist_producer( pl2 ), 1 );
-
- // Define a transition
- mlt_transition transition = mlt_factory_transition( "composite", NULL );
- mlt_transition_connect( transition, mlt_multitrack_service( multitrack ), 0, 1 );
- mlt_transition_set_in_and_out( transition, 0.0, 9999.0 );
-
- // Buy a tractor and connect it to the filter
- mlt_tractor tractor = mlt_tractor_init( );
- mlt_tractor_connect( tractor, mlt_transition_service( transition ) );
-
- // Connect the tractor to the consumer
- mlt_consumer_connect( consumer, mlt_tractor_service( tractor ) );
-
- // Do stuff until we're told otherwise...
- fprintf( stderr, "Press return to continue\n" );
- fgets( temp, 132, stdin );
-
- // Close everything...
- mlt_consumer_close( consumer );
- mlt_tractor_close( tractor );
- mlt_transition_close( transition );
- mlt_multitrack_close( multitrack );
- mlt_playlist_close( pl1 );
- mlt_playlist_close( pl2 );
- mlt_producer_close( dv1 );
- mlt_producer_close( overlay );
-
- return 0;
-}