mirror of
https://github.com/yume-chan/ya-webadb.git
synced 2025-10-04 02:09:18 +02:00
refactor(stream): move streams to new package
This commit is contained in:
parent
ce8f062e96
commit
6887d8549f
87 changed files with 985 additions and 811 deletions
|
@ -1,6 +1,7 @@
|
|||
import Struct from "@yume-chan/struct";
|
||||
import { BufferedStream } from '@yume-chan/stream-extra';
|
||||
import Struct from '@yume-chan/struct';
|
||||
|
||||
import type { Adb } from '../adb.js';
|
||||
import { AdbBufferedStream } from '../stream/index.js';
|
||||
|
||||
const Version =
|
||||
new Struct({ littleEndian: true })
|
||||
|
@ -60,7 +61,7 @@ export type AdbFrameBuffer = AdbFrameBufferV1 | AdbFrameBufferV2;
|
|||
|
||||
export async function framebuffer(adb: Adb): Promise<AdbFrameBuffer> {
|
||||
const socket = await adb.createSocket('framebuffer:');
|
||||
const stream = new AdbBufferedStream(socket);
|
||||
const stream = new BufferedStream(socket.readable);
|
||||
const { version } = await Version.deserialize(stream);
|
||||
switch (version) {
|
||||
case 1:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue