]> git.sesse.net Git - mlt/commitdiff
Add mlt_profile_clone().
authorDan Dennedy <dan@dennedy.org>
Fri, 8 Oct 2010 05:01:52 +0000 (22:01 -0700)
committerDan Dennedy <dan@dennedy.org>
Fri, 8 Oct 2010 05:01:52 +0000 (22:01 -0700)
src/framework/mlt_profile.c
src/framework/mlt_profile.h

index 09c3258656a6762a6a9c12e0be58e43448e424c7..3baab0efc3345689d6fd845c8eed86a15779e8fd 100644 (file)
@@ -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;
+}
index 2ac6799c297d917ec3359374802e4de4048f0ab9..91e27d9ab8ef57f681fd90f3532f05c0867404ee 100644 (file)
@@ -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