mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-09-11 02:23:42 +08:00
6adb63b915
date: 2026-06-04T09:49:56 master commit: c0ab3550eca2e9daf197c46b7e4b24aa9637cf2e
29 lines
711 B
C++
29 lines
711 B
C++
#pragma once
|
|
|
|
#include <set>
|
|
#include <string>
|
|
|
|
#include "msgq/ipc.h"
|
|
#include "msgq/visionipc/visionbuf.h"
|
|
|
|
|
|
class VisionIpcClient {
|
|
private:
|
|
std::string name;
|
|
Context * msg_ctx;
|
|
SubSocket * sock;
|
|
Poller * poller;
|
|
|
|
public:
|
|
bool connected = false;
|
|
VisionStreamType type;
|
|
int num_buffers = 0;
|
|
VisionBuf buffers[VISIONIPC_MAX_FDS];
|
|
VisionIpcClient(std::string name, VisionStreamType type, bool conflate);
|
|
~VisionIpcClient();
|
|
VisionBuf * recv(VisionIpcBufExtra * extra=nullptr, const int timeout_ms=100);
|
|
bool connect(bool blocking=true);
|
|
bool is_connected() { return connected; }
|
|
static std::set<VisionStreamType> getAvailableStreams(const std::string &name, bool blocking = true);
|
|
};
|