| 189 | } |
| 190 | |
| 191 | void QmitkVideoBackground::UpdateVideo() |
| 192 | { |
| 193 | if (m_renderWindowVectorInfo.size() > 0) |
| 194 | { |
| 195 | unsigned char *src = nullptr; |
| 196 | |
| 197 | try |
| 198 | { |
| 199 | src = m_VideoSource->GetVideoTexture(); |
| 200 | } |
| 201 | catch (const std::logic_error &error) |
| 202 | { |
| 203 | MITK_DEBUG << error.what(); |
| 204 | emit EndOfVideoSourceReached(m_VideoSource); |
| 205 | return; |
| 206 | } |
| 207 | |
| 208 | if (src) |
| 209 | { |
| 210 | for (auto it = m_renderWindowVectorInfo.begin(); it != m_renderWindowVectorInfo.end(); it++) |
| 211 | { |
| 212 | (*it).videoImport->SetImportVoidPointer(src); |
| 213 | (*it).videoImport->Modified(); |
| 214 | (*it).videoImport->Update(); |
| 215 | mitk::RenderingManager::GetInstance()->RequestUpdate((*it).renWin); |
| 216 | } |
| 217 | emit NewFrameAvailable(m_VideoSource); |
| 218 | } |
| 219 | else |
| 220 | MITK_WARN << "No video texture available"; |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | void QmitkVideoBackground::Modified() |
| 225 | { |