Is there a way to get Argus capture metadata without a display, using the Event class, or the FrameConsumer? I have a camera class, and it works, but now I need capture metadata. Based on the samples, there seems to be three ways of doing that:
- from a egl stream and a display (optionally for a specific frame):
UniqueObj<EGLStream::MetadataContainer> metadataContainer(
EGLStream::MetadataContainer::create(g_display.get(), m_eglStream));
EGLStream::IArgusCaptureMetadata *iArgusCaptureMetadata =
interface_cast<EGLStream::IArgusCaptureMetadata>(metadataContainer);
Problem there is my camera class does not use a display at the moment (will nullptr work for that parameter?).
- from an EventProvider, EventQueue, and Event like
const CaptureMetadata* metaData = iEventCaptureComplete->getMetadata();
const ICaptureMetadata* iMetadata = interface_cast<const ICaptureMetadata>(metaData);
Problem there is I’m not using this system. I adapted my code from the debayering example
- using a FrameConsumer
UniqueObj<Frame> frame(iFrameConsumer->acquireFrame());
if (!frame)
break;
...
// Print out some capture metadata from the frame.
IArgusCaptureMetadata *iArgusCaptureMetadata = interface_cast<IArgusCaptureMetadata>(frame);
if (!iArgusCaptureMetadata)
ORIGINATE_ERROR("Failed to get IArgusCaptureMetadata interface.");
CaptureMetadata *metadata = iArgusCaptureMetadata->getMetadata();
ICaptureMetadata *iMetadata = interface_cast<ICaptureMetadata>(metadata);
Problem there is the Image
returned from Frame::getImage
only supports mapping for CPU access and i need Gpu access.
class IImage : public Argus::Interface
{
...
/**
* Maps a buffer for CPU access and returns the mapped pointer.
* How this data is laid out in memory may be described by another Frame interface,
* or if the pixel format is UNKNOWN then it should be defined by the stream's producer.
* @param[in] index The buffer index to map.
* @param[out] status An optional pointer to return an error status code.
*/
virtual const void* mapBuffer(uint32_t index, Argus::Status* status = NULL) = 0;
/**
* Maps the first/only buffer for CPU access and returns the mapped pointer.
* How this data is laid out in memory may be described by another Frame interface,
* or if the pixel format is UNKNOWN then it should be defined by the stream's producer.
* @param[out] status An optional pointer to return an error status code.
*/
virtual const void* mapBuffer(Argus::Status* status = NULL) = 0;
Are there any other ways to get at the CaptureMetadata for a given capture? I am using cuEGLStreamConsumerAcquireFrame
to get a frame from the OutputStream
. I like the FrameConsumer
class. Unfortunately it doesn’t suit my purposes wihout something I can use with CUDA.