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

benrr101 / node-taglib-sharp / 48389652

28 Oct 2023 06:22PM UTC coverage: 92.443% (+0.5%) from 91.9%
48389652

push

appveyor

web-flow
MPEG4 Cleanup (#88)

* Round one

* Round 2

* Fixing up mpeg4box file

* Fix names of box types to match style

* Fix names of box types to match style

* Separate boxes into separate files ... not working yet.

* Decomposing handler type to a bytevector. This is clumsy but will be cleaned up shortly

* Moving rendering to a utility class. Fixes cyclic dependencies

* Adding stuff to index and moving things around to let tests run

* Fixing iso handler box that was broken

* Public fields to properties

* Removing redundant variable typing

* Removing redundant casts

* Removing child factory from isoAudioSampleEntry.ts

* Removing child factory from appleAnnotationBox.ts

* Removing child factory from appleItemListBox.ts and isoMetaBox.ts

* Removing child factory from isoSampleDescriptionBox.ts

* Removing child factory from isoSampleTableBox.ts and isoUserDataBox.ts

* Child factories have been outlawed

* Introduce a handler type class

* Simplify the mpeg4boxtype class

* handler types in a different class

* Rewrite the get* methods

* Some tests

* Single itunes tag tests

* Performer roles (bug fixed), genres

* 99% coverage of appletag

* Pretty much the last cleanup I want to do before another release cycle.

* Leaving a todo

* Ok two more tweaks

3250 of 4147 branches covered (0.0%)

Branch coverage included in aggregate %.

1763 of 1763 new or added lines in 39 files covered. (100.0%)

26757 of 28313 relevant lines covered (94.5%)

422.43 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 @see IsoSampleEntry and implements @see 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
    public static fromHeaderFileAndHandler(
23
        header: Mpeg4BoxHeader,
24
        file: File,
25
        handlerType: ByteVector
26
    ): IsoVisualSampleEntry {
27
        const instance = new IsoVisualSampleEntry();
×
28
        instance.initializeFromHeaderFileAndHandler(header, file, handlerType);
×
29

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

35
        return instance;
×
36
    }
37

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

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

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

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

51
    /** @inheritDoc */
52
    public get videoWidth(): number { return this._videoWidth; }
×
53
}
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

© 2026 Coveralls, Inc