MCPcopy Create free account
hub / github.com/OSVR/OSVR-Core / m_sendImageDataViaInProcessMemory

Method m_sendImageDataViaInProcessMemory

src/osvr/Common/ImagingComponent.cpp:229–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227
228#ifdef OSVR_COMMON_IN_PROCESS_IMAGING
229 bool ImagingComponent::m_sendImageDataViaInProcessMemory(
230 OSVR_ImagingMetadata metadata, OSVR_ImageBufferElement *imageData,
231 OSVR_ChannelCount sensor, OSVR_TimeValue const &timestamp) {
232
233 auto imageBufferSize = getBufferSize(metadata);
234 auto imageBufferCopy = reinterpret_cast<OSVR_ImageBufferElement*>(cv::fastMalloc(imageBufferSize));
235 memcpy(imageBufferCopy, imageData, imageBufferSize);
236
237 Buffer<> buf;
238 messages::ImagePlacedInProcessMemory::MessageSerialization serialization(
239 messages::InProcessMemoryMessage{ metadata, sensor, reinterpret_cast<int>(imageBufferCopy) });
240
241 serialize(buf, serialization);
242 m_getParent().packMessage(
243 buf, imagePlacedInProcessMemory.getMessageType(), timestamp);
244
245 return true;
246 }
247#endif
248
249 bool ImagingComponent::m_sendImageDataViaSharedMemory(

Callers

nothing calls this directly

Calls 4

getBufferSizeFunction · 0.85
serializeFunction · 0.85
packMessageMethod · 0.80
getMessageTypeMethod · 0.80

Tested by

no test coverage detected