Source final class
Minn\Media\Av\Source · public/minn/src/Minn/Media/Av/Source.php · 71 lines
A media file read in parts, so a large video is never loaded whole: its size, a run of bytes at an offset, and the integers the containers write. The file's first block is kept, since every reader starts there.
Constants and properties
| private | HEAD = 262144 | |
| private | string $head | |
| private | mixed $handle | Promoted from the constructor. |
| prop | readonly int $size | Promoted from the constructor. |
| prop | readonly string $path | Promoted from the constructor. |
Public
| new | __construct($handle, int $size, string $path)# |
| |||
| static | open(string $path): ?self# | The file opened for reading, or null when it cannot be. | |||
| method | bytes(int $offset, int $length): string# | Up to $length bytes from $offset (fewer at the end of the file). | |||
| method | bigEndian(int $offset, int $width): int# | A big-endian unsigned integer of $width bytes (1 to 8) at $offset; 0 past the end. | |||
| method | littleEndian(int $offset, int $width): int# | A little-endian unsigned integer of $width bytes (1 to 8) at $offset; 0 past the end. | |||
| static | bigEndianValue(string $bytes): int# | The unsigned integer a run of bytes spells, most significant first. | |||
| static | littleEndianValue(string $bytes): int# | The unsigned integer a run of bytes spells, least significant first. | |||
| method | close(): void# | The file let go. |
Nothing matches.