@yume-chan/scrcpy-decoder-webcodecs
Version:
Raw H.264 stream decoder and renderer using WebCodecs API (requires modern browser).
38 lines (32 loc) • 898 B
text/typescript
export class Pool<T> {
{
start: (controller) => {
this.
},
pull: (controller) => {
controller.enqueue(this.
},
},
{ highWaterMark: 0 },
);
constructor(initializer: () => T, capacity: number) {
this.
this.
}
async borrow() {
const result = await this.
return result.value!;
}
return(value: T) {
if (this.
this.
this.
}
}
}