How does `ICameraProvider::getCameraDevices` working?

Hi everyone, I think ICameraProvider::getCameraDevices is a pure virtual function, the declaration is

class ICameraProvider : public Interface {
     public:
         ....
         virtual Status getCameraDevices(std::vector<CameraDevice*>* devices) const = 0;
         ...
 };

but I saw some code in /usr/src/jetson_multimedia_api/samples/13_multi_camera/main.cpp like

    g_cameraProvider = UniqueObj<CameraProvider>(CameraProvider::create());
    ICameraProvider *iCameraProvider = interface_cast<ICameraProvider>(g_cameraProvider);
    ....
    std::vector<CameraDevice*> cameraDevices;
    iCameraProvider->getCameraDevices(&cameraDevices);
    if (cameraDevices.size() == 0)
        ORIGINATE_ERROR("No cameras available");

The interface_cast seem do something like cast CameraProvider to its parent class InterfaceProvider, then get Interface and cast to ICameraProvider , some abstract class cast things…

I don’t understand, how does the getCameraDevices( a pure virtual function) really working, where is its implement ?

It’s implement in the libnvargus.so that didn’t public the source code.

thank you for your reply

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.