/*----------------------------------------------------------------------------*/ /* Copyright (c) FIRST 2016. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ /*----------------------------------------------------------------------------*/ #include "cameraserver_oo.h" using namespace cs; std::vector VideoSource::EnumerateProperties() const { std::vector properties; llvm::SmallVector handles; CS_Status status = 0; EnumerateSourceProperties(m_handle, handles, &status); properties.reserve(handles.size()); for (int handle : handles) properties.emplace_back(VideoProperty{handle}); return properties; } std::vector VideoSource::EnumerateSources() { std::vector sources; llvm::SmallVector handles; CS_Status status = 0; ::cs::EnumerateSources(handles, &status); sources.reserve(handles.size()); for (int handle : handles) sources.emplace_back(VideoSource{handle}); return sources; } std::vector VideoSink::EnumerateSinks() { std::vector sinks; llvm::SmallVector handles; CS_Status status = 0; ::cs::EnumerateSinks(handles, &status); sinks.reserve(handles.size()); for (int handle : handles) sinks.emplace_back(VideoSink{handle}); return sinks; }