mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-27 02:43:48 +02:00
Add VideoSampleColorSpace
This commit is contained in:
@@ -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();
|
||||
});
|
||||
Reference in New Issue
Block a user