From Brad Christiansen, "Attached are some small changes to the ImageStream interface and the DirectShow and FFMPEG plugins to provide the current time being displayed in the image stream.
I don’t have access to an OSX or Linux dev machine to make the changes required to the quick time plugin. This plugin will just default to returning 0."
This commit is contained in:
@@ -1809,6 +1809,29 @@ void DirectShowImageStream::seek(double time)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
double DirectShowImageStream::getCurrentTime() const
|
||||
{
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
|
||||
double currentTime = -1;
|
||||
if (_renderer.valid() && _renderer->_mediaSeeking)
|
||||
{
|
||||
|
||||
LONGLONG curTimeLL = 0;
|
||||
HRESULT hr = _renderer->_mediaSeeking->GetCurrentPosition(&curTimeLL);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
OSG_NOTICE << this << " " << getErrorMessage(hr) << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
currentTime = static_cast<double>(curTimeLL);
|
||||
currentTime = currentTime * (100.0 * 1e-9); // default unit in directshow IMediaSeeking
|
||||
}
|
||||
}
|
||||
return currentTime;
|
||||
}
|
||||
|
||||
void DirectShowImageStream::setOptions(const Options& map)
|
||||
{
|
||||
for (Options::const_iterator it = map.begin(); it != map.end(); it++)
|
||||
|
||||
Reference in New Issue
Block a user