Synchronization method descriptor. More...
#include <WAAVE.h>
Synchronization method descriptor.
Describe the master and slave synchronization method. Classic use is audio/video sync but you can sync video to you own clock (master redefined) or sync an object to the audio clock (slave redefined).
Data Fields | |
int | loopingFlag |
Looping method. | |
void(* | signalStateChange )(struct WVSyncObject *sync) |
Signal state change to the slave. | |
void(* | getRefClock )(struct WVSyncObject *sync, WVReferenceClock *refClock) |
Return the master clock. | |
int(* | play )(struct WVSyncObject *sync) |
Start master clock. | |
int(* | pause )(struct WVSyncObject *sync) |
Pause master clock. | |
int(* | seek )(struct WVSyncObject *sync, uint32_t clock, int seekFlag) |
Seek on master clock. | |
void * | objPrivate |
Method's private data. | |
void * | wvStdPrivate |
Private space for the waave engine. |
void(* WVSyncObject::getRefClock)(struct WVSyncObject *sync, WVReferenceClock *refClock) |
Return the master clock.
sync | The sync object |
refClock | input/ouput clock descriptor |
Defined by the master it give the reference clock. The slave fill refClock->clock and refClock->modIdx with its current stream position, so master clock can readjust itself when modIdx change (When playing video only, it's the video part, the slave, that receive the EOF or seek signal. So it's give it to the master by setting the modIdx index.
Be carefull ! Master will get a UINT32_MAX clock if the slave can't determine his stream pos Be carefull ! If teh slave give modIdx=0, the getRefClock must return its clock value
int WVSyncObject::loopingFlag |
Looping method.
Set by the waave engine to follow stream parameters. This flag give to the object methods if looping playback is enabled. Must be read to thread End of File. Possible values are :
looping flag | Description |
---|---|
WV_BLOCKING_STREAM | When the stream reach end of file it stops |
WV_LOOPING_STREAM | When the stream reach end of file it restart playing at the beginning |
void* WVSyncObject::objPrivate |
Method's private data.
Private data used by the methods.
int(* WVSyncObject::pause)(struct WVSyncObject *sync) |
Pause master clock.
sync | The sync object |
Defined by the master it pause master clock or return -1 if the pause command is useless (the clock already paused) This does not signal state change to the slave. This done with the pauseFlag of teh reference clock.
int(* WVSyncObject::play)(struct WVSyncObject *sync) |
Start master clock.
sync | The sync object |
Defined by the master it start master clock if it was paused or return -1 if the play command is useless (the clock already running) It need to signal state change to the slave.
int(* WVSyncObject::seek)(struct WVSyncObject *sync, uint32_t clock, int seekFlag) |
Seek on master clock.
sync | The sync object |
clock | The seek target clock |
seekFlag | Method used if clock is paused |
Defined by the master it realise seek operation on master clock. This method need to signal state change to the slave and need to thread the given seek flag.
Seek flag | Description |
---|---|
WV_BLOCKING_SEEK | If the clock is paused it stay paused after the seek |
WV_PLAYING_SEEK | If the clock is paused it restart when a seek command is sent |
void(* WVSyncObject::signalStateChange)(struct WVSyncObject *sync) |
Signal state change to the slave.
sync | The sync object |
Defined by the slave for thread synchronization, signalStateChange is called by the clock generator to signal the slave for clock modification. Usually it signal play, seek and EOF but it does not signal pause because it can be read with pause flag.
void* WVSyncObject::wvStdPrivate |
Private space for the waave engine.
Used by the waave engine to complete the user given methods with standard methods like audio/video sync. Don't access it.