mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-11-10 14:33:42 +08:00
22a8575199
Keep official openpilot ancestry and dependency licenses. Store resources directly in Git, remove LFS setup requirements, and leave the downloadable big model outside the source tree.
53 lines
1.5 KiB
Cython
53 lines
1.5 KiB
Cython
# distutils: language = c++
|
|
#cython: language_level=3
|
|
|
|
from libcpp.string cimport string
|
|
from libcpp.vector cimport vector
|
|
from libcpp.set cimport set
|
|
from libc.stdint cimport uint32_t, uint64_t
|
|
from libcpp cimport bool, int
|
|
|
|
cdef extern from "msgq/visionipc/visionbuf.h":
|
|
ctypedef uint32_t VisionStreamType "VisionStreamType"
|
|
|
|
cdef cppclass VisionBuf:
|
|
void * addr
|
|
int fd
|
|
size_t len
|
|
size_t width
|
|
size_t height
|
|
size_t stride
|
|
size_t uv_offset
|
|
size_t idx
|
|
void set_frame_id(uint64_t id)
|
|
uint64_t get_frame_id()
|
|
|
|
cdef extern from "msgq/visionipc/visionipc.h":
|
|
struct VisionIpcBufExtra:
|
|
uint32_t frame_id
|
|
uint64_t timestamp_sof
|
|
uint64_t timestamp_eof
|
|
bool valid
|
|
|
|
cdef extern from "msgq/visionipc/visionipc_server.h":
|
|
string get_endpoint_name(string, VisionStreamType)
|
|
|
|
cdef cppclass VisionIpcServer:
|
|
VisionIpcServer(string)
|
|
void create_buffers(VisionStreamType, size_t, size_t, size_t)
|
|
void create_buffers_with_sizes(VisionStreamType, size_t, size_t, size_t, size_t, size_t, size_t)
|
|
VisionBuf * get_buffer(VisionStreamType)
|
|
void send(VisionBuf *, VisionIpcBufExtra *, bool)
|
|
void start_listener()
|
|
|
|
cdef extern from "msgq/visionipc/visionipc_client.h":
|
|
cdef cppclass VisionIpcClient:
|
|
int num_buffers
|
|
VisionBuf buffers[1]
|
|
VisionIpcClient(string, VisionStreamType, bool)
|
|
VisionBuf * recv(VisionIpcBufExtra *, int) nogil
|
|
bool connect(bool)
|
|
bool is_connected()
|
|
@staticmethod
|
|
set[VisionStreamType] getAvailableStreams(string, bool)
|