• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

benrr101 / node-taglib-sharp / 48393127

29 Oct 2023 04:39AM UTC coverage: 92.535% (-1.4%) from 93.934%
48393127

push

appveyor

benrr101
Merge branch 'release/v5.2.0'

3244 of 4129 branches covered (0.0%)

Branch coverage included in aggregate %.

2177 of 2177 new or added lines in 61 files covered. (100.0%)

26728 of 28261 relevant lines covered (94.58%)

423.2 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

23.53
/src/mpeg4/boxes/isoVisualSampleEntry.ts
1
import IsoSampleEntry from "./isoSampleEntry";
1✔
2
import Mpeg4BoxHeader from "../mpeg4BoxHeader";
3
import {ByteVector, StringType} from "../../byteVector";
1✔
4
import {File} from "../../file";
5
import {IVideoCodec, MediaTypes} from "../../properties";
1✔
6

7
/**
8
 * This class extends {@link IsoSampleEntry} and implements {@link IVideoCodec} to provide an implementation of a
9
 * ISO/IEC 14496-12 VisualSampleEntry and support for reading MPEG-4 video properties.
10
 */
11
export default class IsoVisualSampleEntry extends IsoSampleEntry implements IVideoCodec {
1✔
12
    private _videoHeight: number;
13
    private _videoWidth: number;
14

15
    /**
16
     * Private constructor to force construction via static functions.
17
     */
18
    private constructor() {
19
        super();
×
20
    }
21

22
    /**
23
     * Initializes the instance using the box's header, and additional information read from the file.
24
     * @param header Header for the box.
25
     * @param file File to read additional information from.
26
     * @param handlerType Type of the handler for the box. Optional.
27
     */
28
    public static fromFile(header: Mpeg4BoxHeader, file: File, handlerType: ByteVector): IsoVisualSampleEntry {
29
        const instance = new IsoVisualSampleEntry();
×
30
        instance.initializeFromHeaderFileAndHandler(header, file, handlerType);
×
31

32
        const dataPositionBeforeIncrease = instance.increaseDataPosition(62);
×
33
        file.seek(dataPositionBeforeIncrease + 16);
×
34
        instance._videoWidth = file.readBlock(2).toUshort();
×
35
        instance._videoHeight = file.readBlock(2).toUshort();
×
36

37
        return instance;
×
38
    }
39

40
    /** @inheritDoc */
41
    public get durationMilliseconds(): number { return 0; }
×
42

43
    /** @inheritDoc */
44
    public get mediaTypes(): MediaTypes { return MediaTypes.Video; }
×
45

46
    /** @inheritDoc */
47
    // @TODO: I'm sure we can get a better description than this
48
    public get description(): string { return `MPEG-4 Video (${this.boxType.toString(StringType.Latin1)})`; }
×
49

50
    /** @inheritDoc */
51
    public get videoHeight(): number { return this._videoHeight };
×
52

53
    /** @inheritDoc */
54
    public get videoWidth(): number { return this._videoWidth; }
×
55
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc