PrismCore / API reference / Diagnostics
Structure
SessionDiagnosticReport
struct SessionDiagnosticReportDeclared in Sources/PrismCore/Diagnostics/SessionDiagnosticReport.swift · PrismCore 3.5.4
Everything the engine knows about one playback, as one value a host can attach to a bug report: which build, what the source turned out to be, where it was routed and why, where startup spent its time, and what the running session ran into.
It exists because all of that was already known, but in a dozen places and in no serializable shape, so every field report started with the same round of questions (which build, which container, planned or sequential, how many repairs) the engine could have answered itself.
Take one with PrismCoreSession.diagnosticReport(), or, for a source that never got a session (declined, or routed to the software path), with PrismCoreEngine.diagnosticReport(for:decision:). jsonData() is the shape to paste.
The JSON is a contract. schemaVersion names it; fields are only ever added, never renamed or repurposed, so a reader written against version 1 keeps reading every later report.
Nothing secret leaves in it — see Redaction for what is withheld: HTTP headers, the URL's query, fragment and credentials, and every path on this device's disk. Only values the engine actually holds are reported; anything it did not measure is absent rather than guessed.
Initializers
Instance properties
var decision: Decision?The routing verdict. nil only when the source was never described (a session reporting before its remux opened anything).
var options: Options?What the session was built with. nil for a report taken from a probe alone, where no session existed to have options.
Instance methods
func jsonData() throws -> DataPretty-printed with sorted keys, so two reports diff line by line and the same report always prints the same bytes.
Never throws for want of a finite number: a non-finite double (a frame rate libavformat could not work out, say) is written as the string "nan"/"inf"/"-inf", because a "copy diagnostics" button that fails on the very source it is meant to describe is no button.
Type properties
static let currentSchemaVersion: IntThe schema this build writes. Bumped only for an additive change a reader might want to detect; never for a breaking one, which this schema does not make.
Structure
SessionDiagnosticReport.Decision
struct DecisionNo documentation comment in the source.
Instance properties
Structure
SessionDiagnosticReport.Engine
struct EngineWhich build answered. FFmpegBuild.configuration is deliberately not here: the configure line carries the build machine's paths.
Instance properties
var mismatchedLibraries: [String]Names of the libraries whose major version disagrees with the headers this build saw. Empty on a sane install.
Structure
SessionDiagnosticReport.Engine.Capabilities
struct CapabilitiesFFmpegBuild.Capabilities, field for field.
Instance properties
Structure
SessionDiagnosticReport.Engine.Library
struct LibraryNo documentation comment in the source.
Instance properties
Structure
SessionDiagnosticReport.Failure
struct FailureA failure, classified the way a host branches on it (PrismCoreError).
Instance properties
var description: StringThe error's description, with every secret the report knows of cut out of it (see Redaction).
Structure
SessionDiagnosticReport.Options
struct OptionsPrismCoreSession.Options without anything that names a place: keyframeIndexCacheDirectory is reduced to whether it is set, the headers to the count in Source, external subtitles to a count.
Instance properties
var keyframeIndexCacheEnabled: BoolNo documentation comment in the source.
var preferredAudioLanguage: String?No documentation comment in the source.
var preferredSubtitleLanguage: String?No documentation comment in the source.
Structure
SessionDiagnosticReport.Options.Display
struct DisplayNo documentation comment in the source.
Instance properties
Structure
SessionDiagnosticReport.Runtime
struct RuntimeNo documentation comment in the source.
Instance properties
var playbackEvents: [Event]The newest PlaybackEvents, oldest first, kept whether or not a host registered for them.
var timestampRepairs: TimestampRepairs?No documentation comment in the source.
var audioRenditionProductions: [AudioRendition]No documentation comment in the source.
var audioRenditionSummary: String?AudioRenditionProduction.summary, the line a host logs. nil before the master is written and in the muxed shape.
var dolbyVisionConversion: DolbyVisionConversion?No documentation comment in the source.
var pendingAudioDelaySeconds: Double?No documentation comment in the source.
Structure
SessionDiagnosticReport.Runtime.AudioRendition
struct AudioRenditionNo documentation comment in the source.
Instance properties
Structure
SessionDiagnosticReport.Runtime.DolbyVisionConversion
struct DolbyVisionConversionNo documentation comment in the source.
Instance properties
var droppedEnhancementLayerNALs: IntNo documentation comment in the source.
var staleUnconvertedPackets: IntNo documentation comment in the source.
Structure
SessionDiagnosticReport.Runtime.Event
struct EventNo documentation comment in the source.
Instance properties
var atSeconds: Double?Since start(), negative for an event from before it; nil while the session has not been started.
Structure
SessionDiagnosticReport.Runtime.ObjectAudio
struct ObjectAudioNo documentation comment in the source.
Instance properties
Structure
SessionDiagnosticReport.Runtime.Retention
struct RetentionNo documentation comment in the source.
Instance properties
var evictedSegments: IntSegments evicted to stay inside it, over the whole session.
Structure
SessionDiagnosticReport.Runtime.TimestampRepairs
struct TimestampRepairsNo documentation comment in the source.
Instance properties
Structure
SessionDiagnosticReport.Source
struct SourceNo documentation comment in the source.
Instance properties
var url: String?The remote URL without credentials, query or fragment — the places servers put tokens. nil for a local file, and for a URL that could not be taken apart (withheld rather than risked).
var fileName: String?A local file's name, without its directory. The directory is this device's layout (a user name, a mount point) and says nothing about the media; the name is what a reporter recognises.
var httpHeaderCount: IntHow many request headers the host supplied. Their names and values are never exported.
var byteSize: Int64?The transport's length for the source, when the probe measured it.
Structure
SessionDiagnosticReport.Startup
struct StartupNo documentation comment in the source.
Instance properties
var checkpoints: [Checkpoint]The stages start() reached, in order — recorded whether or not the host registered for startupCheckpoints(). A startup that failed ends wherever it got to, which is the point.
var plan: Plan?The plan start() built, used or not (a uniform plan runs sequential). nil without one (no duration, no demand mode).
var probeTiming: ProbeTiming?The routing probe's phases, for a session built from a ProbedSource (or a report taken from one).
Structure
SessionDiagnosticReport.Startup.Checkpoint
struct CheckpointNo documentation comment in the source.
Instance properties
var phase: StringsourceOpened, streamInfoResolved, segmentPlanReady, firstVideoSegmentWritten or playlistServable.
Structure
SessionDiagnosticReport.Startup.Plan
struct PlanThe plan's shape — what a stall report needs to tell "the planner promised one segment for the rest of the film" from a slow origin.
Instance properties
var basis: StringkeyframeIndex, uniform.budgetExpired, uniform.untrustedIndex or uniform.noIndex.
var maxSegmentSeconds: DoubleThe built plan's longest entry — the playlist's largest EXTINF only when the plan was published (keyframeIndex); a uniform plan runs sequential and cuts at real keyframes.
var tailStartSeconds: DoubleThe last entry, which runs to the container's end.
var indexCoversEnd: Bool?Whether the keyframe map reached the source's end at its own cadence (the strict test); nil with no keyframes at all. A whole index ending on a long final GOP can plan with false.
var indexBudgetExpired: BoolWhether the index-load seek ran out of its budget.
Structure
SessionDiagnosticReport.Startup.ProbeTiming
struct ProbeTimingNo documentation comment in the source.
Instance properties
Generated from the public symbols of PrismCore 3.5.4. All types