MLT  7.22.0
Public Member Functions | Data Fields | Private Member Functions
mlt_transition_s Struct Reference

Transition abstract service class. More...

#include <mlt_transition.h>

Inheritance diagram for mlt_transition_s:
mlt_service_s mlt_properties_s

Public Member Functions

void mlt_transition_close (mlt_transition self)
 Close and destroy the transition. More...
 
int mlt_transition_connect (mlt_transition self, mlt_service producer, int a_track, int b_track)
 Connect a transition with a producer's a and b tracks. More...
 
int mlt_transition_get_a_track (mlt_transition self)
 Get the index of the a track. More...
 
int mlt_transition_get_b_track (mlt_transition self)
 Get the index of the b track. More...
 
mlt_position mlt_transition_get_in (mlt_transition self)
 Get the in point. More...
 
mlt_position mlt_transition_get_length (mlt_transition self)
 Get the duration. More...
 
mlt_position mlt_transition_get_out (mlt_transition self)
 Get the out point. More...
 
mlt_position mlt_transition_get_position (mlt_transition self, mlt_frame frame)
 Get the position within the transition. More...
 
double mlt_transition_get_progress (mlt_transition self, mlt_frame frame)
 Get the percent complete. More...
 
double mlt_transition_get_progress_delta (mlt_transition self, mlt_frame frame)
 Get the second field incremental progress. More...
 
int mlt_transition_init (mlt_transition self, void *child)
 Initialize a new transition. More...
 
mlt_transition mlt_transition_new ()
 Create and initialize a new transition. More...
 
mlt_frame mlt_transition_process (mlt_transition self, mlt_frame a_frame, mlt_frame b_frame)
 Process the frame. More...
 
mlt_properties mlt_transition_properties (mlt_transition self)
 Get the properties interface. More...
 
mlt_service mlt_transition_service (mlt_transition self)
 Get the service class interface. More...
 
void mlt_transition_set_in_and_out (mlt_transition self, mlt_position in, mlt_position out)
 Set the starting and ending time for when the transition is active. More...
 
void mlt_transition_set_tracks (mlt_transition self, int a_track, int b_track)
 Change the track indices of a transition. More...
 
- Public Member Functions inherited from mlt_service_s
void mlt_service_apply_filters (mlt_service self, mlt_frame frame, int index)
 Recursively apply attached filters. More...
 
int mlt_service_attach (mlt_service self, mlt_filter filter)
 Attach a filter. More...
 
mlt_cache_item mlt_service_cache_get (mlt_service self, const char *name)
 Get an object from a service's cache. More...
 
int mlt_service_cache_get_size (mlt_service self, const char *name)
 Get the current maximum size of the named cache. More...
 
void mlt_service_cache_put (mlt_service self, const char *name, void *data, int size, mlt_destructor destructor)
 Put an object into a service's cache. More...
 
void mlt_service_cache_set_size (mlt_service self, const char *name, int size)
 Set the number of items to cache for the named cache. More...
 
void mlt_service_close (mlt_service self)
 Destroy a service. More...
 
int mlt_service_connect_producer (mlt_service self, mlt_service producer, int index)
 Connect a producer to the service. More...
 
mlt_service mlt_service_consumer (mlt_service self)
 Obtain the consumer a service is connected to. More...
 
int mlt_service_detach (mlt_service self, mlt_filter filter)
 Detach a filter. More...
 
int mlt_service_disconnect_all_producers (mlt_service self)
 Remove the all the attached producers. More...
 
int mlt_service_disconnect_producer (mlt_service self, int index)
 Remove the N-th producer. More...
 
mlt_filter mlt_service_filter (mlt_service self, int index)
 Retrieve an attached filter. More...
 
int mlt_service_filter_count (mlt_service self)
 Get the number of filters attached. More...
 
int mlt_service_get_frame (mlt_service self, mlt_frame_ptr frame, int index)
 Obtain a frame. More...
 
mlt_service mlt_service_get_producer (mlt_service self)
 Get the first connected producer. More...
 
mlt_service_type mlt_service_identify (mlt_service self)
 Identify the subclass of the service. More...
 
int mlt_service_init (mlt_service self, void *child)
 Initialize a service. More...
 
int mlt_service_insert_producer (mlt_service self, mlt_service producer, int index)
 Insert a producer connected to the service. More...
 
