PrismCore / API reference / Software playback

Structure

SoftwareDecoderAvailability

struct SoftwareDecoderAvailability

Declared in Sources/PrismCore/Software/SoftwareDecoderAvailability.swift · PrismCore 3.5.4

What the linked FFmpeg can decode on the software path.

Phase 7 exists for codecs AVPlayer's HLS-fMP4 pipeline refuses, so the first question any routing decision asks is "does this build even have a decoder for it". That answer belongs to the binary, not to a table in our source: PrismCore links MPVKit's FFmpeg, Aether links its own MPVKit fork, and a configure flag either side of that line changes the answer. Hardcoding a codec list is how a router ends up promising a decode that fails at open.

So this is a runtime read of avcodec_find_decoder plus avcodec_get_hw_config, over the codec set phase 7 cares about. It is also what the availability test prints, which is the only honest way to document "what MPVKit ships" in a repo that doesn't own the FFmpeg build.

Hardware note: several of these codecs (VP9, MPEG-2, MPEG-4 ASP, H.264, HEVC) carry a videotoolbox hwaccel config in MPVKit's build, so "software path" is a routing name, not a promise about where the decode happens — SoftwareVideoDecoder takes the VideoToolbox route when it exists (see its docs) and only falls back to CPU decoding.

Instance properties

let entries: [Entry]

No documentation comment in the source.

var summary: String { get }

One line per codec, for logs and for the availability test's output — the artefact that documents the FFmpeg build we actually got.

Instance methods

func entry(for codecName: String) -> Entry?

No documentation comment in the source.

func isAvailable(_ codecName: String) -> Bool

No documentation comment in the source.

Type methods

static func report() -> SoftwareDecoderAvailability

Read the linked FFmpeg. Cheap (a table lookup per codec) and total — it opens nothing.

Structure

SoftwareDecoderAvailability.Entry

struct Entry

No documentation comment in the source.

Instance properties

let codecName: String

FFmpeg's canonical codec name ("vp9", "mpeg2video", "vorbis").

let mediaType: MediaType

No documentation comment in the source.

let decoderName: String?

The decoder avcodec_find_decoder picks, or nil when this build has none. Not always the codec name: AV1 resolves to libdav1d.

let supportsVideoToolbox: Bool

Whether that decoder advertises a VideoToolbox hwaccel config, i.e. whether SoftwareVideoDecoder can hand it to the GPU and get CVPixelBuffers back without a pixel copy.

var isAvailable: Bool { get }

No documentation comment in the source.

Enumeration

SoftwareDecoderAvailability.MediaType

enum MediaType

No documentation comment in the source.

Cases

case video

No documentation comment in the source.

case audio

No documentation comment in the source.

Generated from the public symbols of PrismCore 3.5.4. All types