12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- #ifndef UVCDEVICE_MANAGER_H
- #define UVCDEVICE_MANAGER_H
- #include "../libuvc/libuvc.h"
- #include "../MppDecoder/MppDecoder.h"
- #include <stdio.h>
- #include <unistd.h>
- #include <sys/time.h>
- #include "UVCCallBack.h"
- #include <list>
- #include "UVCDevice.h"
- #include <iostream>
- #include <memory>
- #include "../gpio_explorer.hpp"
- #include "../DataManager/DataManager.h"
- class UVCManager
- {
- public:
- static UVCManager &getInstance()
- {
- static UVCManager instance;
- return instance;
- }
- void init();
- int deliverFrameInCallBack(uvc_device_handle_t *devh);
- void startAllStreaming();
- void stopAllStreaming();
- uvc_context_t *getContext()
- {
- return ctx;
- }
- private:
- UVCManager()
- {
- uvc_init(&ctx, NULL);
- }
- ~UVCManager()
- {
- uvc_exit(ctx);
- }
- UVCManager(const UVCManager &) = delete;
- UVCManager &operator=(const UVCManager &) = delete;
- uvc_context_t *ctx;
- // device list
- uvc_device_t **deviceList;
- // device number
- int deviceNum;
- // the UVC device list is been managed by UVCManager
- std::list<UVCDevice *> uvcDeviceList;
- //
- std::shared_ptr<GPIOExplorer> m_GpioExplorer;
-
- };
- #endif // UVCDEVICE_MANAGER_H
|