airtest.core.ios.mjpeg_cap module

class SocketBuffer(sock: socket)[源代码]

基类:SafeSocket

read_until(delimeter: bytes) bytes[源代码]

return without delimeter

read_bytes(length: int) bytes[源代码]
write(data: bytes)[源代码]
class MJpegcap(instruct_helper=None, ip='localhost', port=None, ori_function=None)[源代码]

基类:object

setup_stream_server()[源代码]
init_sock()[源代码]
get_frame_from_stream()[源代码]
get_frame()[源代码]
snapshot(ensure_orientation=True, *args, **kwargs)[源代码]

Take a screenshot and convert it into a cv2 image object

获取一张屏幕截图,并转化成cv2的图像对象 !!! 注意,该方法拿到的截图可能不是队列中最新的,除非一直在消费队列中的图像,否则可能会是过往图像内容,请谨慎使用

参数:

ensure_orientation – True or False whether to keep the orientation same as display

Returns: numpy.ndarray

get_blank_screen()[源代码]

生成一个黑屏图像,在连接失效时代替屏幕画面返回 Returns:

teardown_stream()[源代码]