
// el - A effects library representation.

// Copyright (C) 2007 Editopia Inc.
// Released under the LGPL.
// For more information, see http://www.openlibraries.org.

#include <iostream>

#include <openpluginlib/pl/openpluginlib.hpp>
#include <openpluginlib/pl/timer.hpp>
#include <openmedialib/ml/ml.hpp>

namespace ml = olib::openmedialib::ml;
namespace pl = olib::openpluginlib;

void run( char* argv )
{
	ml::input_type_ptr  input  = ml::create_input( pl::string( argv ) + pl::string( "/sequence:" ) );
	ml::filter_type_ptr filter = ml::create_filter( L"tm_linear" );

	pl::rdtsc_default_timer	r;
	
	r.reset( );
	r.start( );
	
	if( input && filter )
	{
		for( int i = 0; i < 10; ++i )
		{
			filter->connect( input );
			filter->fetch( );
		}
	}
	
	r.stop( );
	pl::rdtsc_default_timer::value_type elapsed = r.elapsed( );
	std::cout << "rdtsc: elapsed time is " << elapsed.tv_sec << " seconds and " << elapsed.tv_usec << " microseconds.\n";
}

int main( int argc, char* argv[ ] )
{
	pl::init( "" );
	
	run( argv[ 1 ] );
	
	pl::uninit( );
}
