|
mlt 0.7.6
|
Multitrack class. More...
#include <mlt_multitrack.h>
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_track * | list |
| 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. | |
Multitrack class.
A multitrack is a parallel container of producers that acts a single producer.
| static int add_unique | ( | mlt_position * | array, |
| int | size, | ||
| mlt_position | position | ||
| ) | [private] |
Add a position to a set.
| array | an array of positions (the set) |
| size | the current number of positions in the array (not the capacity of the array) |
| position | the position to add |
| 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]
| self | a multitrack |
| whence | from where to extract |
| index | the 0-based index of which clip to extract |
index relative to whence | void mlt_multitrack_close | ( | mlt_multitrack | self | ) |
Close this instance and free its resources.
| self | a 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.
| self | a multitrack |
| producer | the producer to connect to the multitrack producer |
| track | the 0-based index of the track on which to connect the multitrack |
| int mlt_multitrack_count | ( | mlt_multitrack | self | ) |
Get the number of tracks.
| self | a multitrack |
| mlt_multitrack mlt_multitrack_init | ( | ) |
Construct and initialize a new multitrack.
Sets the resource property to "<multitrack>".
| static void mlt_multitrack_listener | ( | mlt_producer | producer, |
| mlt_multitrack | self | ||
| ) | [private] |
Listener for producers on the playlist.
| producer | a producer |
| self | a multitrack |
| mlt_producer mlt_multitrack_producer | ( | mlt_multitrack | self | ) |
Get the producer associated to this multitrack.
| self | a multitrack |
| mlt_properties mlt_multitrack_properties | ( | mlt_multitrack | self | ) |
Get the properties associated this multitrack.
| self | a multitrack |
| void mlt_multitrack_refresh | ( | mlt_multitrack | self | ) |
Initialize position related information.
| self | a multitrack |
| mlt_service mlt_multitrack_service | ( | mlt_multitrack | self | ) |
Get the service associated this multitrack.
| self | a multitrack |
| mlt_producer mlt_multitrack_track | ( | mlt_multitrack | self, |
| int | track | ||
| ) |
Get an individual track as a producer.
| self | a multitrack |
| track | the 0-based index of the producer to get |
| static int position_compare | ( | const void * | p1, |
| const void * | p2 | ||
| ) | [private] |
Position comparison function for sorting.
| p1 | a position |
| p2 | another position |
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.
| parent | the producer interface to a mulitrack | |
| [out] | frame | a frame by reference |
| index | the 0-based track index |
The implementation of the get_frame virtual function.
| producer | a producer |
| frame | a frame by reference |
| index | the time at which to get the frame |
| parent | the producer interface to the tractor | |
| [out] | frame | a frame by reference |
| track | the 0-based track index |
We're extending producer here.
Reimplemented from mlt_producer_s.
1.7.3