mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-10-02 05:13:50 +02:00
Automatically close new VideoFrames created by toCanvasImageSource, reduce clones in mediaSamplesAtTimestamps
This commit is contained in:
+15
-5
@@ -60,7 +60,16 @@
|
||||
6.933333333333334,
|
||||
7.039999999999999,
|
||||
7.1466666666666665,
|
||||
7.253333333333333
|
||||
7.253333333333333,
|
||||
7.253333333333333,
|
||||
7.253333333333333,
|
||||
7.253333333333333,
|
||||
7.253333333333333,
|
||||
7.253333333333333,
|
||||
7.253333333333333,
|
||||
7.253333333333333,
|
||||
7.253333333333333,
|
||||
7.253333333333333,
|
||||
];
|
||||
|
||||
console.log(timestamps);
|
||||
@@ -88,21 +97,22 @@
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
|
||||
|
||||
|
||||
for (let i = 0; i < 1000; i++) {
|
||||
for (let i = 0; i < 40; i++) {
|
||||
const count = Math.floor(50 * Math.random());
|
||||
const timestamps = Array.from({ length: count }, () => Math.random() * 20).sort((a, b) => a-b);
|
||||
|
||||
for await (const wrappedCanvas of sink.canvasesAtTimestamps(timestamps)) {
|
||||
for await (const wrappedCanvas of sink.samplesAtTimestamps(timestamps)) {
|
||||
//console.log(wrappedCanvas);
|
||||
wrappedCanvas.close()
|
||||
}
|
||||
console.log("don")
|
||||
}
|
||||
|
||||
console.log("DONE!")
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user