void mlt_service_lock (mlt_service self)
 Acquire a mutual exclusion lock on this service. More...
 
int mlt_service_move_filter (mlt_service self, int from, int to)
 Reorder the attached filters. More...
 
mlt_service mlt_service_producer (mlt_service self)
 Obtain the producer a service is connected to. More...
 
mlt_profile mlt_service_profile (mlt_service self)
 Retrieve the profile. More...
 
mlt_properties mlt_service_properties (mlt_service self)
 Return the properties object. More...
 
void mlt_service_set_profile (mlt_service self, mlt_profile profile)
 Set the profile for a service. More...
 
void mlt_service_unlock (mlt_service self)
 Release a mutual exclusion lock on this service. More...
 
- Public Member Functions inherited from mlt_properties_s
char * mlt_properties_anim_get (mlt_properties self, const char *name, int position, int length)
 Get a string value by name at a frame position. More...
 
mlt_color mlt_properties_anim_get_color (mlt_properties self, const char *name, int position, int length)
 Get a color associated to the name at a frame position. More...
 
double mlt_properties_anim_get_double (mlt_properties self, const char *name, int position, int length)
 Get a real number associated to the name at a frame position. More...
 
int mlt_properties_anim_get_int (mlt_properties self, const char *name, int position, int length)
 Get an integer associated to the name at a frame position. More...
 
mlt_rect mlt_properties_anim_get_rect (mlt_properties self, const char *name, int position, int length)
 Get a rectangle associated to the name at a frame position. More...
 
int mlt_properties_anim_set (mlt_properties self, const char *name, const char *value, int position, int length)
 Set a property to a string at a frame position. More...
 
int mlt_properties_anim_set_color (mlt_properties self, const char *name, mlt_color value, int position, int length, mlt_keyframe_type keyframe_type)
 Set a property to an integer value by color at a frame position. More...
 
int mlt_properties_anim_set_double (mlt_properties self, const char *name, double value, int position, int length, mlt_keyframe_type keyframe_type)
 Set a property to a real number at a frame position. More...
 
int mlt_properties_anim_set_int (mlt_properties self, const char *name, int value, int position, int length, mlt_keyframe_type keyframe_type)
 Set a property to an integer value at a frame position. More...
 
int mlt_properties_anim_set_rect (mlt_properties self, const char *name, mlt_rect value, int position, int length, mlt_keyframe_type keyframe_type)
 Set a property to a rectangle value at a frame position. More...
 
void mlt_properties_clear (mlt_properties self, const char *name)
 Remove the value for a property. More...
 
void mlt_properties_close (mlt_properties self)
 Close a properties object. More...
 
int mlt_properties_copy (mlt_properties self, mlt_properties that, const char *prefix)
 Copy all serializable properties that match a prefix to another properties object. More...
 
int mlt_properties_count (mlt_properties self)
 Return the number of items in the list. More...
 
void mlt_properties_debug (mlt_properties self, const char *title, FILE *output)
 Output the properties to a file handle. More...
 
int mlt_properties_dec_ref (mlt_properties self)
 Decrement the reference count. More...
 
int mlt_properties_dir_list (mlt_properties self, const char *dirname, const char *pattern, int sort)
 Get the contents of a directory. More...
 
void mlt_properties_dump (mlt_properties self, FILE *output)
 Dump the properties to a file handle. More...
 
int mlt_properties_exists (mlt_properties self, const char *name)
 Check if a property exists. More...
 
char * mlt_properties_frames_to_time (mlt_properties self, mlt_position frames, mlt_time_format format)
 Convert a frame count to a time string. More...
 
int mlt_properties_from_utf8 (mlt_properties properties, const char *name_from, const char *name_to)
 Convert UTF-8 property to the locale-defined encoding. More...
 
char * mlt_properties_get (mlt_properties self, const char *name)
 Get a string value by name. More...
 
mlt_animation mlt_properties_get_animation (mlt_properties self, const char *name)
 Get the animation associated to the name. More...
 
mlt_color mlt_properties_get_color (mlt_properties self, const char *name)
 Convert a numeric property to a tuple of color components. More...
 
void * mlt_properties_get_data (mlt_properties self, const char *name, int *length)
 Get a binary data value associated to the name. More...
 
void * mlt_properties_get_data_at (mlt_properties self, int index, int *size)
 Get a data value by index. More...
 
