]> git.sesse.net Git - mlt/blobdiff - src/framework/mlt_types.h
Fix movit.convert.fence frame property when using tractor.
[mlt] / src / framework / mlt_types.h
index c4a7df8255fc1e4f797c20f396862e1fc2b2f89e..9a359c045a44a7a20856c9e3b70e2f4b680b3667 100644 (file)
@@ -2,7 +2,7 @@
  * \file mlt_types.h
  * \brief Provides forward definitions of all public types
  *
- * Copyright (C) 2003-2009 Ushodaya Enterprises Limited
+ * Copyright (C) 2003-2012 Ushodaya Enterprises Limited
  * \author Charles Yates <charles.yates@pandora.be>
  *
  * This library is free software; you can redistribute it and/or
 #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
 #endif
 
-#include <stdint.h>
-
+#include <inttypes.h>
+#include <limits.h>
 #include "mlt_pool.h"
 
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
 /** The set of supported image formats */
 
 typedef enum
@@ -40,7 +44,9 @@ typedef enum
        mlt_image_rgb24a,  /**< 8-bit RGB with alpha channel */
        mlt_image_yuv422,  /**< 8-bit YUV 4:2:2 packed */
        mlt_image_yuv420p, /**< 8-bit YUV 4:2:0 planar */
-       mlt_image_opengl   /**< suitable for OpenGL texture */
+       mlt_image_opengl,  /**< (deprecated) suitable for OpenGL texture */
+       mlt_image_glsl,    /**< for opengl module internal use only */
+       mlt_image_glsl_texture /**< an OpenGL texture name */
 }
 mlt_image_format;
 
@@ -52,17 +58,39 @@ typedef enum
        mlt_audio_pcm = 1, /**< \deprecated signed 16-bit interleaved PCM */
        mlt_audio_s16 = 1, /**< signed 16-bit interleaved PCM */
        mlt_audio_s32,     /**< signed 32-bit non-interleaved PCM */
-       mlt_audio_float    /**< 32-bit non-interleaved floating point */
+       mlt_audio_float,   /**< 32-bit non-interleaved floating point */
+       mlt_audio_s32le,   /**< signed 32-bit interleaved PCM */
+       mlt_audio_f32le,   /**< 32-bit interleaved floating point */
+       mlt_audio_u8       /**< unsigned 8-bit interleaved PCM */
 }
 mlt_audio_format;
 
+/** The time string formats */
+
+typedef enum
+{
+       mlt_time_frames = 0, /**< frame count */
+       mlt_time_clock,      /**< SMIL clock-value as [[hh:]mm:]ss[.fraction] */
+       mlt_time_smpte       /**< SMPTE timecode as [[[hh:]mm:]ss:]frames */
+}
+mlt_time_format;
+
+/** Interpolation methods for animation keyframes */
+
+typedef enum {
+       mlt_keyframe_discrete = 0, /**< non-interpolated; value changes instantaneously at the key frame */
+       mlt_keyframe_linear,       /**< simple, constant pace from this key frame to the next */
+       mlt_keyframe_smooth        /**< eased pacing from this keyframe to the next using a Catmull-Rom spline */
+}
+mlt_keyframe_type;
+
 /** The relative time qualifiers */
 
 typedef enum
 {
-       mlt_whence_relative_start /**< relative to the beginning */
-       mlt_whence_relative_current,/**< relative to the current position */
-       mlt_whence_relative_end     /**< relative to the end */
+       mlt_whence_relative_start = 0, /**< relative to the beginning */
+       mlt_whence_relative_current,   /**< relative to the current position */
+       mlt_whence_relative_end        /**< relative to the end */
 }
 mlt_whence;
 
