Discover independent camera instances and prepare their versioned runtime from Node or remote Core. Add isolated SDK workers, camera controls, raw dual-fisheye WebRTC preview, and shared action/region loading states. Recover existing Node bindings over known Tailscale addresses after a Core LAN address change. Preserve identities and trust, pin both peers, migrate endpoints with revision checks, and require real heartbeats for online status. Fix the Python client certificate profile for Go X509 verification. Pin Design Guideline 8c53f73 and retain installer/build/acceptance history. Node 0.8.19 is installed; X4 0.1.3-3 is bundled but hardware activation is pending. Validation: qualified DG/Node builds and Go race tests; 31 fleet tests; Python-to-Go certificate interoperability and live tailnet recovery with five fresh heartbeats; prior 38 X4 tests and bounded remote WebRTC acceptance. Clean-OS, replug/power autonomy, local X4 video and long-run stability remain open.
45 lines
1.5 KiB
C
45 lines
1.5 KiB
C
#pragma once
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
#if defined(__GNUC__)
|
|
#define MC_X4_API __attribute__((visibility("default")))
|
|
#else
|
|
#define MC_X4_API
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
// Private ABI v1. One handle in each physically isolated camera worker. The
|
|
// caller must restrict USB access BEFORE loading this library or discovering.
|
|
typedef struct mc_x4 mc_x4;
|
|
enum mc_x4_action {
|
|
MC_X4_STATUS = 1, MC_X4_SETTINGS_READ = 2, MC_X4_SETTINGS_APPLY = 3,
|
|
MC_X4_PREVIEW_START = 4, MC_X4_PREVIEW_STOP = 5,
|
|
MC_X4_RECORD_START = 6, MC_X4_RECORD_STOP = 7, MC_X4_PHOTO = 8,
|
|
MC_X4_FILES = 9
|
|
};
|
|
typedef struct mc_x4_video {
|
|
uint64_t sequence;
|
|
uint64_t generation; // changes on queue overflow / preview restart
|
|
int64_t timestamp; // camera clock; units are not assumed by the bridge
|
|
int32_t stream_index;
|
|
int32_t codec; // 0 = H264, 1 = H265
|
|
uint32_t bytes;
|
|
} mc_x4_video;
|
|
|
|
MC_X4_API int mc_x4_abi(void);
|
|
MC_X4_API mc_x4* mc_x4_open(const char* expected_serial, const char* private_log_directory);
|
|
// JSON result owned by the handle; copy before the next call. Calls are
|
|
// serialized by the worker. No vendor exception or C++ object crosses the ABI.
|
|
MC_X4_API const char* mc_x4_call(mc_x4*, int action, int mode, const char* key, double value);
|
|
MC_X4_API int mc_x4_read_video(mc_x4*, mc_x4_video*, uint8_t* buffer, size_t capacity);
|
|
// Does not call StopRecording or change auto-stop-on-disconnect policy.
|
|
MC_X4_API void mc_x4_close(mc_x4*);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|