double mlt_properties_get_double (mlt_properties self, const char *name)
 Get a floating point value associated to the name. More...
 
int mlt_properties_get_int (mlt_properties self, const char *name)
 Get an integer associated to the name. More...
 
int64_t mlt_properties_get_int64 (mlt_properties self, const char *name)
 Get a 64-bit integer associated to the name. More...
 
const char * mlt_properties_get_lcnumeric (mlt_properties self)
 Get the numeric locale for this properties object. More...
 
char * mlt_properties_get_name (mlt_properties self, int index)
 Get a property name by index. More...
 
mlt_position mlt_properties_get_position (mlt_properties self, const char *name)
 Get a position value associated to the name. More...
 
mlt_properties mlt_properties_get_properties (mlt_properties self, const char *name)
 Get a nested properties object by name. More...
 
mlt_properties mlt_properties_get_properties_at (mlt_properties self, int index)
 Get a nested properties object by index. More...
 
mlt_rect mlt_properties_get_rect (mlt_properties self, const char *name)
 Get a rectangle associated to the name. More...
 
char * mlt_properties_get_time (mlt_properties self, const char *name, mlt_time_format format)
 Get a time string associated to the name. More...
 
char * mlt_properties_get_value (mlt_properties self, int index)
 Get a property's string value by index. More...
 
char * mlt_properties_get_value_tf (mlt_properties self, int index, mlt_time_format time_format)
 Get a property's string value by index (with time format). More...
 
int mlt_properties_inc_ref (mlt_properties self)
 Increment the reference count. More...
 
int mlt_properties_inherit (mlt_properties self, mlt_properties that)
 Copy all serializable properties to another properties list. More...
 
int mlt_properties_init (mlt_properties self, void *child)
 Initialize a properties object that was already allocated. More...
 
int mlt_properties_is_anim (mlt_properties self, const char *name)
 Check if a property is animated. More...
 
int mlt_properties_is_sequence (mlt_properties properties)
 Determine if the properties list is really just a sequence or ordered list. More...
 
mlt_properties mlt_properties_load (const char *filename)
 Create a properties object by reading a .properties text file. More...
 
void mlt_properties_lock (mlt_properties self)
 Protect a properties list against concurrent access. More...
 
void mlt_properties_mirror (mlt_properties self, mlt_properties that)
 Set a properties list to be a mirror copy of another. More...
 
mlt_properties mlt_properties_new ()
 Create a properties object. More...
 
int mlt_properties_parse (mlt_properties self, const char *namevalue)
 Set a value by parsing a name=value string. More...
 
mlt_properties mlt_properties_parse_yaml (const char *filename)
 Parse a YAML Tiny file by name. More...
 
int mlt_properties_pass (mlt_properties self, mlt_properties that, const char *prefix)
 Pass all serializable properties that match a prefix to another properties object. More...
 
int mlt_properties_pass_list (mlt_properties self, mlt_properties that, const char *list)
 Copy all properties specified in a comma-separated list to another properties list. More...
 
void mlt_properties_pass_property (mlt_properties self, mlt_properties that, const char *name)
 Copy a property to another properties list. More...
 
int mlt_properties_preset (mlt_properties self, const char *name)
 Set properties from a preset. More...
 
int mlt_properties_ref_count (mlt_properties self)
 Get the reference count. More...
 
int mlt_properties_rename (mlt_properties self, const char *source, const char *dest)
 Rename a property. More...
 
int mlt_properties_save (mlt_properties self, const char *filename)
 Save the properties to a file by name. More...
 
char * mlt_properties_serialise_yaml (mlt_properties self)
 Serialize a properties list as a string of YAML Tiny. More...
 
int mlt_properties_set (mlt_properties self, const char *name, const char *value)
 Set a property to a string. More...
 
int mlt_properties_set_color (mlt_properties self, const char *name, mlt_color color)
 Set a property to an integer value by color. More...
 
int mlt_properties_set_data (mlt_properties self, const char *name, void *value, int length, mlt_destructor destroy, mlt_serialiser serialise)
 Store binary data as a property. More...
 
int mlt_properties_set_double (mlt_properties self, const char *name, double value)
 Set a property to a floating point value. More...
 
int mlt_properties_set_int (mlt_properties self, const char *name, int value)
 Set a property to an integer value. More...
 
