refactor(device): add channels adapter to device

This commit is contained in:
John Zhao
2018-12-24 00:39:43 +08:00
parent c6bed032cb
commit 2f4ffded7c
16 changed files with 455 additions and 251 deletions

View File

@@ -43,6 +43,7 @@ struct DeviceInfo;
class API;
class Channels;
class ChannelsAdapter;
class Motions;
class Streams;
class StreamsAdapter;
@@ -70,7 +71,13 @@ class MYNTEYE_API Device {
using img_params_t = device::img_params_t;
using imu_params_t = device::imu_params_t;
Device(const Model &model, std::shared_ptr<uvc::device> device);
protected:
Device(const Model &model,
const std::shared_ptr<uvc::device> &device,
const std::shared_ptr<StreamsAdapter> &streams_adapter,
const std::shared_ptr<ChannelsAdapter> &channels_adapter);
public:
virtual ~Device();
/**
@@ -301,7 +308,6 @@ class MYNTEYE_API Device {
virtual void OnStereoStreamUpdate();
virtual Capabilities GetKeyStreamCapability() const = 0;
virtual std::shared_ptr<StreamsAdapter> CreateStreamsAdapter() const = 0;
std::map<Resolution, device::img_params_t> GetImgParams() const {
return all_img_params_;

View File

@@ -212,7 +212,7 @@ enum class Option : std::uint8_t {
* The range of accelerometer
*
* value of standard 1: {4,8,16,32}, default: 8
* value of standard 2: {6,12,24,48}, default: 6
* value of standard 2: {6,12,24,48}, default: 12
*/
ACCELEROMETER_RANGE,
/**
@@ -357,7 +357,7 @@ struct MYNTEYE_API StreamRequest {
std::uint16_t height;
/** Stream pixel format */
Format format;
/** Stream frames per second (unused) */
/** Stream frames per second */
std::uint16_t fps;
StreamRequest() {}
@@ -522,7 +522,13 @@ struct MYNTEYE_API ImgData {
struct MYNTEYE_API ImuData {
/** IMU frame id */
std::uint32_t frame_id;
/** IMU accel or gyro flag: 1 for accel, 2 for gyro, 3 for both */
/**
* IMU accel or gyro flag
*
* 0: accel and gyro are both valid
* 1: accel is valid
* 2: gyro is valid
*/
std::uint8_t flag;
/** IMU timestamp in 1us */
std::uint64_t timestamp;