# Changelog

## [Unreleased]

## [0.1.0] - 2026-11-28

First release. Needs mob_dev 0.7.33 or later in the host app (`cpp_archive`
`isolate_symbols`, and the iOS link check that accepts mob_audio_io's C
interface).

- `MobWebrtc`: peer connections on top of `ex_webrtc`, one API on iOS,
  Android and the host. Events reach the owner as `{:mob_webrtc, peer, event}`;
  descriptions and ICE candidates are JSON-shaped maps, the shapes a
  browser's `RTCPeerConnection` uses. `{:ice_gathering_state, state}` and
  `MobWebrtc.local_description/1` support signaling without trickle.
- `ex_dtls` and `ex_libsrtp` are statically linked as `cpp_archive` NIFs
  (`mob_webrtc_dtls`, `mob_webrtc_srtp`) against a prebuilt libssl / libsrtp2 /
  libopus bundle (0.2.0, a GitHub release asset pinned by SHA-256 in the
  manifest) and the OTP runtime's libcrypto.
- One DTLS key and certificate per app (`MobWebrtc.KeyCert`), made at start,
  instead of an RSA-2048 key per peer.
- Data channels: `MobWebrtc.create_data_channel/3` (ordered and reliable
  unless asked otherwise) and `send_data/4`, with owner events
  `{:data_channel, %{ref: ref, label: label}}` (a channel the remote side
  opened), `{:data_channel_state, ref, state}` and `{:data, ref, binary}`.
  `send_data/4` answers `{:error, :not_open}`, `{:error, :unknown_channel}`
  or `{:error, :too_large}` (over 65,536 bytes) where ex_webrtc would drop the
  message or crash. Every peer needs `ex_sctp`, linked as a static NIF the
  host enables in `mob.exs` (see the README).
- `MobWebrtc.Audio`: Opus audio between a `mob_audio_io` stream and RTP
  (`mob_webrtc_audio_nif`, one C file for iOS and Android). The microphone
  (`:mic_preset`, default `:voice`) or a test tone is encoded natively and
  sent; received RTP is decoded into a playout buffer whose target follows
  the measured arrival jitter (its spread over the last 30 s plus 10 ms,
  20–200 ms, not below 60 ms for the first 30 s), draining excess depth
  with a 2 ms crossfade. `set_muted/2` sends Opus silence frames with
  continuous timestamps, so unmuting is instant. `stats/1` reads back packet
  and frame counts, underruns, playout depth and target, jitter, and the
  level and dominant frequency of the audio received.
- H264 decode into the `MobWebrtc.VideoView` native view: VideoToolbox into
  an `AVSampleBufferDisplayLayer` on iOS, `MediaCodec` into a `SurfaceView`
  on Android, aspect-fit, with frames before an IDR or after a decode error
  dropped, counted and flagged `needs_keyframe`
  (`:mob_webrtc_video_nif.video_stats/1`).
- `MobWebrtc.status/0` readback, `MobWebrtc.SelfTest` (`mix mob.selftest`),
  and `MobWebrtc.Engine.Fake` for host tests.
