紀錄一下 VideoBasedTracker plugin 的啟動流程,流程如下,
com_osvr_VideoBasedHMDTracker.cpp1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26class VideoBasedHMDTracker : boost::noncopyable {
VideoBasedHMDTracker() {
}
// TODO_TRACE: 誰 call update()?
OSVR_ReturnCode VideoBasedHMDTracker::update() {
m_vbtracker.processImage()
}
osvr::vbtracker::VideoBasedTracker m_vbtracker;
};
class HardwareDetection {
operator() {
auto newTracker = osvr::pluginkit::registerObjectForDeletion(
ctx, new VideoBasedHMDTracker(...));
}
};
// Plugin 進入點
OSVR_PLUGIN(com_osvr_VideoBasedHMDTracker) {
/// 告訴 core 建立一個 device object.
osvr::pluginkit::registerDriverInstantiationCallback(
ctx, "VideoBasedHMDTracker", new ConfiguredDeviceConstructor);
}
VideoBasedTracker.cpp1
2
3bool VideoBasedTracker::processImage(...) {
}