// camera_config.proto - 所有配置都在这里
syntax = "proto3";
package cmvr.config;

// 枚举定义
enum CameraMode {
    CAMERA_MODE_PHOTO = 0;
    CAMERA_MODE_VIDEO = 1;
}

enum StreamMode {
    STREAM_MODE_RGB = 0;
    STREAM_MODE_RGBD = 1;
    STREAM_MODE_DEPTH = 2;
}

enum AlignMode {
    ALIGN_MODE_COLOR = 0;
    ALIGN_MODE_DEPTH = 1;
}

// RealSense摄像头
message RealSenseCameraConfig {
    reserved 12;

    string id = 1;
    string serialNumber = 2;
    int32 width = 3;
    int32 height = 4;
    int32 fps = 5;
    string codec = 6;
    CameraMode camera_mode = 7;
    StreamMode stream_mode = 8;
    AlignMode align_mode = 9;
    int32 buffer_size = 10;
    bool sync = 11;
    int32 encode_width = 13;
    int32 encode_height = 14;
}

// UVC摄像头
message UVCCameraConfig {
    reserved 10;

    string id = 1;
    string usb = 2;  // 或者叫 device_path
    int32 width = 3;
    int32 height = 4;
    int32 fps = 5;
    string codec = 6;
    CameraMode camera_mode = 7;
    StreamMode stream_mode = 8;
    int32 buffer_size = 9;
    int32 encode_width = 11;
    int32 encode_height = 12;
}

// MechMind工业相机
message MechMindCameraConfig {
    reserved 5;

    string id = 1;
    string ip = 2;
    optional bool align = 3;
    string image2d_type = 4;
}

message CameraDeviceConfig {
    string id = 1;
    reserved 2;

    oneof backend {
        UVCCameraConfig uvc = 10;
        RealSenseCameraConfig realsense = 11;
        MechMindCameraConfig mechmind = 12;
    }
}

message CameraConfig {
    repeated CameraDeviceConfig cameras = 1;
}

message CameraRootConfig {
    CameraConfig camera = 1;
}
