mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-27 02:43:48 +02:00
digest -> add
This commit is contained in:
+5
-5
@@ -33,7 +33,7 @@
|
||||
output.start();
|
||||
|
||||
for await (const { data } of sink.data()) {
|
||||
await mediaSource.digest(data);
|
||||
await mediaSource.add(data);
|
||||
}
|
||||
|
||||
await output.finalize();
|
||||
@@ -137,16 +137,16 @@
|
||||
// //sample.timestamp *= 2;
|
||||
// //console.log(sample);
|
||||
// //console.log(sample)
|
||||
// await sampleSource.digest(sample, { decoderConfig });
|
||||
// await sampleSource.add(sample, { decoderConfig });
|
||||
//}
|
||||
for await (const { data, timestamp } of new Metamuxer.AudioDataSink(audioTrack).data()) {
|
||||
//console.log("wow", data.timestamp);
|
||||
//console.log(sample)
|
||||
await audioDataSource.digest(data);
|
||||
await audioDataSource.add(data);
|
||||
}
|
||||
//for await (const sample of new Metamuxer.EncodedVideoSampleSink(videoTrack).samples()) {
|
||||
// //console.log(sample)
|
||||
// await videoSampleSource.digest(sample, { decoderConfig: videoDecoderConfig });
|
||||
// await videoSampleSource.add(sample, { decoderConfig: videoDecoderConfig });
|
||||
//}
|
||||
|
||||
await output.finalize();
|
||||
@@ -265,7 +265,7 @@
|
||||
output.start();
|
||||
|
||||
for await (const frame of drain.frames(0, 10)) {
|
||||
await mediaSource.digest(frame);
|
||||
await mediaSource.add(frame);
|
||||
frame.close();
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -69,7 +69,7 @@
|
||||
duration: 1e6 * 0.25,
|
||||
data: new Uint8Array(1024)
|
||||
});
|
||||
videoSource.digest(encodedVideoChunk, {
|
||||
videoSource.add(encodedVideoChunk, {
|
||||
decoderConfig: {
|
||||
codedWidth: 64,
|
||||
codedHeight: 64,
|
||||
@@ -155,14 +155,14 @@ Testing... <00:17.350>One... <00:18.125>Two...
|
||||
9. <b>justify (bottom, right)</b>.
|
||||
`;
|
||||
|
||||
//subtitleSource.digest(simpleWebvttFile);
|
||||
//subtitleSource.add(simpleWebvttFile);
|
||||
//subtitleSource.close();
|
||||
|
||||
for (let i = 0; i < 100; i++) {
|
||||
context.fillStyle = ['red', 'green', 'blue', 'yellow'][i % 4];
|
||||
context.fillRect(canvas.width * Math.random(), canvas.height * Math.random(), canvas.width * Math.random(), canvas.height * Math.random());
|
||||
|
||||
//await videoSource.digest(i / 10, 1 / 10);
|
||||
//await videoSource.add(i / 10, 1 / 10);
|
||||
}
|
||||
|
||||
let audioContext = new AudioContext();
|
||||
@@ -170,7 +170,7 @@ Testing... <00:17.350>One... <00:18.125>Two...
|
||||
let length = 10;
|
||||
let slicedAudioBuffer = sliceAudioBuffer(audioBuffer, length, audioContext);
|
||||
|
||||
await audioSource.digest(slicedAudioBuffer);
|
||||
await audioSource.add(slicedAudioBuffer);
|
||||
|
||||
await output.finalize();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user