mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
SourceImpl: Add no-copy PutFrame.
This commit is contained in:
@@ -301,6 +301,10 @@ void SourceImpl::PutFrame(VideoMode::PixelFormat pixelFormat, int width,
|
||||
<< " bytes)");
|
||||
std::memcpy(frameData->data, data.data(), data.size());
|
||||
|
||||
PutFrame(std::move(frameData));
|
||||
}
|
||||
|
||||
void SourceImpl::PutFrame(std::unique_ptr<Frame::Data> frameData) {
|
||||
// Update frame
|
||||
{
|
||||
std::lock_guard<std::mutex> lock{m_frameMutex};
|
||||
|
||||
@@ -122,6 +122,7 @@ class SourceImpl {
|
||||
protected:
|
||||
void PutFrame(VideoMode::PixelFormat pixelFormat, int width, int height,
|
||||
llvm::StringRef data, Frame::Time time);
|
||||
void PutFrame(std::unique_ptr<Frame::Data> frameData);
|
||||
void PutError(llvm::StringRef msg, Frame::Time time) {
|
||||
PutFrame(VideoMode::kUnknown, 0, 0, msg, time);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user