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

mlt_multitrack_s Struct Reference

Multitrack class. More...

#include <mlt_multitrack.h>

Inheritance diagram for mlt_multitrack_s:
mlt_producer_s mlt_service_s mlt_properties_s

Public Member Functions

mlt_position mlt_multitrack_clip (mlt_multitrack self, mlt_whence whence, int index)
 Determine the clip point.
void mlt_multitrack_close (mlt_multitrack self)
 Close this instance and free its resources.
int mlt_multitrack_connect (mlt_multitrack self, mlt_producer producer, int track)
 Connect a producer to a given track.
int mlt_multitrack_count (mlt_multitrack self)
 Get the number of tracks.
mlt_multitrack mlt_multitrack_init ()
 Construct and initialize a new multitrack.
mlt_producer mlt_multitrack_producer (mlt_multitrack self)
 Get the producer associated to this multitrack.
mlt_properties mlt_multitrack_properties (mlt_multitrack self)
 Get the properties associated this multitrack.
void mlt_multitrack_refresh (mlt_multitrack self)
 Initialize position related information.
mlt_service mlt_multitrack_service (mlt_multitrack self)
 Get the service associated this multitrack.
mlt_producer mlt_multitrack_track (mlt_multitrack self, int track)
 Get an individual track as a producer.

Data Fields

int count
mlt_tracklist
struct mlt_producer_s parent
 We're extending producer here.
int size

Private Member Functions

static int add_unique (mlt_position *array, int size, mlt_position position)
 Add a position to a set.
static void mlt_multitrack_listener (mlt_producer producer, mlt_multitrack self)
 Listener for producers on the playlist.
static int position_compare (const void *p1, const void *p2)
 Position comparison function for sorting.
static int producer_get_frame (mlt_producer parent, mlt_frame_ptr frame, int index)
 Get frame method.

Detailed Description

Multitrack class.

A multitrack is a parallel container of producers that acts a single producer.

Property:
log_id not currently used, but sets it to "mulitrack"

Member Function Documentation

static int add_unique ( mlt_position array,
int  size,
mlt_position  position 
) [private]

Add a position to a set.

Parameters:
arrayan array of positions (the set)
sizethe current number of positions in the array (not the capacity of the array)
positionthe position to add
Returns:
the new size of the array
mlt_position mlt_multitrack_clip ( mlt_multitrack  self,
mlt_whence  whence,
int  index 
)

Determine the clip point.

 Special case here: a 'producer' has no concept of multiple clips - only the
 playlist and multitrack producers have clip functionality. Further to that a
 multitrack determines clip information from any connected tracks that happen
 to be playlists.
 Additionally, it must locate clips in the correct order, for example, consider
 the following track arrangement:
 playlist1 |0.0     |b0.0      |0.1          |0.1         |0.2           |
 playlist2 |b1.0  |1.0           |b1.1     |1.1             |
 Note - b clips represent blanks. They are also reported as clip positions.
 When extracting clip positions from these playlists, we should get a sequence of:
 0.0, 1.0, b0.0, 0.1, b1.1, 1.1, 0.1, 0.2, [out of playlist2], [out of playlist1]
 
Parameters:
selfa multitrack
whencefrom where to extract
indexthe 0-based index of which clip to extract
Returns:
the position of clip index relative to whence
void mlt_multitrack_close ( mlt_multitrack  self)

Close this instance and free its resources.

Parameters:
selfa multitrack
int mlt_multitrack_connect ( mlt_multitrack  self,
mlt_producer  producer,
int  track 
)

Connect a producer to a given track.

Note that any producer can be connected here, but see special case treatment of playlist in clip point determination below.

Parameters:
selfa multitrack
producerthe producer to connect to the multitrack producer
trackthe 0-based index of the track on which to connect the multitrack
Returns:
true on error
int mlt_multitrack_count ( mlt_multitrack  self)

Get the number of tracks.

Parameters:
selfa multitrack
Returns:
the number of tracks
mlt_multitrack mlt_multitrack_init ( )

Construct and initialize a new multitrack.

Sets the resource property to "<multitrack>".

Returns:
a new multitrack
static void mlt_multitrack_listener ( mlt_producer  producer,
mlt_multitrack  self 
) [private]

Listener for producers on the playlist.

Parameters:
producera producer
selfa multitrack
mlt_producer mlt_multitrack_producer ( mlt_multitrack  self)

Get the producer associated to this multitrack.

Parameters:
selfa multitrack
Returns:
the producer object
See also:
MLT_MULTITRACK_PRODUCER
mlt_properties mlt_multitrack_properties ( mlt_multitrack  self)

Get the properties associated this multitrack.

Parameters:
selfa multitrack
Returns:
the multitrack's property list
See also:
MLT_MULTITRACK_PROPERTIES
void mlt_multitrack_refresh ( mlt_multitrack  self)

Initialize position related information.

Parameters:
selfa multitrack
mlt_service mlt_multitrack_service ( mlt_multitrack  self)

Get the service associated this multitrack.

Parameters:
selfa multitrack
Returns:
the service object
See also:
MLT_MULTITRACK_SERVICE
mlt_producer mlt_multitrack_track ( mlt_multitrack  self,
int  track 
)

Get an individual track as a producer.

Parameters:
selfa multitrack
trackthe 0-based index of the producer to get
Returns:
the producer or NULL if not valid
static int position_compare ( const void *  p1,
const void *  p2 
) [private]

Position comparison function for sorting.

Parameters:
p1a position
p2another position
Returns:
<0 if p1 is less than p2, 0 if equal, >0 if greater
static int producer_get_frame ( mlt_producer  parent,
mlt_frame_ptr  frame,
int  track 
) [private]

Get frame method.

Get the next frame.

Get the current frame.

 Special case here: The multitrack must be used in a conjunction with a downstream
 tractor-type service, ie:
 Producer1 \
 Producer2 - multitrack - { filters/transitions } - tractor - consumer
 Producer3 /
 The get_frame of a tractor pulls frames from it's connected service on all tracks and
 will terminate as soon as it receives a test card with a last_track property. The
 important case here is that the mulitrack does not move to the next frame until all
 tracks have been pulled.
 Reasoning: In order to seek on a network such as above, the multitrack needs to ensure
 that all producers are positioned on the same frame. It uses the 'last track' logic
 to determine when to move to the next frame.
 Flaw: if a transition is configured to read from a b-track which happens to trigger
 the last frame logic (ie: it's configured incorrectly), then things are going to go
 out of sync.
 See playlist logic too.
 
Parameters:
parentthe producer interface to a mulitrack
[out]framea frame by reference
indexthe 0-based track index
Returns:
true if there was an error

The implementation of the get_frame virtual function.

Parameters:
producera producer
framea frame by reference
indexthe time at which to get the frame
Returns:
false
Parameters:
parentthe producer interface to the tractor
[out]framea frame by reference
trackthe 0-based track index
Returns:
true on error

Field Documentation

We're extending producer here.

Reimplemented from mlt_producer_s.


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