Known Bugs
- Can be problematic with source NTSC DV files? really?
+ Can be problematic with source NTSC DV files? really? yes - try
+ playing pond.dv...
mcmpeg
Known Bugs
- Can be problematic with source NTSC DV files? really?
+ Can be problematic with source NTSC DV files? really? yes - try
+ playing pond.dv...
mcmpeg
int mlt_playlist_get_clip_info( mlt_playlist this, mlt_playlist_clip_info *info, int index )
{
int error = index < 0 || index >= this->count;
+ memset( info, 0, sizeof( mlt_playlist_clip_info ) );
if ( !error )
{
mlt_producer producer = this->list[ index ]->producer;
int mlt_playlist_clear( mlt_playlist this )
{
this->count = 0;
+ mlt_properties_set_double( mlt_playlist_properties( this ), "first_fps", 0 );
return mlt_playlist_virtual_refresh( this );
}
return mlt_playlist_virtual_append( this, &this->blank, 0, length );
}
+/** Insert a producer into the playlist.
+*/
+
+int mlt_playlist_insert( mlt_playlist this, mlt_producer producer, int where, mlt_timecode in, mlt_timecode out )
+{
+ return 0;
+}
+
+int mlt_playlist_remove( mlt_playlist this, int where )
+{
+ return 0;
+}
+
+int mlt_playlist_move( mlt_playlist this, int from, int to )
+{
+ return 0;
+}
+
/** Get the current frame.
*/
extern int mlt_playlist_current_clip( mlt_playlist this );
extern mlt_producer mlt_playlist_current( mlt_playlist this );
extern int mlt_playlist_get_clip_info( mlt_playlist this, mlt_playlist_clip_info *info, int index );
+extern int mlt_playlist_insert( mlt_playlist this, mlt_producer producer, int where, mlt_timecode in, mlt_timecode out );
+extern int mlt_playlist_remove( mlt_playlist this, int where );
+extern int mlt_playlist_move( mlt_playlist this, int from, int to );
extern void mlt_playlist_close( mlt_playlist this );
#endif
property_list *list = this->private;
int index = 0;
+ int debug = mlt_properties_get_int( this, "debug" );
+
// Clean up names and values
for ( index = 0; index < list->count; index ++ )
{
+ if ( debug )
+ fprintf( stderr, "closing %s\n", list->name[ index ] );
free( list->name[ index ] );
mlt_property_close( list->value[ index ] );
}
return valerie_invalid_file;
}
-valerie_error_code miracle_unit_insert( miracle_unit unit, const char *clip, int index, double in, double out )
+valerie_error_code miracle_unit_insert( miracle_unit unit, char *clip, int index, double in, double out )
{
- /*
- dv_player player = miracle_unit_get_dv_player( unit );
- valerie_error_code error = dv_player_get_error( player );
- if ( error == dv_pump_ok )
+ mlt_producer instance = create_producer( unit, clip );
+
+ if ( instance != NULL )
{
- error = dv_player_insert_file( player, (char*) clip, index, in, out );
- dv1394d_log( LOG_DEBUG, "inserted clip %s", clip );
- if ( unit->is_terminated )
- miracle_unit_status_communicate( unit );
+ mlt_properties properties = unit->properties;
+ mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
+ mlt_playlist_insert( playlist, instance, index, in, out );
+ miracle_log( LOG_DEBUG, "inserted clip %s at %d", clip, index );
+ miracle_unit_status_communicate( unit );
+ return valerie_ok;
}
- return error;
- */
- return valerie_ok;
+
+ return valerie_invalid_file;
}
valerie_error_code miracle_unit_remove( miracle_unit unit, int index )
{
- /*
- dv_player player = miracle_unit_get_dv_player( unit );
- valerie_error_code error = dv_player_get_error( player );
- if ( error == dv_pump_ok )
- {
- error = dv_player_remove_clip( player, index );
- dv1394d_log( LOG_DEBUG, "removed clip %d", index );
- if ( unit->is_terminated )
- miracle_unit_status_communicate( unit );
- }
- return error;
- */
+ mlt_properties properties = unit->properties;
+ mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
+ mlt_playlist_remove( playlist, index );
+ miracle_log( LOG_DEBUG, "removed clip at %d", index );
+ miracle_unit_status_communicate( unit );
return valerie_ok;
}
valerie_error_code miracle_unit_move( miracle_unit unit, int src, int dest )
{
- /*
- dv_player player = miracle_unit_get_dv_player( unit );
- valerie_error_code error = dv_player_get_error( player );
- if ( error == dv_pump_ok )
- {
- error = dv_player_move_clip( player, src, dest );
- dv1394d_log( LOG_DEBUG, "moved clip %d to %d", src, dest );
- if ( unit->is_terminated )
- miracle_unit_status_communicate( unit );
- }
- return error;
- */
+ mlt_properties properties = unit->properties;
+ mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
+ mlt_playlist_move( playlist, src, dest );
+ miracle_log( LOG_DEBUG, "moved clip %d to %d", src, dest );
+ miracle_unit_status_communicate( unit );
return valerie_ok;
}
miracle_unit_status_communicate( unit );
}
-/** Change speed.
+/** Get the index of the current clip.
*/
-void miracle_unit_change_speed( miracle_unit unit, int speed )
-{
-}
-
int miracle_unit_get_current_clip( miracle_unit unit )
{
- return 0;
+ mlt_properties properties = unit->properties;
+ mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
+ int clip_index = mlt_playlist_current_clip( playlist );
+ return clip_index;
}
/** Set a clip's in point
extern void miracle_unit_report_list( miracle_unit unit, valerie_response response );
extern void miracle_unit_allow_stdin( miracle_unit unit, int flag );
extern valerie_error_code miracle_unit_load( miracle_unit unit, char *clip, double in, double out, int flush );
-extern valerie_error_code miracle_unit_insert( miracle_unit unit, const char *clip, int index, double in, double out );
+extern valerie_error_code miracle_unit_insert( miracle_unit unit, char *clip, int index, double in, double out );
extern valerie_error_code miracle_unit_append( miracle_unit unit, char *clip, double in, double out );
extern valerie_error_code miracle_unit_remove( miracle_unit unit, int index );
extern valerie_error_code miracle_unit_clean( miracle_unit unit );
return RESPONSE_INVALID_UNIT;
}
-/*
+
static int parse_clip( command_argument cmd_arg, int arg )
{
- dv_unit unit = miracle_get_unit(cmd_arg->unit);
- int clip = dv_unit_get_current_clip( unit );
+ miracle_unit unit = miracle_get_unit(cmd_arg->unit);
+ int clip = miracle_unit_get_current_clip( unit );
- if ( dv_tokeniser_count( cmd_arg->tokeniser ) > arg )
+ if ( valerie_tokeniser_count( cmd_arg->tokeniser ) > arg )
{
- dv_player player = dv_unit_get_dv_player( unit );
- char *token = dv_tokeniser_get_string( cmd_arg->tokeniser, arg );
+ char *token = valerie_tokeniser_get_string( cmd_arg->tokeniser, arg );
if ( token[ 0 ] == '+' )
clip += atoi( token + 1 );
else if ( token[ 0 ] == '-' )
clip -= atoi( token + 1 );
else
clip = atoi( token );
- if ( clip < 0 )
- clip = 0;
- if ( clip >= player->size )
- clip = player->size - 1;
}
return clip;
}
-*/
int miracle_insert( command_argument cmd_arg )
{
- /*
- dv_unit unit = miracle_get_unit(cmd_arg->unit);
+ miracle_unit unit = miracle_get_unit(cmd_arg->unit);
char *filename = (char*) cmd_arg->argument;
char fullname[1024];
long in = -1, out = -1;
int index = parse_clip( cmd_arg, 3 );
- if ( dv_tokeniser_count( cmd_arg->tokeniser ) == 6 )
+ if ( valerie_tokeniser_count( cmd_arg->tokeniser ) == 6 )
{
- in = atoi( dv_tokeniser_get_string( cmd_arg->tokeniser, 4 ) );
- out = atoi( dv_tokeniser_get_string( cmd_arg->tokeniser, 5 ) );
+ in = atoi( valerie_tokeniser_get_string( cmd_arg->tokeniser, 4 ) );
+ out = atoi( valerie_tokeniser_get_string( cmd_arg->tokeniser, 5 ) );
}
- switch( dv_unit_insert( unit, fullname, index, in, out ) )
+ switch( miracle_unit_insert( unit, fullname, index, in, out ) )
{
- case dv_pump_ok:
+ case valerie_ok:
return RESPONSE_SUCCESS;
- case dv_pump_too_many_files_open:
- return RESPONSE_TOO_MANY_FILES;
default:
return RESPONSE_BAD_FILE;
}
}
- */
return RESPONSE_SUCCESS;
}
int miracle_remove( command_argument cmd_arg )
{
- /*
- dv_unit unit = miracle_get_unit(cmd_arg->unit);
+ miracle_unit unit = miracle_get_unit(cmd_arg->unit);
if (unit == NULL)
return RESPONSE_INVALID_UNIT;
{
int index = parse_clip( cmd_arg, 2 );
- if ( dv_unit_remove( unit, index ) != dv_pump_ok )
+ if ( miracle_unit_remove( unit, index ) != valerie_ok )
return RESPONSE_BAD_FILE;
}
- */
return RESPONSE_SUCCESS;
}
int miracle_clean( command_argument cmd_arg )
{
- /*
- dv_unit unit = miracle_get_unit(cmd_arg->unit);
+ miracle_unit unit = miracle_get_unit(cmd_arg->unit);
if (unit == NULL)
return RESPONSE_INVALID_UNIT;
else
{
- if ( dv_unit_clean( unit ) != dv_pump_ok )
+ if ( miracle_unit_clean( unit ) != valerie_ok )
return RESPONSE_BAD_FILE;
}
- */
return RESPONSE_SUCCESS;
}
int miracle_move( command_argument cmd_arg )
{
- /*
- dv_unit unit = miracle_get_unit(cmd_arg->unit);
+ miracle_unit unit = miracle_get_unit(cmd_arg->unit);
if ( unit != NULL )
{
- if ( dv_tokeniser_count( cmd_arg->tokeniser ) > 2 )
+ if ( valerie_tokeniser_count( cmd_arg->tokeniser ) > 2 )
{
int src = parse_clip( cmd_arg, 2 );
int dest = parse_clip( cmd_arg, 3 );
- if ( dv_unit_move( unit, src, dest ) != dv_pump_ok )
+ if ( miracle_unit_move( unit, src, dest ) != valerie_ok )
return RESPONSE_BAD_FILE;
}
else
{
return RESPONSE_INVALID_UNIT;
}
- */
return RESPONSE_SUCCESS;
}
int miracle_step( command_argument cmd_arg )
{
- /*
- dv_unit unit = miracle_get_unit(cmd_arg->unit);
+ miracle_unit unit = miracle_get_unit(cmd_arg->unit);
- if (unit == NULL || dv_unit_is_offline(unit))
+ if (unit == NULL)
return RESPONSE_INVALID_UNIT;
else
{
- dv_unit_play( unit, 0 );
- dv_unit_step( unit, *(int*) cmd_arg->argument );
+ miracle_unit_play( unit, 0 );
+ miracle_unit_step( unit, *(int*) cmd_arg->argument );
}
- */
return RESPONSE_SUCCESS;
}
int miracle_goto( command_argument cmd_arg )
{
- /*
- dv_unit unit = miracle_get_unit(cmd_arg->unit);
+ miracle_unit unit = miracle_get_unit(cmd_arg->unit);
int clip = parse_clip( cmd_arg, 3 );
- if (unit == NULL || dv_unit_is_offline(unit))
+ if (unit == NULL || miracle_unit_is_offline(unit))
return RESPONSE_INVALID_UNIT;
else
- dv_unit_change_position( unit, clip, *(int*) cmd_arg->argument );
- */
+ miracle_unit_change_position( unit, clip, *(int*) cmd_arg->argument );
return RESPONSE_SUCCESS;
}
producer_libdv this = parent->child;
// Free the dv deconder
- dv_decoder_free( this->dv_decoder );
+ //dv_decoder_free( this->dv_decoder );
// Close the file
if ( this->fd != 0 )
int mlt_playlist_get_clip_info( mlt_playlist this, mlt_playlist_clip_info *info, int index )
{
int error = index < 0 || index >= this->count;
+ memset( info, 0, sizeof( mlt_playlist_clip_info ) );
if ( !error )
{
mlt_producer producer = this->list[ index ]->producer;
int mlt_playlist_clear( mlt_playlist this )
{
this->count = 0;
+ mlt_properties_set_double( mlt_playlist_properties( this ), "first_fps", 0 );
return mlt_playlist_virtual_refresh( this );
}
return mlt_playlist_virtual_append( this, &this->blank, 0, length );
}
+/** Insert a producer into the playlist.
+*/
+
+int mlt_playlist_insert( mlt_playlist this, mlt_producer producer, int where, mlt_timecode in, mlt_timecode out )
+{
+ return 0;
+}
+
+int mlt_playlist_remove( mlt_playlist this, int where )
+{
+ return 0;
+}
+
+int mlt_playlist_move( mlt_playlist this, int from, int to )
+{
+ return 0;
+}
+
/** Get the current frame.
*/
extern int mlt_playlist_current_clip( mlt_playlist this );
extern mlt_producer mlt_playlist_current( mlt_playlist this );
extern int mlt_playlist_get_clip_info( mlt_playlist this, mlt_playlist_clip_info *info, int index );
+extern int mlt_playlist_insert( mlt_playlist this, mlt_producer producer, int where, mlt_timecode in, mlt_timecode out );
+extern int mlt_playlist_remove( mlt_playlist this, int where );
+extern int mlt_playlist_move( mlt_playlist this, int from, int to );
extern void mlt_playlist_close( mlt_playlist this );
#endif
property_list *list = this->private;
int index = 0;
+ int debug = mlt_properties_get_int( this, "debug" );
+
// Clean up names and values
for ( index = 0; index < list->count; index ++ )
{
+ if ( debug )
+ fprintf( stderr, "closing %s\n", list->name[ index ] );
free( list->name[ index ] );
mlt_property_close( list->value[ index ] );
}
return valerie_invalid_file;
}
-valerie_error_code miracle_unit_insert( miracle_unit unit, const char *clip, int index, double in, double out )
+valerie_error_code miracle_unit_insert( miracle_unit unit, char *clip, int index, double in, double out )
{
- /*
- dv_player player = miracle_unit_get_dv_player( unit );
- valerie_error_code error = dv_player_get_error( player );
- if ( error == dv_pump_ok )
+ mlt_producer instance = create_producer( unit, clip );
+
+ if ( instance != NULL )
{
- error = dv_player_insert_file( player, (char*) clip, index, in, out );
- dv1394d_log( LOG_DEBUG, "inserted clip %s", clip );
- if ( unit->is_terminated )
- miracle_unit_status_communicate( unit );
+ mlt_properties properties = unit->properties;
+ mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
+ mlt_playlist_insert( playlist, instance, index, in, out );
+ miracle_log( LOG_DEBUG, "inserted clip %s at %d", clip, index );
+ miracle_unit_status_communicate( unit );
+ return valerie_ok;
}
- return error;
- */
- return valerie_ok;
+
+ return valerie_invalid_file;
}
valerie_error_code miracle_unit_remove( miracle_unit unit, int index )
{
- /*
- dv_player player = miracle_unit_get_dv_player( unit );
- valerie_error_code error = dv_player_get_error( player );
- if ( error == dv_pump_ok )
- {
- error = dv_player_remove_clip( player, index );
- dv1394d_log( LOG_DEBUG, "removed clip %d", index );
- if ( unit->is_terminated )
- miracle_unit_status_communicate( unit );
- }
- return error;
- */
+ mlt_properties properties = unit->properties;
+ mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
+ mlt_playlist_remove( playlist, index );
+ miracle_log( LOG_DEBUG, "removed clip at %d", index );
+ miracle_unit_status_communicate( unit );
return valerie_ok;
}
valerie_error_code miracle_unit_move( miracle_unit unit, int src, int dest )
{
- /*
- dv_player player = miracle_unit_get_dv_player( unit );
- valerie_error_code error = dv_player_get_error( player );
- if ( error == dv_pump_ok )
- {
- error = dv_player_move_clip( player, src, dest );
- dv1394d_log( LOG_DEBUG, "moved clip %d to %d", src, dest );
- if ( unit->is_terminated )
- miracle_unit_status_communicate( unit );
- }
- return error;
- */
+ mlt_properties properties = unit->properties;
+ mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
+ mlt_playlist_move( playlist, src, dest );
+ miracle_log( LOG_DEBUG, "moved clip %d to %d", src, dest );
+ miracle_unit_status_communicate( unit );
return valerie_ok;
}
miracle_unit_status_communicate( unit );
}
-/** Change speed.
+/** Get the index of the current clip.
*/
-void miracle_unit_change_speed( miracle_unit unit, int speed )
-{
-}
-
int miracle_unit_get_current_clip( miracle_unit unit )
{
- return 0;
+ mlt_properties properties = unit->properties;
+ mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
+ int clip_index = mlt_playlist_current_clip( playlist );
+ return clip_index;
}
/** Set a clip's in point
extern void miracle_unit_report_list( miracle_unit unit, valerie_response response );
extern void miracle_unit_allow_stdin( miracle_unit unit, int flag );
extern valerie_error_code miracle_unit_load( miracle_unit unit, char *clip, double in, double out, int flush );
-extern valerie_error_code miracle_unit_insert( miracle_unit unit, const char *clip, int index, double in, double out );
+extern valerie_error_code miracle_unit_insert( miracle_unit unit, char *clip, int index, double in, double out );
extern valerie_error_code miracle_unit_append( miracle_unit unit, char *clip, double in, double out );
extern valerie_error_code miracle_unit_remove( miracle_unit unit, int index );
extern valerie_error_code miracle_unit_clean( miracle_unit unit );
return RESPONSE_INVALID_UNIT;
}
-/*
+
static int parse_clip( command_argument cmd_arg, int arg )
{
- dv_unit unit = miracle_get_unit(cmd_arg->unit);
- int clip = dv_unit_get_current_clip( unit );
+ miracle_unit unit = miracle_get_unit(cmd_arg->unit);
+ int clip = miracle_unit_get_current_clip( unit );
- if ( dv_tokeniser_count( cmd_arg->tokeniser ) > arg )
+ if ( valerie_tokeniser_count( cmd_arg->tokeniser ) > arg )
{
- dv_player player = dv_unit_get_dv_player( unit );
- char *token = dv_tokeniser_get_string( cmd_arg->tokeniser, arg );
+ char *token = valerie_tokeniser_get_string( cmd_arg->tokeniser, arg );
if ( token[ 0 ] == '+' )
clip += atoi( token + 1 );
else if ( token[ 0 ] == '-' )
clip -= atoi( token + 1 );
else
clip = atoi( token );
- if ( clip < 0 )
- clip = 0;
- if ( clip >= player->size )
- clip = player->size - 1;
}
return clip;
}
-*/
int miracle_insert( command_argument cmd_arg )
{
- /*
- dv_unit unit = miracle_get_unit(cmd_arg->unit);
+ miracle_unit unit = miracle_get_unit(cmd_arg->unit);
char *filename = (char*) cmd_arg->argument;
char fullname[1024];
long in = -1, out = -1;
int index = parse_clip( cmd_arg, 3 );
- if ( dv_tokeniser_count( cmd_arg->tokeniser ) == 6 )
+ if ( valerie_tokeniser_count( cmd_arg->tokeniser ) == 6 )
{
- in = atoi( dv_tokeniser_get_string( cmd_arg->tokeniser, 4 ) );
- out = atoi( dv_tokeniser_get_string( cmd_arg->tokeniser, 5 ) );
+ in = atoi( valerie_tokeniser_get_string( cmd_arg->tokeniser, 4 ) );
+ out = atoi( valerie_tokeniser_get_string( cmd_arg->tokeniser, 5 ) );
}
- switch( dv_unit_insert( unit, fullname, index, in, out ) )
+ switch( miracle_unit_insert( unit, fullname, index, in, out ) )
{
- case dv_pump_ok:
+ case valerie_ok:
return RESPONSE_SUCCESS;
- case dv_pump_too_many_files_open:
- return RESPONSE_TOO_MANY_FILES;
default:
return RESPONSE_BAD_FILE;
}
}
- */
return RESPONSE_SUCCESS;
}
int miracle_remove( command_argument cmd_arg )
{
- /*
- dv_unit unit = miracle_get_unit(cmd_arg->unit);
+ miracle_unit unit = miracle_get_unit(cmd_arg->unit);
if (unit == NULL)
return RESPONSE_INVALID_UNIT;
{
int index = parse_clip( cmd_arg, 2 );
- if ( dv_unit_remove( unit, index ) != dv_pump_ok )
+ if ( miracle_unit_remove( unit, index ) != valerie_ok )
return RESPONSE_BAD_FILE;
}
- */
return RESPONSE_SUCCESS;
}
int miracle_clean( command_argument cmd_arg )
{
- /*
- dv_unit unit = miracle_get_unit(cmd_arg->unit);
+ miracle_unit unit = miracle_get_unit(cmd_arg->unit);
if (unit == NULL)
return RESPONSE_INVALID_UNIT;
else
{
- if ( dv_unit_clean( unit ) != dv_pump_ok )
+ if ( miracle_unit_clean( unit ) != valerie_ok )
return RESPONSE_BAD_FILE;
}
- */
return RESPONSE_SUCCESS;
}
int miracle_move( command_argument cmd_arg )
{
- /*
- dv_unit unit = miracle_get_unit(cmd_arg->unit);
+ miracle_unit unit = miracle_get_unit(cmd_arg->unit);
if ( unit != NULL )
{
- if ( dv_tokeniser_count( cmd_arg->tokeniser ) > 2 )
+ if ( valerie_tokeniser_count( cmd_arg->tokeniser ) > 2 )
{
int src = parse_clip( cmd_arg, 2 );
int dest = parse_clip( cmd_arg, 3 );
- if ( dv_unit_move( unit, src, dest ) != dv_pump_ok )
+ if ( miracle_unit_move( unit, src, dest ) != valerie_ok )
return RESPONSE_BAD_FILE;
}
else
{
return RESPONSE_INVALID_UNIT;
}
- */
return RESPONSE_SUCCESS;
}
int miracle_step( command_argument cmd_arg )
{
- /*
- dv_unit unit = miracle_get_unit(cmd_arg->unit);
+ miracle_unit unit = miracle_get_unit(cmd_arg->unit);
- if (unit == NULL || dv_unit_is_offline(unit))
+ if (unit == NULL)
return RESPONSE_INVALID_UNIT;
else
{
- dv_unit_play( unit, 0 );
- dv_unit_step( unit, *(int*) cmd_arg->argument );
+ miracle_unit_play( unit, 0 );
+ miracle_unit_step( unit, *(int*) cmd_arg->argument );
}
- */
return RESPONSE_SUCCESS;
}
int miracle_goto( command_argument cmd_arg )
{
- /*
- dv_unit unit = miracle_get_unit(cmd_arg->unit);
+ miracle_unit unit = miracle_get_unit(cmd_arg->unit);
int clip = parse_clip( cmd_arg, 3 );
- if (unit == NULL || dv_unit_is_offline(unit))
+ if (unit == NULL || miracle_unit_is_offline(unit))
return RESPONSE_INVALID_UNIT;
else
- dv_unit_change_position( unit, clip, *(int*) cmd_arg->argument );
- */
+ miracle_unit_change_position( unit, clip, *(int*) cmd_arg->argument );
return RESPONSE_SUCCESS;
}
producer_libdv this = parent->child;
// Free the dv deconder
- dv_decoder_free( this->dv_decoder );
+ //dv_decoder_free( this->dv_decoder );
// Close the file
if ( this->fd != 0 )