content: // ignore_for_file: always_specify_types
  // ignore_for_file: camel_case_types
  // ignore_for_file: non_constant_identifier_names
  
  // AUTO GENERATED FILE, DO NOT EDIT.
  //
  // Generated by `package:ffigen`.
  // ignore_for_file: type=lint
  import 'dart:ffi' as ffi;
  
  /// Bindings for `src/flutter_plugin.h`.
  ///
  /// Regenerate bindings with `flutter pub run ffigen --config ffigen.yaml`.
  ///
  class UVCPluginBindings {
    /// Holds the symbol lookup function.
    final ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName)
        _lookup;
  
    /// The symbols are looked up in [dynamicLibrary].
    UVCPluginBindings(ffi.DynamicLibrary dynamicLibrary)
        : _lookup = dynamicLibrary.lookup;
  
    /// The symbols are looked up with [lookup].
    UVCPluginBindings.fromLookup(
        ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName)
            lookup)
        : _lookup = lookup;
  
    /// --------------------------------------------------------------------------------
    /// DartのFlutterプラグイン部分から呼ばれる関数
    int initialize_dart_api(
      ffi.Pointer<ffi.Void> data,
    ) {
      return _initialize_dart_api(
        data,
      );
    }
  
    late final _initialize_dart_apiPtr =
        _lookup<ffi.NativeFunction<ffi.Int64 Function(ffi.Pointer<ffi.Void>)>>(
            'initialize_dart_api');
    late final _initialize_dart_api =
        _initialize_dart_apiPtr.asFunction<int Function(ffi.Pointer<ffi.Void>)>();
  
    void set_dart_api_message_port(
      int port,
    ) {
      return _set_dart_api_message_port(
        port,
      );
    }
  
    late final _set_dart_api_message_portPtr =
        _lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64)>>(
            'set_dart_api_message_port');
    late final _set_dart_api_message_port =
        _set_dart_api_message_portPtr.asFunction<void Function(int)>();
  
    int get_state(
      int device_id,
    ) {
      return _get_state(
        device_id,
      );
    }
  
    late final _get_statePtr =
        _lookup<ffi.NativeFunction<ffi.Int32 Function(ffi.Int32)>>('get_state');
    late final _get_state = _get_statePtr.asFunction<int Function(int)>();
  
    int get_device_info(
      int device_id,
      ffi.Pointer<flutter_device_info_t> info_out,
    ) {
      return _get_device_info(
        device_id,
        info_out,
      );
    }
  
    late final _get_device_infoPtr = _lookup<
        ffi.NativeFunction<
            ffi.Int32 Function(ffi.Int32,
                ffi.Pointer<flutter_device_info_t>)>>('get_device_info');
    late final _get_device_info = _get_device_infoPtr
        .asFunction<int Function(int, ffi.Pointer<flutter_device_info_t>)>();
  
    int start(
      int device_id,
    ) {
      return _start(
        device_id,
      );
    }
  
    late final _startPtr =
        _lookup<ffi.NativeFunction<ffi.Int64 Function(ffi.Int32)>>('start');
    late final _start = _startPtr.asFunction<int Function(int)>();
  
    int stop(
      int device_id,
    ) {
      return _stop(
        device_id,
      );
    }
  
    late final _stopPtr =
        _lookup<ffi.NativeFunction<ffi.Int32 Function(ffi.Int32)>>('stop');
    late final _stop = _stopPtr.asFunction<int Function(int)>();
  
    int set_video_size(
      int device_id,
      int type,
      int width,
      int height,
    ) {
      return _set_video_size(
        device_id,
        type,
        width,
        height,
      );
    }
  
    late final _set_video_sizePtr = _lookup<
        ffi.NativeFunction<
            ffi.Int Function(ffi.Int32, ffi.Uint32, ffi.Uint32,
                ffi.Uint32)>>('set_video_size');
    late final _set_video_size =
        _set_video_sizePtr.asFunction<int Function(int, int, int, int)>();
  
    int get_current_size(
      int device_id,
      ffi.Pointer<flutter_video_size_t> data,
    ) {
      return _get_current_size(
        device_id,
        data,
      );
    }
  
    late final _get_current_sizePtr = _lookup<
        ffi.NativeFunction<
            ffi.Int Function(ffi.Int32,
                ffi.Pointer<flutter_video_size_t>)>>('get_current_size');
    late final _get_current_size = _get_current_sizePtr
        .asFunction<int Function(int, ffi.Pointer<flutter_video_size_t>)>();
  
    /// コントロール機能でサポートしている機能を取得
    /// @param device_id
    /// @return
    int get_ctrl_supports(
      int device_id,
    ) {
      return _get_ctrl_supports(
        device_id,
      );
    }
  
    late final _get_ctrl_supportsPtr =
        _lookup<ffi.NativeFunction<ffi.Uint64 Function(ffi.Int32)>>(
            'get_ctrl_supports');
    late final _get_ctrl_supports =
        _get_ctrl_supportsPtr.asFunction<int Function(int)>();
  
    /// プロセッシングユニットでサポートしている機能を取得
    /// @param device_id
    /// @return
    int get_proc_supports(
      int device_id,
    ) {
      return _get_proc_supports(
        device_id,
      );
    }
  
    late final _get_proc_supportsPtr =
        _lookup<ffi.NativeFunction<ffi.Uint64 Function(ffi.Int32)>>(
            'get_proc_supports');
    late final _get_proc_supports =
        _get_proc_supportsPtr.asFunction<int Function(int)>();
  
    /// 指定した機能の設定情報を取得
    /// @param device_id
    /// @param value
    /// @return
    int get_ctrl_info(
      int device_id,
      ffi.Pointer<flutter_control_info_t> value,
    ) {
      return _get_ctrl_info(
        device_id,
        value,
      );
    }
  
    late final _get_ctrl_infoPtr = _lookup<
        ffi.NativeFunction<
            ffi.Int32 Function(ffi.Int32,
                ffi.Pointer<flutter_control_info_t>)>>('get_ctrl_info');
    late final _get_ctrl_info = _get_ctrl_infoPtr
        .asFunction<int Function(int, ffi.Pointer<flutter_control_info_t>)>();
  
    /// 指定した機能の設定値を適用
    /// @param device_id
    /// @param type
    /// @param value
    /// @return
    int set_ctrl_value(
      int device_id,
      int type,
      int value,
    ) {
      return _set_ctrl_value(
        device_id,
        type,
        value,
      );
    }
  
    late final _set_ctrl_valuePtr = _lookup<
        ffi.NativeFunction<
            ffi.Int32 Function(
                ffi.Int32, ffi.Uint64, ffi.Int32)>>('set_ctrl_value');
    late final _set_ctrl_value =
        _set_ctrl_valuePtr.asFunction<int Function(int, int, int)>();
  
    /// 指定した機能の設定値を取得
    /// @param device_id
    /// @param type
    /// @param value
    /// @return
    int get_ctrl_value(
      int device_id,
      int type,
      ffi.Pointer<ffi.Int32> value,
    ) {
      return _get_ctrl_value(
        device_id,
        type,
        value,
      );
    }
  
    late final _get_ctrl_valuePtr = _lookup<
        ffi.NativeFunction<
            ffi.Int32 Function(ffi.Int32, ffi.Uint64,
                ffi.Pointer<ffi.Int32>)>>('get_ctrl_value');
    late final _get_ctrl_value = _get_ctrl_valuePtr
        .asFunction<int Function(int, int, ffi.Pointer<ffi.Int32>)>();
  
    /// native側でUVC映像サイズ設定へアクセスするときのヘルパー関数
    /// 主にUnityやFlutterからのアクセスを想定
    /// @param device_id
    /// @param index 映像サイズ設定のインデックス
    /// @param num_supported 対応している映像サイズ設定の数を入れるuint32_tへのポインタ
    /// @param data 映像サイズ設定を書き込むためのunity_video_size_t構造体へのポインタ
    /// @return 0: 成功, 負: エラーコード
    int get_supported_size(
      int device_id,
      int index,
      ffi.Pointer<ffi.Int32> num_supported,
      ffi.Pointer<flutter_video_size_t> data,
    ) {
      return _get_supported_size(
        device_id,
        index,
        num_supported,
        data,
      );
    }
  
    late final _get_supported_sizePtr = _lookup<
        ffi.NativeFunction<
            ffi.Int32 Function(ffi.Int32, ffi.Int32, ffi.Pointer<ffi.Int32>,
                ffi.Pointer<flutter_video_size_t>)>>('get_supported_size');
    late final _get_supported_size = _get_supported_sizePtr.asFunction<
        int Function(int, int, ffi.Pointer<ffi.Int32>,
            ffi.Pointer<flutter_video_size_t>)>();
  
    /// 映像取得用のsurfaceをセットする
    /// @param device_id UVC機器の識別子
    /// @param tex_id   テクスチャID
    /// @param jsurface Java側のSurfaceオブジェクト
    int set_preview_surface(
      int device_id,
      int tex_id,
      ffi.Pointer<ffi.Void> jsurface,
    ) {
      return _set_preview_surface(
        device_id,
        tex_id,
        jsurface,
      );
    }
  
    late final _set_preview_surfacePtr = _lookup<
        ffi.NativeFunction<
            ffi.Int32 Function(ffi.Int32, ffi.Int64,
                ffi.Pointer<ffi.Void>)>>('set_preview_surface');
    late final _set_preview_surface = _set_preview_surfacePtr
        .asFunction<int Function(int, int, ffi.Pointer<ffi.Void>)>();
  }
  
  /// UVC機器との接続状態
  enum device_state {
    /// プラグインが初期化されていない
    UNINITIALIZED(-1),
  
    /// 指定した機器が接続されていない
    DISCONNECTED(0),
  
    /// 指定した機器が接続されている(映像取得中ではない)
    CONNECTED(1),
  
    /// 指定した機器が接続されており映像取得中
    STREAMING(2);
  
    final int value;
    const device_state(this.value);
  
    static device_state fromValue(int value) => switch (value) {
          -1 => UNINITIALIZED,
          0 => DISCONNECTED,
          1 => CONNECTED,
          2 => STREAMING,
          _ => throw ArgumentError('Unknown value for device_state: $value'),
        };
  }
  
  /// Flutterのc#側とUVCコントロール機能の設定値等をやりとりするための構造体定義
  /// Flutterのc#側にも同じ構造体を定義する必要がある
  @ffi.Packed(1)
  final class flutter_control_info extends ffi.Struct {
    /// UVCコントロールの種類(CTRL_XXXまたはPU_XXX)
    @ffi.Uint64()
    external int type;
  
    /// 初期化済みかどうか
    @ffi.Int32()
    external int initialized;
  
    /// 最大最小値を持つかどうか
    @ffi.Int32()
    external int has_min_max;
  
    /// デフォルト値
    @ffi.Int32()
    external int def;
  
    /// 現在値
    @ffi.Int32()
    external int current;
  
    /// 分解能
    @ffi.Int32()
    external int res;
  
    /// 最小値
    @ffi.Int32()
    external int min;
  
    /// 最大値
    @ffi.Int32()
    external int max;
  }
  
  /// Flutterのc#側とUVCコントロール機能の設定値等をやりとりするための構造体定義
  /// Flutterのc#側にも同じ構造体を定義する必要がある
  typedef flutter_control_info_t = flutter_control_info;
  
  /// Flutterのc#側と映像サイズ設定をやりとりするための構造体定義
  /// Flutterのc#側にも同じ構造体を定義する必要がある
  @ffi.Packed(1)
  final class flutter_video_size extends ffi.Struct {
    @ffi.Uint32()
    external int frame_type;
  
    /// フレームインデックス
    @ffi.Int32()
    external int frame_index;
  
    /// 映像幅[ピクセル数]
    @ffi.Uint32()
    external int width;
  
    /// 映像高さ[ピクセル数]
    @ffi.Uint32()
    external int height;
  
    /// フレームレートのタイプ
    /// 0: min/max/stepの3つのuint32_tで指定
    /// 正数: フレームインターバルデータの個数
    @ffi.Int32()
    external int frame_interval_type;
  
    /// フレームインターバルデータ
    @ffi.Array.multi([128])
    external ffi.Array<ffi.Uint32> frame_intervals;
  
    /// フレームインターバルデータの個数
    @ffi.Int32()
    external int num_frame_intervals;
  
    /// フレームレート
    @ffi.Array.multi([128])
    external ffi.Array<ffi.Float> fps;
  
    /// フレームレートの個数
    @ffi.Int32()
    external int num_fps;
  }
  
  /// Flutterのc#側と映像サイズ設定をやりとりするための構造体定義
  /// Flutterのc#側にも同じ構造体を定義する必要がある
  typedef flutter_video_size_t = flutter_video_size;
  
  /// 接続しているUSB機器情報
  @ffi.Packed(1)
  final class flutter_device_info extends ffi.Struct {
    @ffi.Uint32()
    external int vendor_id;
  
    @ffi.Uint32()
    external int product_id;
  
    @ffi.Uint8()
    external int device_class;
  
    @ffi.Uint8()
    external int device_subclass;
  
    @ffi.Uint8()
    external int device_protocol;
  
    @ffi.Uint8()
    external int reserved1;
  
    @ffi.Array.multi([128])
    external ffi.Array<ffi.Uint8> name;
  
    @ffi.Array.multi([128])
    external ffi.Array<ffi.Uint8> manufacturer_name;
  
    @ffi.Array.multi([128])
    external ffi.Array<ffi.Uint8> product_name;
  
    @ffi.Array.multi([128])
    external ffi.Array<ffi.Uint8> serial;
  }
  
  /// 接続しているUSB機器情報
  typedef flutter_device_info_t = flutter_device_info;
  
  const int MAX_INTERVALS = 128;
  
  const int FLG_CTRL_SCANNING = 1;
  
  const int FLG_CTRL_AE = 2;
  
  const int FLG_CTRL_AE_PRIORITY = 4;
  
  const int FLG_CTRL_AE_ABS = 8;
  
  const int FLG_CTRL_AE_REL = 16;
  
  const int FLG_CTRL_FOCUS_ABS = 32;
  
  const int FLG_CTRL_FOCUS_REL = 64;
  
  const int FLG_CTRL_IRIS_ABS = 128;
  
  const int FLG_CTRL_IRIS_REL = 256;
  
  const int FLG_CTRL_ZOOM_ABS = 512;
  
  const int FLG_CTRL_ZOOM_REL = 1024;
  
  const int FLG_CTRL_PANTILT_ABS = 2048;
  
  const int FLG_CTRL_PAN_ABS = 16779264;
  
  const int FLG_CTRL_TILT_ABS = 33556480;
  
  const int FLG_CTRL_PANTILT_REL = 4096;
  
  const int FLG_CTRL_PAN_REL = 16781312;
  
  const int FLG_CTRL_TILT_REL = 33558528;
  
  const int FLG_CTRL_ROLL_ABS = 8192;
  
  const int FLG_CTRL_ROLL_REL = 16384;
  
  const int FLG_CTRL_D15 = 32768;
  
  const int FLG_CTRL_D16 = 65536;
  
  const int FLG_CTRL_FOCUS_AUTO = 131072;
  
  const int FLG_CTRL_PRIVACY = 262144;
  
  const int FLG_CTRL_FOCUS_SIMPLE = 524288;
  
  const int FLG_CTRL_WINDOW = 1048576;
  
  const int FLG_CTRL_ROI = 2097152;
  
  const int FLG_CTRL_D22 = 4194304;
  
  const int FLG_CTRL_D23 = 8388608;
  
  const int FLG_PU_BRIGHTNESS = 2147483649;
  
  const int FLG_PU_CONTRAST = 2147483650;
  
  const int FLG_PU_HUE = 2147483652;
  
  const int FLG_PU_SATURATION = 2147483656;
  
  const int FLG_PU_SHARPNESS = 2147483664;
  
  const int FLG_PU_GAMMA = 2147483680;
  
  const int FLG_PU_WB_TEMP = 2147483712;
  
  const int FLG_PU_WB_COMPO = 2147483776;
  
  const int FLG_PU_BACKLIGHT = 2147483904;
  
  const int FLG_PU_GAIN = 2147484160;
  
  const int FLG_PU_POWER_LF = 2147484672;
  
  const int FLG_PU_HUE_AUTO = 2147485696;
  
  const int FLG_PU_WB_TEMP_AUTO = 2147487744;
  
  const int FLG_PU_WB_COMPO_AUTO = 2147491840;
  
  const int FLG_PU_DIGITAL_MULT = 2147500032;
  
  const int FLG_PU_DIGITAL_LIMIT = 2147516416;
  
  const int FLG_PU_AVIDEO_STD = 2147549184;
  
  const int FLG_PU_AVIDEO_LOCK = 2147614720;
  
  const int FLG_PU_CONTRAST_AUTO = 2147745792;
  
  const int FLG_PU_D19 = 2148007936;
  
  const int FLG_PU_D20 = 2148532224;
  
  const int FLG_PU_D21 = 2149580800;
  
  const int FLG_PU_D22 = 2151677952;
  
  const int FLG_PU_D23 = 2155872256;
  
  const int FRAME_TYPE_UNKNOWN = 0;
  
  const int FRAME_TYPE_UNCOMPRESSED = 5;
  
  const int FRAME_TYPE_UNCOMPRESSED_YUYV = 65541;
  
  const int FRAME_TYPE_UNCOMPRESSED_UYVY = 131077;
  
  const int FRAME_TYPE_UNCOMPRESSED_GRAY8 = 196613;
  
  const int FRAME_TYPE_UNCOMPRESSED_BY8 = 262149;
  
  const int FRAME_TYPE_UNCOMPRESSED_NV21 = 327685;
  
  const int FRAME_TYPE_UNCOMPRESSED_YV12 = 393221;
  
  const int FRAME_TYPE_UNCOMPRESSED_I420 = 458757;
  
  const int FRAME_TYPE_UNCOMPRESSED_Y16 = 524293;
  
  const int FRAME_TYPE_UNCOMPRESSED_RGBP = 589829;
  
  const int FRAME_TYPE_UNCOMPRESSED_NV12 = 720901;
  
  const int FRAME_TYPE_UNCOMPRESSED_YCbCr = 786437;
  
  const int FRAME_TYPE_UNCOMPRESSED_RGB565 = 851973;
  
  const int FRAME_TYPE_UNCOMPRESSED_RGB = 917509;
  
  const int FRAME_TYPE_UNCOMPRESSED_BGR = 983045;
  
  const int FRAME_TYPE_UNCOMPRESSED_RGBX = 1048581;
  
  const int FRAME_TYPE_UNCOMPRESSED_444p = 1114117;
  
  const int FRAME_TYPE_UNCOMPRESSED_444sp = 1179653;
  
  const int FRAME_TYPE_UNCOMPRESSED_422p = 1245189;
  
  const int FRAME_TYPE_UNCOMPRESSED_422sp = 1310725;
  
  const int FRAME_TYPE_UNCOMPRESSED_440p = 1376261;
  
  const int FRAME_TYPE_UNCOMPRESSED_440sp = 1441797;
  
  const int FRAME_TYPE_UNCOMPRESSED_411p = 1507333;
  
  const int FRAME_TYPE_UNCOMPRESSED_411sp = 1572869;
  
  const int FRAME_TYPE_UNCOMPRESSED_YUV_ANY = 1638405;
  
  const int FRAME_TYPE_UNCOMPRESSED_XRGB = 1703941;
  
  const int FRAME_TYPE_UNCOMPRESSED_XBGR = 1769477;
  
  const int FRAME_TYPE_UNCOMPRESSED_BGRX = 1835013;
  
  const int FRAME_TYPE_MJPEG = 7;
  
  const int FRAME_TYPE_FRAME_BASED = 17;
  
  const int FRAME_TYPE_MPEG2TS = 65553;
  
  const int FRAME_TYPE_DV = 131089;
  
  const int FRAME_TYPE_FRAME_H264 = 196625;
  
  const int FRAME_TYPE_FRAME_VP8 = 262161;
  
  const int FRAME_TYPE_H264 = 20;
  
  const int FRAME_TYPE_H264_SIMULCAST = 65556;
  
  const int FRAME_TYPE_VP8 = 23;
  
  const int FRAME_TYPE_VP8_SIMULCAST = 65559;
  
  const int FRAME_TYPE_H265 = 25;
  