MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / get

Method get

lightx2v/utils/va_reader_omni.py:56–73  ·  view source on GitHub ↗
(self, size=1024)

Source from the content-addressed store, hash-verified

54 self.current_size += len(byte_data)
55
56 def get(self, size=1024):
57 data = bytearray()
58
59 while size > 0 and len(self.buffer) > 0:
60 chunk = self.buffer.popleft()
61 if len(chunk) <= size:
62 # 如果当前数据小于size,则将当前数据全部添加到data中
63 data.extend(chunk)
64 self.current_size -= len(chunk)
65 size -= len(chunk)
66 else:
67 # 如果当前数据大于size,则将当前数据的一部分添加到data中,剩余部分留在缓冲区
68 data.extend(chunk[:size])
69 self.buffer.appendleft(chunk[size:]) # 剩余部分留在缓冲区
70 self.current_size -= size
71 size = 0
72
73 return bytes(data)
74
75 def mark_finished(self):
76 self.audio_finished = True

Callers 15

from_configMethod · 0.45
auto_calc_configFunction · 0.45
set_parallel_configFunction · 0.45
video_workerMethod · 0.45
find_torch_model_pathFunction · 0.45
validate_config_pathsFunction · 0.45
__init__Method · 0.45
__init__Method · 0.45
launch_chat_serverMethod · 0.45
get_audioMethod · 0.45
va_reader_omni.pyFile · 0.45
check_config_valueFunction · 0.45

Calls 1

extendMethod · 0.45

Tested by

no test coverage detected