Example #1
0
void VideoImplService::setActiveVideoSource(QString uid)
{
    mActiveVideoSource = mEmptyVideoSource;

    std::vector<VideoSourcePtr> sources = this->getVideoSources();
    for (unsigned i=0; i<sources.size(); ++i)
        if (sources[i]->getUid()==uid)
            mActiveVideoSource = sources[i];

    // set active stream in all probes if stream is present:
    TrackingService::ToolMap tools = mBackend->tracking()->getTools();
    for (TrackingService::ToolMap::iterator iter=tools.begin(); iter!=tools.end(); ++iter)
    {
        ProbePtr probe = iter->second->getProbe();
        if (!probe)
            continue;
        if (!probe->getAvailableVideoSources().count(uid)){
            report("No active streams");
            continue;
        }
        probe->setActiveStream(uid);
    }

    emit activeVideoSourceChanged();
}
Example #2
0
ToolPtr PatientModelImplService::getProbeTool(QString videoSourceUid)
{
	for (std::map<QString, ToolPtr>::const_iterator iter = mProbeTools.begin(); iter != mProbeTools.end(); ++iter)
	{
		ToolPtr tool = iter->second;
		ProbePtr probe = tool->getProbe();
		if(probe && probe->getAvailableVideoSources().contains(videoSourceUid))
			return tool;
	}
	reportWarning("Found no probe for stream" + videoSourceUid);
	return ToolPtr();
}
Example #3
0
std::vector<VideoSourcePtr> USAcquisition::getRecordingVideoSources(ToolPtr tool)
{
	std::vector<VideoSourcePtr> retval;

	if (tool && tool->getProbe())
	{
		ProbePtr probe = tool->getProbe();
		QStringList sources = probe->getAvailableVideoSources();
		for (unsigned i=0; i<sources.size(); ++i)
			retval.push_back(probe->getRTSource(sources[i]));
	}
	else
	{
		retval = this->getServices()->video()->getVideoSources();
	}

	return retval;
}