MSSync
Name
MSSync -- The base object for implementing synchronization.
Description
A mediastreamer thread executes the synchronize() function of the MSSync object, then all the processing functions of the chain of filters attached to the synchronisation.
A synchronize function may do nothing, can wait for a timer, or can select for some file descriptors to change, etc... The developper is free to
implement derivated objects of MSSync in order to satisfy its needs.
Details
struct MSSync
struct MSSync
{
struct _MSSyncClass *klass;
pthread_mutex_t lock;
MSFilter **attached_filters; /* pointer to a table of pointer of filters*/
GList *execution_list; /* the list of filters to be executed. This is filled with compilation */
gint filters; /*number of filters attached to the sync */
gint run; /* flag to indicate whether the sync must be run or not */
pthread_t thread; /* the thread ressource if this sync is run by a thread*/
pthread_cond_t thread_cond;
guint32 flags;
#define MS_SYNC_NEED_UPDATE (0x0001) /* a modification has occured in the processing chains
attached to this sync; so the execution list has to be updated */
guint samples_per_tick; /* number of bytes produced by sources of the processing chains*/
guint32 ticks;
guint32 time; /* a time since the start of the sync expressed in milisec*/
}; |
Only programmers creating new derivated objects of MSSync are interested in this object.
ms_sync_attach ()
Attach a chain of filters to a synchronisation source sync. Filter f must be the first filter of the processing chain.
In order to be run, each chain of filter must be attached to a synchronisation source, that will be responsible for scheduling
the processing. Multiple chains can be attached to a single synchronisation.
ms_sync_detach ()
Dettach a chain of filters to a synchronisation source. Filter f must be the first filter of the processing chain.
The processing chain will no more be executed.