不太会用 cgo ,能帮我正常调用的 bro ,请喝杯奶茶
package main
/*
#cgo CFLAGS: -I./include -x c++
#cgo LDFLAGS: -L./lib -lCameraSDK
#include <camera/camera.h>
#include <stdlib.h>
#include <camera/device_discovery.h>
#include <camera/photography_settings.h>
*/
import "C"
func main() {
}
device_discovery.h
#pragma once
#include <camera/ins_types.h>
#include <vector>
namespace ins_camera {
/**
* \class DeviceDiscovery
* \brief a convenient class for discovery Insta360 camera devices.
*/
class CAMERASDK_API DeviceDiscovery {
public:
/**
* \brief get a list of available devices. This method may establish a connection with
* detected cameras to get some basic information such as serial_number.
* \return a list of DeviceDescriptor describing detected cameras.
* Remember to call FreeDeviceDescriptors(std::vector<DeviceDescriptor> descs)
* on the returned list to avoid memory leak.
*/
std::vector<DeviceDescriptor> GetAvailableDevices();
/**
* \brief free memory allocated for DeviceDescriptor
*/
void FreeDeviceDescriptors(std::vector<DeviceDescriptor> descs);
private:
std::vector<DeviceDescriptor> GetAvailableUSBDevices();
std::vector<DeviceDescriptor> GetAvailableWifiDevices();
};
}
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.