diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2010-02-07 22:18:00 +0300 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2010-02-07 22:18:00 +0300 |
commit | a8a99a628f6f3bc8ddefec8dfae8a7aa27b8f863 (patch) | |
tree | cd635f8d5cec45c5c8eeb330396b05f05a492f52 /source/gameengine/VideoTexture/ImageBase.h | |
parent | 064345ad8c72d0af21b31c3da47bad6ceb3a7023 (diff) |
BGE: add audio/video synchronization capability to VideoTexture
Add optional parameter to VideoTexture.Texture refresh() method
to specify timestamp (in seconds from start of movie) of the frame
to be loaded. This value is passed down to image source and for
VideoFFmpeg source, it is used instead of current time to load
the frame from the video file.
When combined with an audio actuator, it can be used to synchronize
the sound and the image: specify the same video file in the sound
actuator and use the KX_SoundActuator time attribute as timestamp
to refresh: the frame corresponding to the sound will be loaded:
GameLogic.video.refresh(True, soundAct.time)
Diffstat (limited to 'source/gameengine/VideoTexture/ImageBase.h')
-rw-r--r-- | source/gameengine/VideoTexture/ImageBase.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/gameengine/VideoTexture/ImageBase.h b/source/gameengine/VideoTexture/ImageBase.h index 138580ce701..70b1929b91d 100644 --- a/source/gameengine/VideoTexture/ImageBase.h +++ b/source/gameengine/VideoTexture/ImageBase.h @@ -54,7 +54,7 @@ public: virtual bool release (void); /// get image - unsigned int * getImage (unsigned int texId = 0); + unsigned int * getImage (unsigned int texId = 0, double timestamp=-1.0); /// get image size short * getSize (void) { return m_size; } /// get image buffer size @@ -123,7 +123,7 @@ protected: bool checkSourceSizes (void); /// calculate image from sources and set its availability - virtual void calcImage (unsigned int texId) {} + virtual void calcImage (unsigned int texId, double ts) {} /// perform loop detection bool loopDetect (ImageBase * img); @@ -269,7 +269,7 @@ public: void setSource (PyImage * source); /// get image from source - unsigned int * getImage (void); + unsigned int * getImage (double ts=-1.0); /// get buffered image unsigned int * getImageBuf (void) { return m_image; } /// refresh source |