Skip to content

Commit

Permalink
new hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyBurger committed Nov 14, 2024
1 parent e77dd71 commit 40b3fe7
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 7 deletions.
13 changes: 13 additions & 0 deletions packages/media-parser/src/create/iso-base-media/create-udta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {combineUint8Arrays} from '../../boxes/webm/make-header';
import {addSize, stringsToUint8Array} from './primitives';

export const createUdta = (children: Uint8Array) => {
return addSize(
combineUint8Arrays([
// type
stringsToUint8Array('udta'),
// children
children,
]),
);
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {combineUint8Arrays} from '../../boxes/webm/make-header';
import {addSize, stringsToUint8Array} from './primitives';
import {combineUint8Arrays} from '../../../boxes/webm/make-header';
import {addSize, stringsToUint8Array} from '../primitives';

export const createMeta = (hdlr: Uint8Array, ilst: Uint8Array) => {
return addSize(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {combineUint8Arrays} from '../../../boxes/webm/make-header';
import {combineUint8Arrays} from '../../../../boxes/webm/make-header';
import {
addSize,
numberTo32BitUIntOrInt,
stringsToUint8Array,
} from '../primitives';
} from '../../primitives';

export const createHdlr = (type: 'video' | 'audio' | 'mdir') => {
return addSize(
Expand Down
2 changes: 1 addition & 1 deletion packages/media-parser/src/test/hdlr.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {expect, test} from 'bun:test';
import {createHdlr} from '../create/iso-base-media/meta/create-hdlr';
import {createHdlr} from '../create/iso-base-media/udta/meta/create-hdlr';

const reference = new Uint8Array([
0x00, 0x00, 0x00, 0x2d, 0x68, 0x64, 0x6c, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00,
Expand Down
4 changes: 2 additions & 2 deletions packages/media-parser/src/test/meta.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {expect, test} from 'bun:test';
import {createIlst} from '../create/iso-base-media/create-ilst';
import {createMeta} from '../create/iso-base-media/create-meta';
import {createCmt} from '../create/iso-base-media/ilst/create-cmt';
import {createToo} from '../create/iso-base-media/ilst/create-too';
import {createHdlr} from '../create/iso-base-media/meta/create-hdlr';
import {createMeta} from '../create/iso-base-media/udta/create-meta';
import {createHdlr} from '../create/iso-base-media/udta/meta/create-hdlr';

test('meta atom', () => {
expect(
Expand Down

0 comments on commit 40b3fe7

Please sign in to comment.