Add VideoSampleColorSpace

This commit is contained in:
Vanilagy
2025-12-16 18:47:50 +01:00
parent ea9ba96ae3
commit 228721d68f
3 changed files with 66 additions and 4 deletions
+27
View File
@@ -0,0 +1,27 @@
import { test } from 'vitest';
import { AudioSample, VideoSample } from '../../src/sample.js';
test('VideoSample creation from bytes', async () => {
const bytes = new Uint8Array(1024);
const sample = new VideoSample(bytes, {
codedWidth: 1280,
codedHeight: 720,
format: 'RGBA',
timestamp: 0,
});
sample.close();
});
test('AudioSample creation from bytes', async () => {
const bytes = new Uint8Array(1024);
const sample = new AudioSample({
data: bytes,
numberOfChannels: 2,
format: 's16',
sampleRate: 48000,
timestamp: 0,
});
sample.close();
});