/** * Get the metadata tags attached to device caller, and merge them with metadata * stored in pMd. Returns a metadata object (by value). */ Metadata CoreCallback::AddCameraMetadata(const MM::Device* caller, const Metadata* pMd) { char label[MM::MaxStrLength]; caller->GetLabel(label); char serializedMD[MM::MaxStrLength]; ((MM::Camera*) caller)->GetTags(serializedMD); Metadata devMD; devMD.Restore(serializedMD); // Copy the metadata Metadata md; if (pMd) { md = *pMd; } // Add the source Camera as a tag. md.put("Camera",label); md.Merge(devMD); return md; }
int CoreCallback::InsertImage(const MM::Device* caller, const unsigned char* buf, unsigned width, unsigned height, unsigned byteDepth, const char* serializedMetadata, const bool doProcess) { Metadata md; md.Restore(serializedMetadata); return InsertImage(caller, buf, width, height, byteDepth, &md, doProcess); }