Skip to content

Commit 6cd6fda

Browse files
authored
Merge pull request #527 from jamrial/srat
feat: add srat box
2 parents cc9388e + e7eebd3 commit 6cd6fda

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

entries/all-boxes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ export * from '#/boxes/sgpd';
9797
export * from '#/boxes/sidx';
9898
export * from '#/boxes/SmDm';
9999
export * from '#/boxes/smhd';
100+
export * from '#/boxes/srat';
100101
export * from '#/boxes/ssix';
101102
export * from '#/boxes/stco';
102103
export * from '#/boxes/stdp';

src/boxes/srat.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { FullBox } from '#/box';
2+
import type { MultiBufferStream } from '#/buffer';
3+
4+
export class sratBox extends FullBox {
5+
static override readonly fourcc = 'srat' as const;
6+
box_name = 'SamplingRateBox' as const;
7+
8+
sampling_rate: number;
9+
10+
parse(stream: MultiBufferStream) {
11+
this.parseFullHeader(stream);
12+
this.sampling_rate = stream.readUint32();
13+
}
14+
}

0 commit comments

Comments
 (0)