Commit Graph

30 Commits

Author SHA1 Message Date
Steve Potter 23838718b3 Fix compilation error 2026-03-25 13:01:24 -04:00
William Porter ea4d6b20a6 Serialize mixer output frame ordering via AsyncStream.
Replace unstructured Task {} in MediaMixerOutput and StreamOutput
conformances with AsyncStream channels that preserve FIFO ordering.

The previous pattern created a new Task for each audio/video callback,
which provides no ordering guarantee when entering an actor's serial
executor. This caused adjacent frames to arrive out of order, resulting
in RTMPTimestamp.invalidSequence errors (silent frame drops) and
AVAssetWriter failures in StreamRecorder.
2026-03-10 15:27:54 +10:00
shogo4405 30f31b466d Rename Session -> StreamSesison. (#1879) 2026-02-11 17:51:48 +09:00
shogo4405 e352610c3b Suppress warnings. 2025-11-24 20:48:15 +09:00
shogo4405 b718080c4a Made expectedFrameRate optional. (#1841) 2025-11-24 20:43:05 +09:00
shogo4405 3c234d20e5 Rename #1832 2025-11-21 23:30:18 +09:00
Tabber (인병윤) b119b56969 Add framerate to RTMP onMetaData (#1832)
* feat: Add framerate to RTMP onMetaData

Adds framerate field to RTMP onMetaData for RTMP servers like
nginx-rtmp-module to correctly parse stream frame rate statistics.

The framerate value is synchronized from VideoCodec.expectedFrameRate
when MediaMixer.setFrameRate() is called.

* feat: Move expectedFrameRate to VideoCodecSettings and add framerate to RTMP metadata

- Move expectedFrameRate from VideoCodec to VideoCodecSettings
- Remove setExpectedFrameRate() method from OutgoingStream and StreamConvertible
- Add framerate field to RTMP onMetaData message
- Synchronize expectedFrameRate in MediaMixer.setFrameRate() and addOutput()
- Add helper methods for frame rate synchronization
- Make MediaMixer.defaultFrameRate public

* feat: Rename expectedFrameRate to defaultFrameRate and add framerate to RTMP metadata

- Rename VideoCodecSettings.expectedFrameRate to defaultFrameRate to represent
  a different concept from MediaMixer.frameRate
- Remove synchronization code from MediaMixer.setFrameRate() and addOutput()
  to allow independent frame rate management per stream
- Remove VideoCodec.expectedFrameRate and OutgoingStream.expectedFrameRate properties
- Add framerate field to RTMP onMetaData message for RTMP servers like
  nginx-rtmp-module to correctly parse stream frame rate statistics
- Make MediaMixer.defaultFrameRate public

This change allows each stream to have its own independent defaultFrameRate
(e.g., Service A at 30 FPS, Service B at 60 FPS) while MediaMixer can output
at a different frame rate. The defaultFrameRate is used both for VideoToolbox
encoder configuration and RTMP metadata.

Breaking changes:
- VideoCodecSettings.expectedFrameRate renamed to defaultFrameRate
- MediaMixer.addOutput() no longer synchronizes frame rate (streams must
  explicitly set defaultFrameRate via VideoCodecSettings init or setVideoSettings())
2025-11-21 23:17:23 +09:00
shogo4405 d762e480fa Support for rtmp url's query parameters 2025-09-28 16:58:03 +09:00
shogo4405 4245609541 Add SessionConfiguration protocols. 2025-09-20 00:05:17 +09:00
shogo4405 4d9010b05d fix Can't RTMP playback. 2025-09-18 22:23:51 +09:00
shogo4405 8cb6f309a6 fixed an issue where streaming could fail to start in FME compatibility mode 2025-09-07 02:29:26 +09:00
shogo4405 0b82c1aa62 Revise exception handling in RTMPStream layer. 2025-09-06 16:54:04 +09:00
shogo4405 b221ad95d8 Now conforms to Sendable. 2025-09-01 07:25:12 +09:00
shogo4405 87e14fd194 Add AudioCodecSettings.Format option. 2025-08-17 21:26:44 +09:00
shogo4405 0695e28a01 Redesign of the Session API. 2025-08-16 17:23:44 +09:00
shogo4405 4bc048d20a fix typo. 2025-08-12 01:02:46 +09:00
shogo4405 b2648e8577 Reviewed the error handling process of SRTConnection. 2025-08-11 20:46:26 +09:00
shogo4405 9b4ba3c815 Added comments. 2025-08-11 02:29:19 +09:00
shogo4405 eb40fd95a4 Revised the reconnection process for the Session API. 2025-08-10 19:19:54 +09:00
shogo4405 4ead9c398b Example SwiftUI. 2025-08-04 21:48:32 +09:00
shogo4405 006669f227 Review of inheritance relationships. 2025-08-01 17:15:41 +09:00
shogo4405 e9c562a0e8 Rename HKStream -> StreamConvertible. 2025-07-21 19:45:37 +09:00
shogo4405 99da260b56 Modified to allow retrieval of NWError. 2025-07-20 22:23:44 +09:00
shogo4405 c06bdc72af swiftlint --fix --format 2025-07-20 22:04:25 +09:00
shogo4405 cddf700377 make(uri: URL) -> make(_ uri: URL) 2025-07-20 21:03:23 +09:00
shogo4405 9573f4f224 Addition of constants. 2025-07-20 19:37:15 +09:00
shogo4405 814c9014b7 Add retry RTMPConneciton. 2025-07-20 18:50:33 +09:00
shogo4405 7741aee8d3 Modified to throw an error for unsupported codecs. 2025-07-15 00:08:37 +09:00
shogo4405 d8f6f243bc fix typo BitRateStorategy -> BitRateStrategy. 2025-07-13 18:44:41 +09:00
shogo4405 68c0d1cfc8 Repackage RTMPHaishinKit. 2025-07-13 12:43:53 +09:00