int mlt_properties_set_int64 (mlt_properties self, const char *name, int64_t value)
 Set a property to a 64-bit integer value. More...
 
int mlt_properties_set_lcnumeric (mlt_properties self, const char *locale)
 Set the numeric locale used for string/double conversions. More...
 
int mlt_properties_set_or_default (mlt_properties self, const char *name, const char *value, const char *def)
 Set or default a property to a string. More...
 
int mlt_properties_set_position (mlt_properties self, const char *name, mlt_position value)
 Set a property to a position value. More...
 
int mlt_properties_set_properties (mlt_properties self, const char *name, mlt_properties properties)
 Set a property to a nested properties object. More...
 
int mlt_properties_set_rect (mlt_properties self, const char *name, mlt_rect value)
 Set a property to a rectangle value. More...
 
int mlt_properties_set_string (mlt_properties self, const char *name, const char *value)
 Set a property to a string. More...
 
mlt_position mlt_properties_time_to_frames (mlt_properties self, const char *time)
 Convert a time string to a frame count. More...
 
void mlt_properties_unlock (mlt_properties self)
 End protecting a properties list against concurrent access. More...
 

Data Fields

void * child
 Protected. More...
 
void(* close )(mlt_transition)
 public virtual More...
 
mlt_frameframes
 Private. More...
 
int held
 
pthread_mutex_t mutex
 
struct mlt_service_s parent
 We're implementing service here. More...
 
mlt_frame(* process )(mlt_transition, mlt_frame, mlt_frame)
 protected transition method More...
 
mlt_service producer
 track and in/out points More...
 
- Data Fields inherited from mlt_service_s
mlt_destructor close
 the destructor virtual function More...
 
void * close_object
 the object supplied to the close virtual function More...
 
int(* get_frame )(mlt_service self, mlt_frame_ptr frame, int index)
 Get a frame of data (virtual function). More...
 
- Data Fields inherited from mlt_properties_s
mlt_destructor close
 the destructor virtual function More...
 
void * close_object
 the object supplied to the close virtual function More...
 

Private Member Functions

static int transition_get_frame (mlt_service service, mlt_frame_ptr frame, int index)
 Get a frame from a transition. More...
 

Detailed Description

Transition abstract service class.

A transition may modify the output of a producer based on the output of a second producer.

Property:

a_track the track index (0-based) of a multitrack of the first producer

b_track the track index (0-based) of a multitrack of the second producer

accepts_blanks a flag to indicate if the transition should accept blank frames

always_active a flag to indicate that the in and out points do not apply

_transition_type 1 for video, 2 for audio, 3 for both audio and video

disable Set this to disable the transition while keeping it in the object model.

Member Function Documentation

◆ mlt_transition_close()

void mlt_transition_close ( mlt_transition  self)

Close and destroy the transition.

Parameters
selfa transition

◆ mlt_transition_connect()

int mlt_transition_connect ( mlt_transition  self,
mlt_service  producer,
int  a_track,
int  b_track 
)

Connect a transition with a producer's a and b tracks.

Parameters
selfa transition
producera producer
a_trackthe track index of the first input
b_trackthe track index of the second index
Returns
true on error

◆ mlt_transition_get_a_track()

int mlt_transition_get_a_track ( mlt_transition  self)

Get the index of the a track.

Parameters
selfa transition
Returns
the 0-based index of the track of the first producer

◆ mlt_transition_get_b_track()

int mlt_transition_get_b_track ( mlt_transition  self)

Get the index of the b track.

Parameters
selfa transition
Returns
the 0-based index of the track of the second producer

◆ mlt_transition_get_in()

mlt_position mlt_transition_get_in ( mlt_transition  self)

Get the in point.

Parameters
selfa transition
Returns
the starting time

◆ mlt_transition_get_length()

mlt_position mlt_transition_get_length ( mlt_transition  self)

Get the duration.

Parameters
selfa transition
Returns
the duration or zero if unlimited

◆ mlt_transition_get_out()

mlt_position mlt_transition_get_out ( mlt_transition  self)

Get the out point.

Parameters
selfa transition
Returns
the ending time

◆ mlt_transition_get_position()

mlt_position mlt_transition_get_position ( mlt_transition  self,
mlt_frame  frame 
)

Get the position within the transition.

The position is relative to the in point.

Parameters
selfa transition
framea frame
Returns
the position

◆ mlt_transition_get_progress()