@@ -70,7 +98,7 @@ mlt_whence;
 
 typedef enum
 {
-       invalid_type,               /**< invalid service */
+       invalid_type = 0,           /**< invalid service */
        unknown_type,               /**< unknown class */
        producer_type,              /**< Producer class */
        tractor_type,               /**< Tractor class */
@@ -84,13 +112,37 @@ typedef enum
 mlt_service_type;
 
 /* I don't want to break anyone's applications without warning. -Zach */
-#undef DOUBLE_MLT_POSITION
 #ifdef DOUBLE_MLT_POSITION
+#define MLT_POSITION_FMT "%f"
+#define MLT_POSITION_MOD(A, B) (A - B * ((int)(A / B)))
 typedef double mlt_position;
 #else
+#define MLT_POSITION_MOD(A, B) A % B
+#define MLT_POSITION_FMT "%d"
 typedef int32_t mlt_position;
 #endif
 
+/** A rectangle type with coordinates, size, and opacity */
+
+typedef struct {
+       double x; /**< X coordinate */
+       double y; /**< Y coordinate */
+       double w; /**< width */
+       double h; /**< height */
+       double o; /**< opacity / mix-level */
+}
+mlt_rect;
+
+/** A tuple of color components */
+
+typedef struct {
+       uint8_t r; /**< red */
+       uint8_t g; /**< green */
+       uint8_t b; /**< blue */
+       uint8_t a; /**< alpha */
+}
+mlt_color;
+
 typedef struct mlt_frame_s *mlt_frame, **mlt_frame_ptr; /**< pointer to Frame object */
 typedef struct mlt_property_s *mlt_property;            /**< pointer to Property object */
 typedef struct mlt_properties_s *mlt_properties;        /**< pointer to Properties object */
@@ -112,17 +164,27 @@ typedef struct mlt_profile_s *mlt_profile;              /**< pointer to Profile
 typedef struct mlt_repository_s *mlt_repository;        /**< pointer to Repository object */
 typedef struct mlt_cache_s *mlt_cache;                  /**< pointer to Cache object */
 typedef struct mlt_cache_item_s *mlt_cache_item;        /**< pointer to CacheItem object */
+typedef struct mlt_animation_s *mlt_animation;          /**< pointer to Property Animation object */
 
 typedef void ( *mlt_destructor )( void * );             /**< pointer to destructor function */
 typedef char *( *mlt_serialiser )( void *, int length );/**< pointer to serialization function */
 
-#define MLT_SERVICE(x) ( ( mlt_service )( x ) )         /**< Cast to a Service pointer */
-#define MLT_PRODUCER(x) ( ( mlt_producer )( x ) )       /**< Cast to a Producer pointer */
+#define MLT_SERVICE(x)    ( ( mlt_service )( x ) )      /**< Cast to a Service pointer */
+#define MLT_PRODUCER(x)   ( ( mlt_producer )( x ) )     /**< Cast to a Producer pointer */
 #define MLT_MULTITRACK(x) ( ( mlt_multitrack )( x ) )   /**< Cast to a Multitrack pointer */
-#define MLT_PLAYLIST(x) ( ( mlt_playlist )( x ) )       /**< Cast to a Playlist pointer */
-#define MLT_TRACTOR(x) ( ( mlt_tractor )( x ) )         /**< Cast to a Tractor pointer */
-#define MLT_FILTER(x) ( ( mlt_filter )( x ) )           /**< Cast to a Filter pointer */
+#define MLT_PLAYLIST(x)   ( ( mlt_playlist )( x ) )     /**< Cast to a Playlist pointer */
+#define MLT_TRACTOR(x)    ( ( mlt_tractor )( x ) )      /**< Cast to a Tractor pointer */
+#define MLT_FILTER(x)     ( ( mlt_filter )( x ) )       /**< Cast to a Filter pointer */
 #define MLT_TRANSITION(x) ( ( mlt_transition )( x ) )   /**< Cast to a Transition pointer */
 #define MLT_CONSUMER(x) ( ( mlt_consumer )( x ) )       /**< Cast to a Consumer pointer */
+#define MLT_FRAME(x)      ( ( mlt_frame )( x ) )        /**< Cast to a Frame pointer */
+
+#ifdef WIN32
+#include <pthread.h>
+/* Win32 compatibility function declarations */
+extern int usleep(unsigned int useconds);
+extern int nanosleep( const struct timespec * rqtp, struct timespec * rmtp );
+extern int setenv(const char *name, const char *value, int overwrite);
+#endif
 
 #endif