00001 #include "Headers.h"
00002 #include "StreamSource.h"
00003
00004 CStreamSource::CStreamSource(CChannel* channel)
00005 {
00006 assert(channel);
00007 this->channel = channel;
00008 }
00009
00010 void CStreamSource::Synchronize(__time currentTime, __time& scheduleTime, __uint32& frame)
00011 {
00012
00013 frame = (__uint32)ceil(currentTime * this->channel->Fps());
00014 scheduleTime = frame / this->channel->Fps();
00015 }
00016
00017 __uint32 CStreamSource::Synchronize(__time time)
00018 {
00019 return (__uint32)(time * this->channel->Fps());
00020 }
00021
00022 __time CStreamSource::FrameTime(__uint32 index)
00023 {
00024 return ((double)index) / this->channel->Fps();
00025 }