Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2010-02-07 22:18:00 +0300
committerBenoit Bolsee <benoit.bolsee@online.be>2010-02-07 22:18:00 +0300
commita8a99a628f6f3bc8ddefec8dfae8a7aa27b8f863 (patch)
treecd635f8d5cec45c5c8eeb330396b05f05a492f52 /source/gameengine/VideoTexture/VideoFFmpeg.h
parent064345ad8c72d0af21b31c3da47bad6ceb3a7023 (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/VideoFFmpeg.h')
-rw-r--r--source/gameengine/VideoTexture/VideoFFmpeg.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/gameengine/VideoTexture/VideoFFmpeg.h b/source/gameengine/VideoTexture/VideoFFmpeg.h
index b56984588c1..355c58c496b 100644
--- a/source/gameengine/VideoTexture/VideoFFmpeg.h
+++ b/source/gameengine/VideoTexture/VideoFFmpeg.h
@@ -129,6 +129,9 @@ protected:
/// end of file reached
bool m_eof;
+ /// flag to indicate that time is coming from application
+ bool m_externTime;
+
/// current file pointer position in file expressed in frame number
long m_curPosition;
@@ -154,10 +157,10 @@ protected:
STR_String m_imageName;
/// image calculation
- virtual void calcImage (unsigned int texId);
+ virtual void calcImage (unsigned int texId, double ts);
/// load frame from video
- void loadFrame (void);
+ void loadFrame (double ts);
/// set actual position
void setPositions (void);