double mlt_transition_get_progress ( mlt_transition  self,
mlt_frame  frame 
)

Get the percent complete.

Parameters
selfa transition
framea frame
Returns
the progress in the range 0.0 to 1.0

◆ mlt_transition_get_progress_delta()

double mlt_transition_get_progress_delta ( mlt_transition  self,
mlt_frame  frame 
)

Get the second field incremental progress.

Parameters
selfa transition
framea frame
Returns
the progress increment in the range 0.0 to 1.0

◆ mlt_transition_init()

int mlt_transition_init ( mlt_transition  self,
void *  child 
)

Initialize a new transition.

Parameters
selfa transition
childthe object of a subclass
Returns
true on error

◆ mlt_transition_new()

mlt_transition mlt_transition_new ( )

Create and initialize a new transition.

Returns
a new transition

◆ mlt_transition_process()

mlt_frame mlt_transition_process ( mlt_transition  self,
mlt_frame  a_frame,
mlt_frame  b_frame 
)

Process the frame.

If we have no process method (unlikely), we simply return the a_frame unmolested.

Parameters
selfa transition
a_framea frame from the first producer
b_framea frame from the second producer
Returns
a frame

◆ mlt_transition_properties()

mlt_properties mlt_transition_properties ( mlt_transition  self)

Get the properties interface.

Parameters
selfa transition
Returns
the transition's properties
See also
MLT_TRANSITION_PROPERTIES

◆ mlt_transition_service()

mlt_service mlt_transition_service ( mlt_transition  self)

Get the service class interface.

Parameters
selfa transition
Returns
the service class
See also
MLT_TRANSITION_SERVICE

◆ mlt_transition_set_in_and_out()

void mlt_transition_set_in_and_out ( mlt_transition  self,
mlt_position  in,
mlt_position  out 
)

Set the starting and ending time for when the transition is active.

Parameters
selfa transition
inthe starting time
outthe ending time

◆ mlt_transition_set_tracks()

void mlt_transition_set_tracks ( mlt_transition  self,
int  a_track,
int  b_track 
)

Change the track indices of a transition.

Parameters
a_trackthe track index of the first input
b_trackthe track index of the second index

◆ transition_get_frame()

static int transition_get_frame ( mlt_service  service,
mlt_frame_ptr  frame,
int  index 
)
private

Get a frame from a transition.

The logic is complex here. A transition is typically applied to frames on the a and b tracks specified in the connect method above and only if both contain valid info for the transition type (this is either audio or image).

However, the fixed a_track may not always contain data of the correct type, eg:

    +---------+                               +-------+
    |c1       |                               |c5     | <-- A(0,1) <-- B(0,2) <-- get frame
    +---------+                     +---------+-+-----+        |          |
                                    |c4         |       <------+          |
             +----------+-----------+-+---------+                         |
             |c2        |c3           |                 <-----------------+
             +----------+-------------+

During the overlap of c1 and c2, there is nothing for the A transition to do, so this results in a no operation, but B is triggered. During the overlap of c2 and c3, again, the A transition is inactive and because the B transition is pointing at track 0, it too would be inactive. This isn't an ideal situation - it's better if the B transition simply treats the frames from c3 as though they're the a track.

For this to work, we cache all frames coming from all tracks between the a and b tracks. Before we process, we determine that the b frame contains something of the right type and then we determine which frame to use as the a frame (selecting a matching frame from a_track to b_track - 1). If both frames contain data of the correct type, we process the transition.

This method is invoked for each track and we return the cached frames as needed. We clear the cache only when the requested frame is flagged as a 'last_track' frame.

Parameters
servicea service
[out]framea frame by reference
index0-based track index
Returns
true on error

Field Documentation

◆ child

void* mlt_transition_s::child

Protected.

◆ close

void(* mlt_transition_s::close) (mlt_transition)

public virtual

◆ frames

mlt_frame* mlt_transition_s::frames

Private.

◆ held

int mlt_transition_s::held

◆ mutex

pthread_mutex_t mlt_transition_s::mutex

◆ parent

struct mlt_service_s mlt_transition_s::parent

We're implementing service here.

◆ process

mlt_frame(* mlt_transition_s::process) (mlt_transition, mlt_frame, mlt_frame)

protected transition method

◆ producer

mlt_service mlt_transition_s::producer

track and in/out points


The documentation for this struct was generated from the following files: