mlt 0.7.6
Public Member Functions | Data Fields | Private Member Functions

mlt_property_s Struct Reference

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.

Detailed Description

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.


Member Function Documentation

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.

Parameters:
valuea string to convert
Returns:
the resultant integer
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.

Parameters:
valuea string
Returns:
a 64-bit integer
static void mlt_property_clear ( mlt_property  self) [inline, private]

Clear (0/null) a property.

Frees up any associated resources in the process.

Parameters:
selfa property
void mlt_property_close ( mlt_property  self)

Destroy a property and free all related resources.

Parameters:
selfa 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.

Parameters:
selfa property
[out]lengththe size of the binary object in bytes (optional)
Returns:
an opaque data pointer or NULL if not available
double mlt_property_get_double ( mlt_property  self)

Get the property as a floating point.

Parameters:
selfa property
Returns:
a floating point value
double mlt_property_get_double_l ( mlt_property  self,
locale_t  locale 
)

Get the property (with locale) as a floating point.

Parameters:
selfa property
localethe locale to use for this conversion
Returns:
a floating point value
int mlt_property_get_int ( mlt_property  self)

Get the property as an integer.

Parameters:
selfa property
Returns:
an integer value
int64_t mlt_property_get_int64 ( mlt_property  self)

Get the property as a signed integer.

Parameters:
selfa property
Returns:
a 64-bit integer
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.

Parameters:
selfa property
Returns:
the position in frames
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.

Parameters:
selfa property
Returns:
a string representation of the property or NULL if failed
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.

Parameters:
selfa property
localethe locale to use for this conversion
Returns:
a string representation of the property or NULL if failed
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.

Author:
Zach <zachary.drew@gmail.com>
Parameters:
selfa property
thatanother 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.

Parameters:
selfa property
valuean opaque pointer
lengththe number of bytes pointed to by value (optional)
destructora function to use to destroy this binary data (optional, assuming you manage the resource)
serialisera function to use to convert this binary data to a string (optional)
Returns:
false
int mlt_property_set_double ( mlt_property  self,
double  value 
)

Set the property to a floating point value.

Parameters:
selfa property
valuea double precision floating point value
Returns:
false
int mlt_property_set_int ( mlt_property  self,
int  value 
)

Set the property to an integer value.

Parameters:
selfa property
valuean integer
Returns:
false
int mlt_property_set_int64 ( mlt_property  self,
int64_t  value 
)

Set the property to a 64-bit integer value.

Parameters:
selfa property
valuea 64-bit integer
Returns:
false
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.

Parameters:
selfa property
valuea position value
Returns:
false
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.

Parameters:
selfa property
valuethe string to copy to the property
Returns:
true if it failed

Field Documentation

Generic type handling.

pthread_mutex_t mlt_property_s::mutex

Atomic type handling.

String handling.

Stores a bit pattern of types available for this property.


The documentation for this struct was generated from the following file:
TWiki Appliance - Powered by TurnKey Linux