Use the SDK interface to get the frameSet, then get the frame from frameSet, print the value of the frame metadata and exit the program using the ESC_KEY key.
Pipeline is a pipeline for processing data streams, providing multi-channel stream configuration, switching, frame aggregation, and frame synchronization functions.
Frameset is a combination of different types of Frames.
Metadata is used to describe the various properties and states of a frame.
Create an ob::Pipeline object, and start the pipeline.
// Create a pipeline.
ob::Pipeline pipe;
// Start the pipeline with default config.
// Modify the default configuration by the configuration file: "OrbbecSDKConfig.xml"
pipe.start();
Get frameSet from pipeline.
// Wait for frameSet from the pipeline, the default timeout is 1000ms.
auto frameSet = pipe.waitForFrameset();
Get frame from frameSet.
auto frameCount = frameSet->getCount();
for(uint32_t i = 0; i < frameCount; i++) {
// Get the frame from frameSet
auto frame = frameSet->getFrame(i);
}
Check if the frame object contains metadata, then retrieve it.
// Get the metadata of the frame
for(uint32_t j = 0; j < static_cast<uint32_t>(metadataCount); j++) {
// If the frame has the metadata, get the metadata value
if(frame->hasMetadata(static_cast<OBFrameMetadataType>(j))) {
std::cout << "metadata type: " << std::left << std::setw(50) << metadataTypeMap[j]
<< " metadata value: " << frame->getMetadataValue(static_cast<OBFrameMetadataType>(j)) << std::endl;
}
}
Stop pipeline
// Stop the Pipeline, no frame data will be generated
pipe.stop();
Press the Esc key in the window to exit the program.