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

benrr101 / node-taglib-sharp / 51054818

25 Nov 2024 06:32PM UTC coverage: 92.556% (-0.02%) from 92.578%
51054818

push

appveyor

benrr101
Merge branch 'release/v6.0.0'

3251 of 4131 branches covered (78.7%)

Branch coverage included in aggregate %.

580 of 599 new or added lines in 27 files covered. (96.83%)

4 existing lines in 4 files now uncovered.

26752 of 28285 relevant lines covered (94.58%)

471.65 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 */
NEW
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