]> git.sesse.net Git - mlt/commitdiff
albino
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Fri, 9 Jan 2004 07:45:32 +0000 (07:45 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Fri, 9 Jan 2004 07:45:32 +0000 (07:45 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@44 d19143bc-622f-0410-bfdd-b5b2a6649095

14 files changed:
Makefile
mlt/Makefile
mlt/setenv
mlt/src/albino/Makefile [new file with mode: 0644]
mlt/src/albino/albino.c [new file with mode: 0644]
mlt/src/framework/mlt_transition.c
mlt/src/framework/mlt_transition.h
mlt/src/miracle/Makefile
setenv
src/albino/Makefile [new file with mode: 0644]
src/albino/albino.c [new file with mode: 0644]
src/framework/mlt_transition.c
src/framework/mlt_transition.h
src/miracle/Makefile

index fe7ee8e41ae22627adc0e9f70df65a0e4b153826..36c1f129bc8333683a13a474f878ba1f2eaba27b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,10 @@
-SUBDIRS = src/framework src/modules src/inigo src/valerie src/miracle src/humperdink
+SUBDIRS = src/framework \
+                 src/modules \
+                 src/inigo \
+                 src/valerie \
+                 src/miracle \
+                 src/humperdink \
+                 src/albino
 
 all clean dist-clean depend install:
        list='$(SUBDIRS)'; \
index fe7ee8e41ae22627adc0e9f70df65a0e4b153826..36c1f129bc8333683a13a474f878ba1f2eaba27b 100644 (file)
@@ -1,4 +1,10 @@
-SUBDIRS = src/framework src/modules src/inigo src/valerie src/miracle src/humperdink
+SUBDIRS = src/framework \
+                 src/modules \
+                 src/inigo \
+                 src/valerie \
+                 src/miracle \
+                 src/humperdink \
+                 src/albino
 
 all clean dist-clean depend install:
        list='$(SUBDIRS)'; \
index 9d665ed09103968986162cc4a5724556a5ab8136..42b4e7a7e9c01ce40d8dbc6a8685ae1ce7f513f5 100644 (file)
@@ -5,12 +5,14 @@ export MLT_REPOSITORY=`pwd`/src/modules
 
 export LD_LIBRARY_PATH=`pwd`/src/framework:\
 `pwd`/src/valerie:\
+`pwd`/src/miracle:\
 `pwd`/src/modules/bluefish:\
 `pwd`/../bluefish/lib:\
 `pwd`/../mpeg_sdk_demo/bin:\
 `pwd`/../dv_sdk
 
 export PATH=$PATH:\
+`pwd`/src/albino:\
 `pwd`/src/inigo:\
 `pwd`/src/humperdink:\
 `pwd`/src/miracle
diff --git a/mlt/src/albino/Makefile b/mlt/src/albino/Makefile
new file mode 100644 (file)
index 0000000..1cc0051
--- /dev/null
@@ -0,0 +1,27 @@
+TARGET = albino
+
+OBJS = albino.o
+
+CFLAGS = -I .. -Wall -g -D_FILE_OFFSET_BITS=64 -pthread -rdynamic
+
+LDFLAGS = -L ../valerie -L ../miracle -lmiracle -lvalerie
+
+SRCS := $(OBJS:.o=.c)
+
+all: $(TARGET)
+
+$(TARGET): $(OBJS)
+               $(CC) -o $@ $(OBJS) $(LDFLAGS)
+
+depend:        $(SRCS)
+               $(CC) -MM $(CFLAGS) $^ 1>.depend
+
+dist-clean:    clean
+               rm -f .depend
+
+clean: 
+               rm -f $(OBJS) $(TARGET)
+
+ifneq ($(wildcard .depend),)
+include .depend
+endif
diff --git a/mlt/src/albino/albino.c b/mlt/src/albino/albino.c
new file mode 100644 (file)
index 0000000..faaf03f
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * albino.c -- Local dv1394d Test Util
+ * 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.
+ */
+
+/* System header files */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* Application header files */
+#include <miracle/miracle_local.h>
+#include <valerie/valerie_remote.h>
+#include <valerie/valerie_util.h>
+
+char *prompt( char *command, int length )
+{
+       printf( "> " );
+       return fgets( command, length, stdin );
+}
+
+void report( valerie_response response )
+{
+       int index = 0;
+       if ( response != NULL )
+               for ( index = 0; index < valerie_response_count( response ); index ++ )
+                       printf( "%4d: %s\n", index, valerie_response_get_line( response, index ) );
+}
+
+int main( int argc, char **argv  )
+{
+       valerie_parser parser = NULL;
+       valerie_response response = NULL;
+       char temp[ 1024 ];
+       int index = 1;
+
+       if ( argc > 2 && !strcmp( argv[ 1 ], "-s" ) )
+       {
+               printf( "DV1394D Client Instance\n" );
+               parser = valerie_parser_init_remote( argv[ 2 ], 5250 );
+               response = valerie_parser_connect( parser );
+               index = 3;
+       }
+       else
+       {
+               printf( "DV1394D Standalone Instance\n" );
+               parser = miracle_parser_init_local( );
+               response = valerie_parser_connect( parser );
+       }
+
+       if ( response != NULL )
+       {
+               /* process files on command lines before going into console mode */
+               for ( ; index < argc; index ++ )
+               {
+                       valerie_response_close( response );
+                       response = valerie_parser_run( parser, argv[ index ] );
+                       report( response );
+               }
+       
+               while ( response != NULL && prompt( temp, 1024 ) )
+               {
+                       valerie_util_trim( valerie_util_chomp( temp ) );
+                       if ( !strcmp( temp, "BYE" ) )
+                       {
+                               break;
+                       }
+                       else if ( strcmp( temp, "" ) )
+                       {
+                               valerie_response_close( response );
+                               response = valerie_parser_execute( parser, temp );
+                               report( response );
+                       }
+               }
+       }
+       else
+       {
+               fprintf( stderr, "Unable to connect to a dv1394 instance.\n" );
+       }
+
+       printf( "\n" );
+       valerie_parser_close( parser );
+
+       return 0;
+}
index a571dfe8707b2f354dc061443ddcf9cb5ec39141..de416a8177b9cc67d4aff8bbf521b47da7a69825 100644 (file)
@@ -42,7 +42,15 @@ int mlt_transition_init( mlt_transition this, void *child )
        this->child = child;
        if ( mlt_service_init( service, this ) == 0 )
        {
+               mlt_properties properties = mlt_transition_properties( this );
+
                service->get_frame = transition_get_frame;
+
+               mlt_properties_set_timecode( properties, "in", 0 );
+               mlt_properties_set_timecode( properties, "out", 0 );
+               mlt_properties_set_int( properties, "a_track", 0 );
+               mlt_properties_set_int( properties, "b_track", 1 );
+
                return 0;
        }
        return 1;
@@ -72,11 +80,10 @@ int mlt_transition_connect( mlt_transition this, mlt_service producer, int a_tra
        int ret = mlt_service_connect_producer( &this->parent, producer, a_track );
        if ( ret == 0 )
        {
+               mlt_properties properties = mlt_transition_properties( this );
                this->producer = producer;
-               this->a_track = a_track;
-               this->b_track = b_track;
-               this->in = 0;
-               this->out = 0;
+               mlt_properties_set_int( properties, "a_track", a_track );
+               mlt_properties_set_int( properties, "b_track", b_track );
        }
        return ret;
 }
@@ -86,8 +93,9 @@ int mlt_transition_connect( mlt_transition this, mlt_service producer, int a_tra
 
 void mlt_transition_set_in_and_out( mlt_transition this, mlt_timecode in, mlt_timecode out )
 {
-       this->in = in;
-       this->out = out;
+       mlt_properties properties = mlt_transition_properties( this );
+       mlt_properties_set_timecode( properties, "in", in );
+       mlt_properties_set_timecode( properties, "out", out );
 }
 
 /** Get the index of the a track.
@@ -95,7 +103,8 @@ void mlt_transition_set_in_and_out( mlt_transition this, mlt_timecode in, mlt_ti
 
 int mlt_transition_get_a_track( mlt_transition this )
 {
-       return this->a_track;
+       mlt_properties properties = mlt_transition_properties( this );
+       return mlt_properties_get_int( properties, "a_track" );
 }
 
 /** Get the index of the b track.
@@ -103,7 +112,8 @@ int mlt_transition_get_a_track( mlt_transition this )
 
 int mlt_transition_get_b_track( mlt_transition this )
 {
-       return this->b_track;
+       mlt_properties properties = mlt_transition_properties( this );
+       return mlt_properties_get_int( properties, "b_track" );
 }
 
 /** Get the in point.
@@ -111,7 +121,8 @@ int mlt_transition_get_b_track( mlt_transition this )
 
 mlt_timecode mlt_transition_get_in( mlt_transition this )
 {
-       return this->in;
+       mlt_properties properties = mlt_transition_properties( this );
+       return mlt_properties_get_timecode( properties, "in" );
 }
 
 /** Get the out point.
@@ -119,7 +130,8 @@ mlt_timecode mlt_transition_get_in( mlt_transition this )
 
 mlt_timecode mlt_transition_get_out( mlt_transition this )
 {
-       return this->out;
+       mlt_properties properties = mlt_transition_properties( this );
+       return mlt_properties_get_timecode( properties, "out" );
 }
 
 /** Process the frame.
@@ -167,20 +179,27 @@ static int transition_get_frame( mlt_service service, mlt_frame_ptr frame, int i
 {
        mlt_transition this = service->child;
 
+       mlt_properties properties = mlt_transition_properties( this );
+
+       int a_track = mlt_properties_get_int( properties, "a_track" );
+       int b_track = mlt_properties_get_int( properties, "b_track" );
+       mlt_timecode in = mlt_properties_get_timecode( properties, "in" );
+       mlt_timecode out = mlt_properties_get_timecode( properties, "out" );
+
        // Fetch a and b frames together...
-       if ( ( index == this->a_track || index == this->b_track ) &&
+       if ( ( index == a_track || index == b_track ) &&
                 ( this->a_frame == NULL && this->b_frame == NULL ) )
        {
-               mlt_service_get_frame( this->producer, &this->a_frame, this->a_track );
-               mlt_service_get_frame( this->producer, &this->b_frame, this->b_track );
+               mlt_service_get_frame( this->producer, &this->a_frame, a_track );
+               mlt_service_get_frame( this->producer, &this->b_frame, b_track );
        }
        
        // Special case track processing
-       if ( index == this->a_track )
+       if ( index == a_track )
        {
                // Determine if we're in the right time zone
                mlt_timecode timecode = mlt_frame_get_timecode( this->a_frame );
-               if ( timecode >= this->in && timecode < this->out )
+               if ( timecode >= in && timecode < out )
                {
                        // Process the transition
                        *frame = transition_process( this, this->a_frame, this->b_frame );
@@ -197,7 +216,7 @@ static int transition_get_frame( mlt_service service, mlt_frame_ptr frame, int i
                }                       
                return 0;
        }
-       if ( index == this->b_track )
+       if ( index == b_track )
        {
                if ( this->b_frame == NULL )
                {
@@ -207,7 +226,7 @@ static int transition_get_frame( mlt_service service, mlt_frame_ptr frame, int i
                else
                {
                        mlt_timecode timecode = mlt_frame_get_timecode( this->b_frame );
-                       if ( timecode >= this->in && timecode < this->out )
+                       if ( timecode >= in && timecode < out )
                        {
                                // We're in the zone, but the 'a frame' has not been requested yet
                                *frame = mlt_frame_init( );
index 1686199970e962f781476e7e8f239f5feb5fe44f..7ac765c33a721580f000e615a1c4d8e4e04f3205 100644 (file)
@@ -42,10 +42,6 @@ struct mlt_transition_s
        
        // track and in/out points
        mlt_service producer;
-       int a_track;
-       int b_track;
-       mlt_timecode in;
-       mlt_timecode out;
        
        // Private
        mlt_frame a_frame;
index 6568199c5e85c6927fec78b271a179611edf3286..3bda1830a9c7ca0ca5e88f9015ae5b2e39de50ed 100644 (file)
@@ -1,7 +1,8 @@
 TARGET = miracle
 
-OBJS = miracle.o \
-          miracle_log.o \
+APP_OBJS = miracle.o
+
+LIB_OBJS = miracle_log.o \
           miracle_server.o \
           miracle_connection.o \
           miracle_local.o \
@@ -9,25 +10,30 @@ OBJS = miracle.o \
           miracle_commands.o \
           miracle_unit_commands.o
 
+OBJS = $(APP_OBJS) $(LIB_OBJS)
+
 CFLAGS = -I .. -Wall -g -D_FILE_OFFSET_BITS=64 -pthread -rdynamic
 
 LDFLAGS = -L ../valerie -lvalerie -L ../framework -lmlt
 
 SRCS := $(OBJS:.o=.c)
 
-all: $(TARGET)
+all:           $(TARGET)
+
+$(TARGET):     $(APP_OBJS) libmiracle.so
+                       $(CC) -o $@ $(APP_OBJS) -L. -lmiracle $(LDFLAGS)
 
-$(TARGET): $(OBJS)
-               $(CC) -o $@ $(OBJS) $(LDFLAGS)
+libmiracle.so: $(LIB_OBJS)
+                       $(CC) -shared -o $@ $(LIB_OBJS) $(LDFLAGS)
 
-depend:        $(SRCS)
-               $(CC) -MM $(CFLAGS) $^ 1>.depend
+depend:                $(SRCS)
+                       $(CC) -MM $(CFLAGS) $^ 1>.depend
 
 dist-clean:    clean
-               rm -f .depend
+                       rm -f .depend
 
 clean: 
-               rm -f $(OBJS) $(TARGET)
+                       rm -f $(OBJS) $(TARGET) libmiracle.so
 
 ifneq ($(wildcard .depend),)
 include .depend
diff --git a/setenv b/setenv
index 9d665ed09103968986162cc4a5724556a5ab8136..42b4e7a7e9c01ce40d8dbc6a8685ae1ce7f513f5 100644 (file)
--- a/setenv
+++ b/setenv
@@ -5,12 +5,14 @@ export MLT_REPOSITORY=`pwd`/src/modules
 
 export LD_LIBRARY_PATH=`pwd`/src/framework:\
 `pwd`/src/valerie:\
+`pwd`/src/miracle:\
 `pwd`/src/modules/bluefish:\
 `pwd`/../bluefish/lib:\
 `pwd`/../mpeg_sdk_demo/bin:\
 `pwd`/../dv_sdk
 
 export PATH=$PATH:\
+`pwd`/src/albino:\
 `pwd`/src/inigo:\
 `pwd`/src/humperdink:\
 `pwd`/src/miracle
diff --git a/src/albino/Makefile b/src/albino/Makefile
new file mode 100644 (file)
index 0000000..1cc0051
--- /dev/null
@@ -0,0 +1,27 @@
+TARGET = albino
+
+OBJS = albino.o
+
+CFLAGS = -I .. -Wall -g -D_FILE_OFFSET_BITS=64 -pthread -rdynamic
+
+LDFLAGS = -L ../valerie -L ../miracle -lmiracle -lvalerie
+
+SRCS := $(OBJS:.o=.c)
+
+all: $(TARGET)
+
+$(TARGET): $(OBJS)
+               $(CC) -o $@ $(OBJS) $(LDFLAGS)
+
+depend:        $(SRCS)
+               $(CC) -MM $(CFLAGS) $^ 1>.depend
+
+dist-clean:    clean
+               rm -f .depend
+
+clean: 
+               rm -f $(OBJS) $(TARGET)
+
+ifneq ($(wildcard .depend),)
+include .depend
+endif
diff --git a/src/albino/albino.c b/src/albino/albino.c
new file mode 100644 (file)
index 0000000..faaf03f
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * albino.c -- Local dv1394d Test Util
+ * 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.
+ */
+
+/* System header files */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* Application header files */
+#include <miracle/miracle_local.h>
+#include <valerie/valerie_remote.h>
+#include <valerie/valerie_util.h>
+
+char *prompt( char *command, int length )
+{
+       printf( "> " );
+       return fgets( command, length, stdin );
+}
+
+void report( valerie_response response )
+{
+       int index = 0;
+       if ( response != NULL )
+               for ( index = 0; index < valerie_response_count( response ); index ++ )
+                       printf( "%4d: %s\n", index, valerie_response_get_line( response, index ) );
+}
+
+int main( int argc, char **argv  )
+{
+       valerie_parser parser = NULL;
+       valerie_response response = NULL;
+       char temp[ 1024 ];
+       int index = 1;
+
+       if ( argc > 2 && !strcmp( argv[ 1 ], "-s" ) )
+       {
+               printf( "DV1394D Client Instance\n" );
+               parser = valerie_parser_init_remote( argv[ 2 ], 5250 );
+               response = valerie_parser_connect( parser );
+               index = 3;
+       }
+       else
+       {
+               printf( "DV1394D Standalone Instance\n" );
+               parser = miracle_parser_init_local( );
+               response = valerie_parser_connect( parser );
+       }
+
+       if ( response != NULL )
+       {
+               /* process files on command lines before going into console mode */
+               for ( ; index < argc; index ++ )
+               {
+                       valerie_response_close( response );
+                       response = valerie_parser_run( parser, argv[ index ] );
+                       report( response );
+               }
+       
+               while ( response != NULL && prompt( temp, 1024 ) )
+               {
+                       valerie_util_trim( valerie_util_chomp( temp ) );
+                       if ( !strcmp( temp, "BYE" ) )
+                       {
+                               break;
+                       }
+                       else if ( strcmp( temp, "" ) )
+                       {
+                               valerie_response_close( response );
+                               response = valerie_parser_execute( parser, temp );
+                               report( response );
+                       }
+               }
+       }
+       else
+       {
+               fprintf( stderr, "Unable to connect to a dv1394 instance.\n" );
+       }
+
+       printf( "\n" );
+       valerie_parser_close( parser );
+
+       return 0;
+}
index a571dfe8707b2f354dc061443ddcf9cb5ec39141..de416a8177b9cc67d4aff8bbf521b47da7a69825 100644 (file)
@@ -42,7 +42,15 @@ int mlt_transition_init( mlt_transition this, void *child )
        this->child = child;
        if ( mlt_service_init( service, this ) == 0 )
        {
+               mlt_properties properties = mlt_transition_properties( this );
+
                service->get_frame = transition_get_frame;
+
+               mlt_properties_set_timecode( properties, "in", 0 );
+               mlt_properties_set_timecode( properties, "out", 0 );
+               mlt_properties_set_int( properties, "a_track", 0 );
+               mlt_properties_set_int( properties, "b_track", 1 );
+
                return 0;
        }
        return 1;
@@ -72,11 +80,10 @@ int mlt_transition_connect( mlt_transition this, mlt_service producer, int a_tra
        int ret = mlt_service_connect_producer( &this->parent, producer, a_track );
        if ( ret == 0 )
        {
+               mlt_properties properties = mlt_transition_properties( this );
                this->producer = producer;
-               this->a_track = a_track;
-               this->b_track = b_track;
-               this->in = 0;
-               this->out = 0;
+               mlt_properties_set_int( properties, "a_track", a_track );
+               mlt_properties_set_int( properties, "b_track", b_track );
        }
        return ret;
 }
@@ -86,8 +93,9 @@ int mlt_transition_connect( mlt_transition this, mlt_service producer, int a_tra
 
 void mlt_transition_set_in_and_out( mlt_transition this, mlt_timecode in, mlt_timecode out )
 {
-       this->in = in;
-       this->out = out;
+       mlt_properties properties = mlt_transition_properties( this );
+       mlt_properties_set_timecode( properties, "in", in );
+       mlt_properties_set_timecode( properties, "out", out );
 }
 
 /** Get the index of the a track.
@@ -95,7 +103,8 @@ void mlt_transition_set_in_and_out( mlt_transition this, mlt_timecode in, mlt_ti
 
 int mlt_transition_get_a_track( mlt_transition this )
 {
-       return this->a_track;
+       mlt_properties properties = mlt_transition_properties( this );
+       return mlt_properties_get_int( properties, "a_track" );
 }
 
 /** Get the index of the b track.
@@ -103,7 +112,8 @@ int mlt_transition_get_a_track( mlt_transition this )
 
 int mlt_transition_get_b_track( mlt_transition this )
 {
-       return this->b_track;
+       mlt_properties properties = mlt_transition_properties( this );
+       return mlt_properties_get_int( properties, "b_track" );
 }
 
 /** Get the in point.
@@ -111,7 +121,8 @@ int mlt_transition_get_b_track( mlt_transition this )
 
 mlt_timecode mlt_transition_get_in( mlt_transition this )
 {
-       return this->in;
+       mlt_properties properties = mlt_transition_properties( this );
+       return mlt_properties_get_timecode( properties, "in" );
 }
 
 /** Get the out point.
@@ -119,7 +130,8 @@ mlt_timecode mlt_transition_get_in( mlt_transition this )
 
 mlt_timecode mlt_transition_get_out( mlt_transition this )
 {
-       return this->out;
+       mlt_properties properties = mlt_transition_properties( this );
+       return mlt_properties_get_timecode( properties, "out" );
 }
 
 /** Process the frame.
@@ -167,20 +179,27 @@ static int transition_get_frame( mlt_service service, mlt_frame_ptr frame, int i
 {
        mlt_transition this = service->child;
 
+       mlt_properties properties = mlt_transition_properties( this );
+
+       int a_track = mlt_properties_get_int( properties, "a_track" );
+       int b_track = mlt_properties_get_int( properties, "b_track" );
+       mlt_timecode in = mlt_properties_get_timecode( properties, "in" );
+       mlt_timecode out = mlt_properties_get_timecode( properties, "out" );
+
        // Fetch a and b frames together...
-       if ( ( index == this->a_track || index == this->b_track ) &&
+       if ( ( index == a_track || index == b_track ) &&
                 ( this->a_frame == NULL && this->b_frame == NULL ) )
        {
-               mlt_service_get_frame( this->producer, &this->a_frame, this->a_track );
-               mlt_service_get_frame( this->producer, &this->b_frame, this->b_track );
+               mlt_service_get_frame( this->producer, &this->a_frame, a_track );
+               mlt_service_get_frame( this->producer, &this->b_frame, b_track );
        }
        
        // Special case track processing
-       if ( index == this->a_track )
+       if ( index == a_track )
        {
                // Determine if we're in the right time zone
                mlt_timecode timecode = mlt_frame_get_timecode( this->a_frame );
-               if ( timecode >= this->in && timecode < this->out )
+               if ( timecode >= in && timecode < out )
                {
                        // Process the transition
                        *frame = transition_process( this, this->a_frame, this->b_frame );
@@ -197,7 +216,7 @@ static int transition_get_frame( mlt_service service, mlt_frame_ptr frame, int i
                }                       
                return 0;
        }
-       if ( index == this->b_track )
+       if ( index == b_track )
        {
                if ( this->b_frame == NULL )
                {
@@ -207,7 +226,7 @@ static int transition_get_frame( mlt_service service, mlt_frame_ptr frame, int i
                else
                {
                        mlt_timecode timecode = mlt_frame_get_timecode( this->b_frame );
-                       if ( timecode >= this->in && timecode < this->out )
+                       if ( timecode >= in && timecode < out )
                        {
                                // We're in the zone, but the 'a frame' has not been requested yet
                                *frame = mlt_frame_init( );
index 1686199970e962f781476e7e8f239f5feb5fe44f..7ac765c33a721580f000e615a1c4d8e4e04f3205 100644 (file)
@@ -42,10 +42,6 @@ struct mlt_transition_s
        
        // track and in/out points
        mlt_service producer;
-       int a_track;
-       int b_track;
-       mlt_timecode in;
-       mlt_timecode out;
        
        // Private
        mlt_frame a_frame;
index 6568199c5e85c6927fec78b271a179611edf3286..3bda1830a9c7ca0ca5e88f9015ae5b2e39de50ed 100644 (file)
@@ -1,7 +1,8 @@
 TARGET = miracle
 
-OBJS = miracle.o \
-          miracle_log.o \
+APP_OBJS = miracle.o
+
+LIB_OBJS = miracle_log.o \
           miracle_server.o \
           miracle_connection.o \
           miracle_local.o \
@@ -9,25 +10,30 @@ OBJS = miracle.o \
           miracle_commands.o \
           miracle_unit_commands.o
 
+OBJS = $(APP_OBJS) $(LIB_OBJS)
+
 CFLAGS = -I .. -Wall -g -D_FILE_OFFSET_BITS=64 -pthread -rdynamic
 
 LDFLAGS = -L ../valerie -lvalerie -L ../framework -lmlt
 
 SRCS := $(OBJS:.o=.c)
 
-all: $(TARGET)
+all:           $(TARGET)
+
+$(TARGET):     $(APP_OBJS) libmiracle.so
+                       $(CC) -o $@ $(APP_OBJS) -L. -lmiracle $(LDFLAGS)
 
-$(TARGET): $(OBJS)
-               $(CC) -o $@ $(OBJS) $(LDFLAGS)
+libmiracle.so: $(LIB_OBJS)
+                       $(CC) -shared -o $@ $(LIB_OBJS) $(LDFLAGS)
 
-depend:        $(SRCS)
-               $(CC) -MM $(CFLAGS) $^ 1>.depend
+depend:                $(SRCS)
+                       $(CC) -MM $(CFLAGS) $^ 1>.depend
 
 dist-clean:    clean
-               rm -f .depend
+                       rm -f .depend
 
 clean: 
-               rm -f $(OBJS) $(TARGET)
+                       rm -f $(OBJS) $(TARGET) libmiracle.so
 
 ifneq ($(wildcard .depend),)
 include .depend