mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
Add method to get source/sink type.
Also provide convenience method to enumerate all sinks connected to a source.
This commit is contained in:
@@ -21,6 +21,18 @@ std::vector<VideoProperty> VideoSource::EnumerateProperties() const {
|
||||
return properties;
|
||||
}
|
||||
|
||||
std::vector<VideoSink> VideoSource::EnumerateSinks() {
|
||||
llvm::SmallVector<CS_Sink, 16> handles_buf;
|
||||
CS_Status status = 0;
|
||||
auto handles = EnumerateSourceSinks(m_handle, handles_buf, &status);
|
||||
|
||||
std::vector<VideoSink> sinks;
|
||||
sinks.reserve(handles.size());
|
||||
for (int handle : handles)
|
||||
sinks.emplace_back(VideoSink{handle});
|
||||
return sinks;
|
||||
}
|
||||
|
||||
std::vector<VideoSource> VideoSource::EnumerateSources() {
|
||||
llvm::SmallVector<CS_Source, 16> handles_buf;
|
||||
CS_Status status = 0;
|
||||
|
||||
Reference in New Issue
Block a user