anycodec_platform library
Platform-specific AnyCodec APIs.
The unified API in package:anycodec/anycodec.dart is identical everywhere.
This library is for the things that are not: the loaded native library and
its thread-local error channel on native, and WebCodecs capability probing on
the web. The two sets are chosen by conditional export, so dart:ffi never
leaks into a web build and dart:js_interop never leaks into a native one.
- native (
io):NativeLibraryInfo,LastNativeError,nativePassthroughCodecId,nativeAssetId. - web:
WebCodecs,WebCodecsSupport,WebCodecsConfigSupport,webCodecStringFor,webPixelFormatFor. - all platforms: the report types, re-exported here so a caller that only needs CodecPath or HardwareDevice does not have to import both libraries: Backend, BackendPreference, Codec, CodecCapability, CodecDirection, CodecPath, HardwareDevice, HardwareDeviceCodec, Implementation.
The platform-specific names above are in backticks rather than [], and that
is deliberate. Each of them exists in only one of the conditionally exported
libraries, so from this platform-neutral barrel dartdoc cannot resolve a link
to any of them and emits unresolved doc reference for all nine — a real
deduction on the pub.dev score. The names that exist on every platform keep
their links.
Classes
- BackendCapability
- What one backend reports about one codec.
- CodecCapability
- What is available for one codec in one direction.
- CodecPath
- Exactly how one live encoder or decoder is doing its work.
- DecoderConfig
- Everything needed to start a decoder.
- EncoderConfig
- Everything needed to start an encoder.
- HardwareDevice
-
A hardware media engine found by
anycodec_probe_devices. - HardwareDeviceCodec
- One codec a hardware engine supports.
Enums
- AnyCodecErrorKind
- The classification attached to an AnyCodecException.
- Backend
- Which subsystem performed (or could perform) the work.
- BackendPreference
- Which backends a caller is willing to accept.
- ChannelLayout
- Speaker arrangement of an audio frame.
- Codec
- Every codec AnyCodec routes.
- CodecDirection
- Whether a codec is being used to compress or to decompress.
- Implementation
- Whether the work was done by a platform framework or by a software codec.
- MediaKind
- Whether a codec compresses pictures or sound.
- PixelFormat
- How the samples of a raw picture are arranged.
- Preset
- A speed/size trade-off hint for an encoder.
- SampleFormat
- How the samples of a raw audio frame are encoded.
Exceptions / Errors
- AnyCodecException
- The exception every failing AnyCodec operation throws.