MLT
7.28.0
|
Property class. More...
Public Member Functions | |
mlt_color | mlt_property_anim_get_color (mlt_property self, double fps, mlt_locale_t locale, int position, int length) |
Get a color at a frame position. More... | |
double | mlt_property_anim_get_double (mlt_property self, double fps, mlt_locale_t locale, int position, int length) |
Get the real number at a frame position. More... | |
int | mlt_property_anim_get_int (mlt_property self, double fps, mlt_locale_t locale, int position, int length) |
Get the property as an integer number at a frame position. More... | |
mlt_rect | mlt_property_anim_get_rect (mlt_property self, double fps, mlt_locale_t locale, int position, int length) |
Get a rectangle at a frame position. More... | |
char * | mlt_property_anim_get_string (mlt_property self, double fps, mlt_locale_t locale, int position, int length) |
Get the string at certain a frame position. More... | |
int | mlt_property_anim_set_color (mlt_property self, mlt_color value, double fps, mlt_locale_t locale, int position, int length, mlt_keyframe_type keyframe_type) |
Set a property animation keyframe to a color. More... | |
int | mlt_property_anim_set_double (mlt_property self, double value, double fps, mlt_locale_t locale, int position, int length, mlt_keyframe_type keyframe_type) |
Set a property animation keyframe to a real number. More... | |
int | mlt_property_anim_set_int (mlt_property self, int value, double fps, mlt_locale_t locale, int position, int length, mlt_keyframe_type keyframe_type) |
Set a property animation keyframe to an integer value. More... | |
int | mlt_property_anim_set_rect (mlt_property self, mlt_rect value, double fps, mlt_locale_t locale, int position, int length, mlt_keyframe_type keyframe_type) |
Set a property animation keyframe to a rectangle. More... | |
int | mlt_property_anim_set_string (mlt_property self, const char *value, double fps, mlt_locale_t locale, int position, int length) |
Set a property animation keyframe to a string. More... | |
void | mlt_property_clear (mlt_property self) |
Clear (0/null) a property. More... | |
void | mlt_property_close (mlt_property self) |
Destroy a property and free all related resources. More... | |
mlt_animation | mlt_property_get_animation (mlt_property self) |
Get an object's animation object. More... | |
mlt_color | mlt_property_get_color (mlt_property self, double fps, mlt_locale_t locale) |
Get the property as a color. More... | |
void * | mlt_property_get_data (mlt_property self, int *length) |
Get the binary data from a property. More... | |
double | mlt_property_get_double (mlt_property self, double fps, mlt_locale_t locale) |
Get the property as a floating point. More... | |
int | mlt_property_get_int (mlt_property self, double fps, mlt_locale_t locale) |
Get the property as an integer. More... | |
int64_t | mlt_property_get_int64 (mlt_property self) |
Get the property as a signed integer. More... | |
mlt_position | mlt_property_get_position (mlt_property self, double fps, mlt_locale_t locale) |
Get the property as a position. More... | |
mlt_properties | mlt_property_get_properties (mlt_property self) |
Get a nested properties object. More... | |
mlt_rect | mlt_property_get_rect (mlt_property self, mlt_locale_t locale) |
Get the property as a rectangle. More... | |
char * | mlt_property_get_string (mlt_property self) |
Get the property as a string. More... | |
char * | mlt_property_get_string_l (mlt_property self, mlt_locale_t locale) |
Get the property as a string (with locale). More... | |
char * | mlt_property_get_string_l_tf (mlt_property self, mlt_locale_t locale, mlt_time_format time_format) |
Get the property as a string (with locale and time format). More... | |
char * | mlt_property_get_string_tf (mlt_property self, mlt_time_format time_format) |
Get the property as a string (with time format). More... | |
char * | mlt_property_get_time (mlt_property self, mlt_time_format format, double fps, mlt_locale_t locale) |
Get the property as a time string. More... | |
mlt_property | mlt_property_init () |
Construct a property and initialize it. More... | |
int | mlt_property_interpolate (mlt_property self, mlt_property p[], double progress, double fps, mlt_locale_t locale, mlt_keyframe_type interp) |
Interpolate a new property value given a set of other properties. More... | |
int | mlt_property_is_anim (mlt_property self) |
Check if a property is animated. More... | |
int | mlt_property_is_clear (mlt_property self) |
Check if a property is cleared. More... | |
int | mlt_property_is_color (mlt_property self) |
Check if a property is a color. More... | |
int | mlt_property_is_numeric (mlt_property self, mlt_locale_t locale) |
Determine if the property holds a numeric or numeric string value. More... | |
int | mlt_property_is_rect (mlt_property self) |
Check if a property is a rect. More... | |
void | mlt_property_pass (mlt_property self, mlt_property that) |
Copy a property. More... | |
int | mlt_property_set_color (mlt_property self, mlt_color value) |
Set the property to a color value. More... | |
int | mlt_property_set_data (mlt_property self, void *value, int length, mlt_destructor destructor, mlt_serialiser serialiser) |
Set a property to an opaque binary value. More... | |
int | mlt_property_set_double (mlt_property self, double value) |
Set the property to a floating point value. More... | |
int | mlt_property_set_int (mlt_property self, int value) |
Set the property to an integer value. More... | |
int | mlt_property_set_int64 (mlt_property self, int64_t value) |
Set the property to a 64-bit integer value. More... | |
int | mlt_property_set_position (mlt_property self, mlt_position value) |
Set the property to a position value. More... | |
int | mlt_property_set_properties (mlt_property self, mlt_properties properties) |
Set a nested properties object. More... | |
int | mlt_property_set_rect (mlt_property self, mlt_rect value) |
Set a property to a mlt_rect rectangle. More... | |
int | mlt_property_set_string (mlt_property self, const char *value) |
Set the property to a string value. More... | |
Data Fields | |
mlt_animation | animation |
void * | data |
Generic type handling. More... | |
mlt_destructor | destructor |
int | length |
pthread_mutex_t | mutex |
double | prop_double |
int | prop_int |
Atomic type handling. More... | |
int64_t | prop_int64 |
mlt_position | prop_position |
char * | prop_string |
String handling. More... | |
mlt_properties | properties |
mlt_serialiser | serialiser |
mlt_property_type | types |
Stores a bit pattern of types available for this property. More... | |
Private Member Functions | |
static double | catmull_rom_interpolate (double y0, double y1, double y2, double y3, double t) |
A smooth spline interpolation for animation. More... | |
static void | clear_property (mlt_property self) |
Clear (0/null) a property. More... | |
static double | linear_interpolate (double y1, double y2, double t) |
A linear interpolation function for animation. More... | |
static double | mlt_property_atof (mlt_property self, double fps, mlt_locale_t locale) |
Convert a string to a floating point number. More... | |
static int | mlt_property_atoi (mlt_property self, double fps, mlt_locale_t locale) |
Convert a string to an integer. More... | |
static int64_t | mlt_property_atoll (const char *value) |
Convert a string to a 64-bit integer. More... | |
static void | refresh_animation (mlt_property self, double fps, mlt_locale_t locale, int length) |
Create a new animation or refresh an existing one. More... | |
static char * | serialise_mlt_rect (mlt_rect *rect, int length) |
Convert a rectangle value into a string. More... | |
static void | time_clock_from_frames (int frames, double fps, char *s) |
Convert frame count to a SMIL clock value string. More... | |
static int | time_clock_to_frames (mlt_property self, const char *s, double fps, mlt_locale_t locale) |
Parse a SMIL clock value. More... | |
static int | time_code_to_frames (mlt_property self, const char *s, double fps) |
Parse a SMPTE timecode string. More... | |
static void | time_smpte_from_frames (int frames, double fps, char *s, int drop) |
Convert frame count to a SMPTE timecode string. More... | |
Property class.
A property is like a variant or dynamic type. They are used for many things in MLT, but in particular they are the parameter mechanism for the plugins.
|
inlineprivate |
A smooth spline interpolation for animation.
|
private |
Clear (0/null) a property.
Frees up any associated resources in the process.
self | a property |
|
inlineprivate |
A linear interpolation function for animation.
mlt_color mlt_property_anim_get_color | ( | mlt_property | self, |
double | fps, | ||
mlt_locale_t | locale, | ||
int | position, | ||
int | length | ||
) |
Get a color at a frame position.
self | a property |
fps | the frame rate, which may be needed for converting a time string to frame units |
locale | the locale, which may be needed for converting a string to a real number |
position | the frame number |
length | the maximum number of frames when interpreting negative keyframe times, <=0 if you don't care or need that |
double mlt_property_anim_get_double | ( | mlt_property | self, |
double | fps, | ||
mlt_locale_t | locale, | ||
int | position, | ||
int | length | ||
) |
Get the real number at a frame position.
self | a property |
fps | the frame rate, which may be needed for converting a time string to frame units |
locale | the locale, which may be needed for converting a string to a real number |
position | the frame number |
length | the maximum number of frames when interpreting negative keyframe times, <=0 if you don't care or need that |
int mlt_property_anim_get_int | ( | mlt_property | self, |
double | fps, | ||
mlt_locale_t | locale, | ||
int | position, | ||
int | length | ||
) |
Get the property as an integer number at a frame position.
self | a property |
fps | the frame rate, which may be needed for converting a time string to frame units |
locale | the locale, which may be needed for converting a string to a real number |
position | the frame number |
length | the maximum number of frames when interpreting negative keyframe times, <=0 if you don't care or need that |
mlt_rect mlt_property_anim_get_rect | ( | mlt_property | self, |
double | fps, | ||
mlt_locale_t | locale, | ||
int | position, | ||
int | length | ||
) |
Get a rectangle at a frame position.
self | a property |
fps | the frame rate, which may be needed for converting a time string to frame units |
locale | the locale, which may be needed for converting a string to a real number |
position | the frame number |
length | the maximum number of frames when interpreting negative keyframe times, <=0 if you don't care or need that |
char * mlt_property_anim_get_string | ( | mlt_property | self, |
double | fps, | ||
mlt_locale_t | locale, | ||
int | position, | ||
int | length | ||
) |
Get the string at certain a frame position.
self | a property |
fps | the frame rate, which may be needed for converting a time string to frame units |
locale | the locale, which may be needed for converting a string to a real number |
position | the frame number |
length | the maximum number of frames when interpreting negative keyframe times, <=0 if you don't care or need that |
int mlt_property_anim_set_color | ( | mlt_property | self, |
mlt_color | value, | ||
double | fps, | ||
mlt_locale_t | locale, | ||
int | position, | ||
int | length, | ||
mlt_keyframe_type | keyframe_type | ||
) |
Set a property animation keyframe to a color.
self | a property |
value | a color |
fps | the frame rate, which may be needed for converting a time string to frame units |
locale | the locale, which may be needed for converting a string to a real number |
position | the frame number |
length | the maximum number of frames when interpreting negative keyframe times, <=0 if you don't care or need that |
keyframe_type | the interpolation method for this keyframe |
int mlt_property_anim_set_double | ( | mlt_property | self, |
double | value, | ||
double | fps, | ||
mlt_locale_t | locale, | ||
int | position, | ||
int | length, | ||
mlt_keyframe_type | keyframe_type | ||
) |
Set a property animation keyframe to a real number.
self | a property |
value | a double precision floating point value |
fps | the frame rate, which may be needed for converting a time string to frame units |
locale | the locale, which may be needed for converting a string to a real number |
position | the frame number |
length | the maximum number of frames when interpreting negative keyframe times, <=0 if you don't care or need that |
keyframe_type | the interpolation method for this keyframe |
int mlt_property_anim_set_int | ( | mlt_property | self, |
int | value, | ||
double | fps, | ||
mlt_locale_t | locale, | ||
int | position, | ||
int | length, | ||
mlt_keyframe_type | keyframe_type | ||
) |
Set a property animation keyframe to an integer value.
self | a property |
value | an integer |
fps | the frame rate, which may be needed for converting a time string to frame units |
locale | the locale, which may be needed for converting a string to a real number |
position | the frame number |
length | the maximum number of frames when interpreting negative keyframe times, <=0 if you don't care or need that |
keyframe_type | the interpolation method for this keyframe |
int mlt_property_anim_set_rect | ( | mlt_property | self, |
mlt_rect | value, | ||
double | fps, | ||
mlt_locale_t | locale, | ||
int | position, | ||
int | length, | ||
mlt_keyframe_type | keyframe_type | ||
) |
Set a property animation keyframe to a rectangle.
self | a property |
value | a rectangle |
fps | the frame rate, which may be needed for converting a time string to frame units |
locale | the locale, which may be needed for converting a string to a real number |
position | the frame number |
length | the maximum number of frames when interpreting negative keyframe times, <=0 if you don't care or need that |
keyframe_type | the interpolation method for this keyframe |
int mlt_property_anim_set_string | ( | mlt_property | self, |
const char * | value, | ||
double | fps, | ||
mlt_locale_t | locale, | ||
int | position, | ||
int | length | ||
) |
Set a property animation keyframe to a string.
Strings only support discrete animation. Do not use this to set a property's animation string that contains a semicolon-delimited set of values; use mlt_property_set() for that.
self | a property |
value | a string |
fps | the frame rate, which may be needed for converting a time string to frame units |
locale | the locale, which may be needed for converting a string to a real number |
position | the frame number |
length | the maximum number of frames when interpreting negative keyframe times, <=0 if you don't care or need that |
|
private |
Convert a string to a floating point number.
If the string contains a colon it is interpreted as a time value. If it also contains a period or comma character, the string is parsed as a clock value: HH:MM:SS. Otherwise, the time value is parsed as a SMPTE timecode: HH:MM:SS:FF. If the numeric string ends with '' then the value is divided by 100 to convert it into a ratio.
self | a property |
fps | frames per second, used when converting from time value |
locale | the locale to use when converting from time clock value |
|
private |
Convert a string to an integer.
The string must begin with '0x' to be interpreted as hexadecimal. Otherwise, it is interpreted as base 10.
If the string begins with '#' it is interpreted as a hexadecimal color value in the form RRGGBB or AARRGGBB. Color values that begin with '0x' are always in the form RRGGBBAA where the alpha components are not optional. Applications and services should expect the binary color value in bytes to be in the following order: RGBA. This means they will have to cast the int to an unsigned int. This is especially important when they need to shift right to obtain RGB without alpha in order to make it do a logical instead of arithmetic shift.
If the string contains a colon it is interpreted as a time value. If it also contains a period or comma character, the string is parsed as a clock value: HH:MM:SS. Otherwise, the time value is parsed as a SMPTE timecode: HH:MM:SS:FF.
self | a property |
fps | frames per second, used when converting from time value |
locale | the locale to use when converting from time clock value |
|
inlineprivate |
Convert a string to a 64-bit integer.
If the string begins with '0x' it is interpreted as a hexadecimal value.
value | a string |
void mlt_property_clear | ( | mlt_property | self | ) |
Clear (0/null) a property.
Frees up any associated resources in the process.
self | a property |
void mlt_property_close | ( | mlt_property | self | ) |
Destroy a property and free all related resources.
self | a property |
mlt_animation mlt_property_get_animation | ( | mlt_property | self | ) |
Get an object's animation object.
You might need to call another mlt_property_anim_ function to actually construct the animation, as this is a simple accessor function.
self | a property |
mlt_color mlt_property_get_color | ( | mlt_property | self, |
double | fps, | ||
mlt_locale_t | locale | ||
) |
Get the property as a color.
self | a property |
fps | frames per second, used when converting from time value |
locale | the locale to use for when converting from a string |
void * mlt_property_get_data | ( | mlt_property | self, |
int * | length | ||
) |
Get the binary data from a property.
This only works if you previously put binary data into the property. This does not return a copy of the data; it returns a pointer to it. If you supplied a destructor function when setting the binary data, the destructor is used when the Property is closed to free the memory. Therefore, only free the returned pointer if you did not supply a destructor function.
self | a property | |
[out] | length | the size of the binary object in bytes (optional) |
double mlt_property_get_double | ( | mlt_property | self, |
double | fps, | ||
mlt_locale_t | locale | ||
) |
Get the property as a floating point.
self | a property |
fps | frames per second, used when converting from time value |
locale | the locale to use for this conversion |
int mlt_property_get_int | ( | mlt_property | self, |
double | fps, | ||
mlt_locale_t | locale | ||
) |
Get the property as an integer.
self | a property |
fps | frames per second, used when converting from time value |
locale | the locale to use when converting from time clock value |
int64_t mlt_property_get_int64 | ( | mlt_property | self | ) |
Get the property as a signed integer.
self | a property |
mlt_position mlt_property_get_position | ( | mlt_property | self, |
double | fps, | ||
mlt_locale_t | locale | ||
) |
Get the property as a position.
A position is an offset time in terms of frame units.
self | a property |
fps | frames per second, used when converting from time value |
locale | the locale to use when converting from time clock value |
mlt_properties mlt_property_get_properties | ( | mlt_property | self | ) |
Get a nested properties object.
self | a property |
mlt_rect mlt_property_get_rect | ( | mlt_property | self, |
mlt_locale_t | locale | ||
) |
Get the property as a rectangle.
You can use any non-numeric character(s) as a field delimiter. If the number has a '' immediately following it, the number is divided by 100 to convert it into a real number.
self | a property |
locale | the locale to use for when converting from a string |
char * mlt_property_get_string | ( | mlt_property | self | ) |
Get the property as a string.
The caller is not responsible for deallocating the returned string! The string is deallocated when the Property is closed. This tries its hardest to convert the property to string including using a serialization function for binary data, if supplied.
self | a property |
char * mlt_property_get_string_l | ( | mlt_property | self, |
mlt_locale_t | locale | ||
) |
Get the property as a string (with locale).
The caller is not responsible for deallocating the returned string! The string is deallocated when the Property is closed. This tries its hardest to convert the property to string including using a serialization function for binary data, if supplied.
self | a property |
locale | the locale to use for this conversion |
char * mlt_property_get_string_l_tf | ( | mlt_property | self, |
mlt_locale_t | locale, | ||
mlt_time_format | time_format | ||
) |
Get the property as a string (with locale and time format).
The caller is not responsible for deallocating the returned string! The string is deallocated when the Property is closed. This tries its hardest to convert the property to string including using a serialization function for binary data, if supplied.
self | a property |
locale | the locale to use for this conversion |
time_format | the time format to use for animation |
char * mlt_property_get_string_tf | ( | mlt_property | self, |
mlt_time_format | time_format | ||
) |
Get the property as a string (with time format).
The caller is not responsible for deallocating the returned string! The string is deallocated when the Property is closed. This tries its hardest to convert the property to string including using a serialization function for binary data, if supplied.
self | a property |
time_format | the time format to use for animation |
char * mlt_property_get_time | ( | mlt_property | self, |
mlt_time_format | format, | ||
double | fps, | ||
mlt_locale_t | locale | ||
) |
Get the property as a time string.
The time value can be either a SMPTE timecode or SMIL clock value. The caller is not responsible for deallocating the returned string! The string is deallocated when the property is closed.
self | a property |
format | the time format that you want |
fps | frames per second |
locale | the locale to use for this conversion |
mlt_property mlt_property_init | ( | ) |
Construct a property and initialize it.
int mlt_property_interpolate | ( | mlt_property | self, |
mlt_property | p[], | ||
double | progress, | ||
double | fps, | ||
mlt_locale_t | locale, | ||
mlt_keyframe_type | interp | ||
) |
Interpolate a new property value given a set of other properties.
self | the property onto which to set the computed value |
p | an array of at least 1 value in p[1] if interp is discrete, 2 values in p[1] and p[2] if interp is linear, or 4 values in p[0] - p[3] if interp is smooth |
progress | a ratio in the range [0, 1] to indicate how far between p[1] and p[2] |
fps | the frame rate, which may be needed for converting a time string to frame units |
locale | the locale, which may be needed for converting a string to a real number |
interp | the interpolation method to use |
int mlt_property_is_anim | ( | mlt_property | self | ) |
Check if a property is animated.
This is not a thread-safe function because it is used internally by mlt_property_s under a lock. However, external callers should protect it.
self | a property |
int mlt_property_is_clear | ( | mlt_property | self | ) |
Check if a property is cleared.
self | a property |
int mlt_property_is_color | ( | mlt_property | self | ) |
Check if a property is a color.
self | a property |
int mlt_property_is_numeric | ( | mlt_property | self, |
mlt_locale_t | locale | ||
) |
Determine if the property holds a numeric or numeric string value.
self | a property |
locale | the locale to use for string evaluation |
int mlt_property_is_rect | ( | mlt_property | self | ) |
Check if a property is a rect.
self | a property |
void mlt_property_pass | ( | mlt_property | self, |
mlt_property | that | ||
) |
Copy a property.
A Property holding binary data only copies the data if a serialiser function was supplied when you set the Property.
self | a property |
that | another property |
int mlt_property_set_color | ( | mlt_property | self, |
mlt_color | value | ||
) |
Set the property to a color value.
self | a property |
value | an integer |
int mlt_property_set_data | ( | mlt_property | self, |
void * | value, | ||
int | length, | ||
mlt_destructor | destructor, | ||
mlt_serialiser | serialiser | ||
) |
Set a property to an opaque binary value.
This does not make a copy of the data. You can use a Properties object with its reference tracking and the destructor function to control the lifetime of the data. Otherwise, pass NULL for the destructor function and control the lifetime yourself.
self | a property |
value | an opaque pointer |
length | the number of bytes pointed to by value (optional) |
destructor | a function to use to destroy this binary data (optional, assuming you manage the resource) |
serialiser | a function to use to convert this binary data to a string (optional) |
int mlt_property_set_double | ( | mlt_property | self, |
double | value | ||
) |
Set the property to a floating point value.
self | a property |
value | a double precision floating point value |
int mlt_property_set_int | ( | mlt_property | self, |
int | value | ||
) |
Set the property to an integer value.
self | a property |
value | an integer |
int mlt_property_set_int64 | ( | mlt_property | self, |
int64_t | value | ||
) |
Set the property to a 64-bit integer value.
self | a property |
value | a 64-bit integer |
int mlt_property_set_position | ( | mlt_property | self, |
mlt_position | value | ||
) |
Set the property to a position value.
Position is a relative time value in frame units.
self | a property |
value | a position value |
int mlt_property_set_properties | ( | mlt_property | self, |
mlt_properties | properties | ||
) |
Set a nested properties object.
self | a property |
properties | the properties list to nest into self with name |
int mlt_property_set_rect | ( | mlt_property | self, |
mlt_rect | value | ||
) |
int mlt_property_set_string | ( | mlt_property | self, |
const char * | value | ||
) |
Set the property to a string value.
This makes a copy of the string you supply so you do not need to track a new reference to it.
self | a property |
value | the string to copy to the property |
|
private |
Create a new animation or refresh an existing one.
self | a property |
fps | the frame rate, which may be needed for converting a time string to frame units |
locale | the locale, which may be needed for converting a string to a real number |
length | the maximum number of frames when interpreting negative keyframe times, <=0 if you don't care or need that |
|
private |
Convert a rectangle value into a string.
The canonical form of a mlt_rect is a space delimited "x y w h o" even though many kinds of field delimiters may be used to convert a string to a rectangle.
rect | the rectangle to convert |
length | not used |
|
private |
Convert frame count to a SMIL clock value string.
frames | a frame count | |
fps | frames per second | |
[out] | s | the string to write into - must have enough space to hold largest time string |
|
private |
Parse a SMIL clock value.
self | a property |
s | the string to parse |
fps | frames per second |
locale | the locale to use for parsing a real number value |
|
private |
Parse a SMPTE timecode string.
self | a property |
s | the string to parse |
fps | frames per second |
|
private |
Convert frame count to a SMPTE timecode string.
frames | a frame count | |
fps | frames per second | |
[out] | s | the string to write into - must have enough space to hold largest time string |
mlt_animation mlt_property_s::animation |
void* mlt_property_s::data |
Generic type handling.
mlt_destructor mlt_property_s::destructor |
int mlt_property_s::length |
pthread_mutex_t mlt_property_s::mutex |
double mlt_property_s::prop_double |
int mlt_property_s::prop_int |
Atomic type handling.
int64_t mlt_property_s::prop_int64 |
mlt_position mlt_property_s::prop_position |
char* mlt_property_s::prop_string |
String handling.
mlt_properties mlt_property_s::properties |
mlt_serialiser mlt_property_s::serialiser |
mlt_property_type mlt_property_s::types |
Stores a bit pattern of types available for this property.