|
mlt 0.7.6
|
Property class. More...
Public Member Functions | |
| void | mlt_property_close (mlt_property self) |
| Destroy a property and free all related resources. | |
| void * | mlt_property_get_data (mlt_property self, int *length) |
| Get the binary data from a property. | |
| double | mlt_property_get_double (mlt_property self) |
| Get the property as a floating point. | |
| double | mlt_property_get_double_l (mlt_property self, locale_t locale) |
| Get the property (with locale) as a floating point. | |
| int | mlt_property_get_int (mlt_property self) |
| Get the property as an integer. | |
| int64_t | mlt_property_get_int64 (mlt_property self) |
| Get the property as a signed integer. | |
| mlt_position | mlt_property_get_position (mlt_property self) |
| Get the property as a position. | |
| char * | mlt_property_get_string (mlt_property self) |
| Get the property as a string. | |
| char * | mlt_property_get_string_l (mlt_property self, locale_t locale) |
| Get the property as a string (with locale). | |
| mlt_property | mlt_property_init () |
| Construct a property and initialize it. | |
| void | mlt_property_pass (mlt_property self, mlt_property that) |
| Copy a property. | |
| 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. | |
| int | mlt_property_set_double (mlt_property self, double value) |
| Set the property to a floating point value. | |
| int | mlt_property_set_int (mlt_property self, int value) |
| Set the property to an integer value. | |
| int | mlt_property_set_int64 (mlt_property self, int64_t value) |
| Set the property to a 64-bit integer value. | |
| int | mlt_property_set_position (mlt_property self, mlt_position value) |
| Set the property to a position value. | |
| int | mlt_property_set_string (mlt_property self, const char *value) |
| Set the property to a string value. | |
Data Fields | |
| void * | data |
| Generic type handling. | |
| mlt_destructor | destructor |
| int | length |
| pthread_mutex_t | mutex |
| double | prop_double |
| int | prop_int |
| Atomic type handling. | |
| int64_t | prop_int64 |
| mlt_position | prop_position |
| char * | prop_string |
| String handling. | |
| mlt_serialiser | serialiser |
| mlt_property_type | types |
| Stores a bit pattern of types available for this property. | |
Private Member Functions | |
| static int | mlt_property_atoi (const char *value) |
| Convert a base 10 or base 16 string to an integer. | |
| static int64_t | mlt_property_atoll (const char *value) |
| Convert a string to a 64-bit integer. | |
| static void | mlt_property_clear (mlt_property self) |
| Clear (0/null) a property. | |
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.
| static int mlt_property_atoi | ( | const char * | value | ) | [inline, private] |
Convert a base 10 or base 16 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.
| value | a string to convert |
| static int64_t mlt_property_atoll | ( | const char * | value | ) | [inline, private] |
Convert a string to a 64-bit integer.
If the string begins with '0x' it is interpreted as a hexadecimal value.
| value | a string |
| static void mlt_property_clear | ( | mlt_property | self | ) | [inline, private] |
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 |
| 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 | ) |
Get the property as a floating point.
| self | a property |
| double mlt_property_get_double_l | ( | mlt_property | self, |
| locale_t | locale | ||
| ) |
Get the property (with locale) as a floating point.
| self | a property |
| locale | the locale to use for this conversion |
| int mlt_property_get_int | ( | mlt_property | self | ) |
Get the property as an integer.
| self | a property |
| 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 | ) |
Get the property as a position.
A position is an offset time in terms of frame units.
| self | a property |
| 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, |
| 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 |
| mlt_property mlt_property_init | ( | ) |
Construct a property and initialize it.
| 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_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_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 |
| void* mlt_property_s::data |
Generic type handling.
| pthread_mutex_t mlt_property_s::mutex |
| double mlt_property_s::prop_double |
Atomic type handling.
| int64_t mlt_property_s::prop_int64 |
String handling.
Stores a bit pattern of types available for this property.
1.7.3