From: Dan Dennedy Date: Fri, 8 Oct 2010 05:01:52 +0000 (-0700) Subject: Add mlt_profile_clone(). X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=41765733f12375a01994036780ec9b723737b41d;p=mlt Add mlt_profile_clone(). --- diff --git a/src/framework/mlt_profile.c b/src/framework/mlt_profile.c index 09c32586..3baab0ef 100644 --- a/src/framework/mlt_profile.c +++ b/src/framework/mlt_profile.c @@ -311,3 +311,26 @@ void mlt_profile_close( mlt_profile profile ) profile = NULL; } } + +/** Make a copy of a profile. + * + * \public \memberof mlt_profile_s + * \param profile the profile to clone + * \return a copy of the profile + */ + +mlt_profile mlt_profile_clone( mlt_profile profile ) +{ + mlt_profile clone = NULL; + + if ( profile ) + { + clone = calloc( 1, sizeof( *profile ) ); + if ( clone ) + { + memcpy( clone, profile, sizeof( *profile ) ); + clone->description = strdup( profile->description ); + } + } + return clone; +} diff --git a/src/framework/mlt_profile.h b/src/framework/mlt_profile.h index 2ac6799c..91e27d9a 100644 --- a/src/framework/mlt_profile.h +++ b/src/framework/mlt_profile.h @@ -43,6 +43,7 @@ struct mlt_profile_s int display_aspect_num; /**< the numerator of the image aspect ratio in case it can not be simply derived (e.g. ITU-R 601) */ int display_aspect_den; /**< the denominator of the image aspect ratio in case it can not be simply derived (e.g. ITU-R 601) */ int colorspace; /**< the Y'CbCr colorspace standard: =601 for ITU-R 601, =709 for ITU-R 709, or =240 for SMPTE240M */ + int is_explicit; /**< used internally to indicate if the profile was requested explicitly or computed or defaulted */ }; extern mlt_profile mlt_profile_init( const char *name ); @@ -53,4 +54,5 @@ extern double mlt_profile_fps( mlt_profile profile ); extern double mlt_profile_sar( mlt_profile profile ); extern double mlt_profile_dar( mlt_profile profile ); extern void mlt_profile_close( mlt_profile profile ); +extern mlt_profile mlt_profile_clone( mlt_profile profile ); #endif