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

Method m_handleImagePlacedInProcessMemory

src/osvr/Common/ImagingComponent.cpp:331–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329
330#ifdef OSVR_COMMON_IN_PROCESS_IMAGING
331 int VRPN_CALLBACK
332 ImagingComponent::m_handleImagePlacedInProcessMemory(void *userdata,
333 vrpn_HANDLERPARAM p) {
334 auto self = static_cast<ImagingComponent *>(userdata);
335 auto bufReader = readExternalBuffer(p.buffer, p.payload_len);
336
337 messages::ImagePlacedInProcessMemory::MessageSerialization msgSerialize;
338 deserialize(bufReader, msgSerialize);
339 auto msg = msgSerialize.getMessage();
340 ImageData data;
341 data.sensor = msg.sensor;
342 data.metadata = msg.metadata;
343 data.buffer.reset(reinterpret_cast<OSVR_ImageBufferElement*>(msg.buffer), &cv::fastFree);
344 auto timestamp = util::time::fromStructTimeval(p.msg_time);
345
346 self->m_checkFirst(msg.metadata);
347 for (auto const &cb : self->m_cb) {
348 cb(data, timestamp);
349 }
350 return 0;
351 }
352#endif
353
354 int VRPN_CALLBACK

Callers

nothing calls this directly

Calls 5

readExternalBufferFunction · 0.85
deserializeFunction · 0.85
fromStructTimevalFunction · 0.85
m_checkFirstMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected