werift 0.25.2 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -0
- package/THIRD_PARTY_LICENSES_LIBWEBRTC.txt +58 -0
- package/lib/common/src/asn1.d.ts +42 -0
- package/lib/common/src/asn1.js +163 -0
- package/lib/common/src/asn1.js.map +1 -0
- package/lib/common/src/binary.d.ts +1 -3
- package/lib/common/src/binary.js +8 -6
- package/lib/common/src/binary.js.map +1 -1
- package/lib/common/src/binaryData.js +2 -1
- package/lib/common/src/binaryData.js.map +1 -1
- package/lib/common/src/index.d.ts +6 -5
- package/lib/common/src/index.js +6 -5
- package/lib/common/src/index.js.map +1 -1
- package/lib/common/src/log.d.ts +12 -1
- package/lib/common/src/log.js +142 -12
- package/lib/common/src/log.js.map +1 -1
- package/lib/common/src/network.js.map +1 -1
- package/lib/common/src/queue.d.ts +41 -0
- package/lib/common/src/queue.js +146 -0
- package/lib/common/src/queue.js.map +1 -0
- package/lib/common/src/transport.d.ts +15 -2
- package/lib/common/src/transport.js +108 -19
- package/lib/common/src/transport.js.map +1 -1
- package/lib/dtls/src/cipher/create.js.map +1 -1
- package/lib/dtls/src/cipher/ec.js +8 -8
- package/lib/dtls/src/cipher/ec.js.map +1 -1
- package/lib/dtls/src/cipher/namedCurve.js +6 -7
- package/lib/dtls/src/cipher/namedCurve.js.map +1 -1
- package/lib/dtls/src/cipher/prf.d.ts +2 -2
- package/lib/dtls/src/cipher/prf.js +29 -8
- package/lib/dtls/src/cipher/prf.js.map +1 -1
- package/lib/dtls/src/cipher/suites/aead.d.ts +1 -1
- package/lib/dtls/src/context/certificate.d.ts +32 -0
- package/lib/dtls/src/context/certificate.js +54 -0
- package/lib/dtls/src/context/certificate.js.map +1 -0
- package/lib/dtls/src/context/cipher.d.ts +13 -7
- package/lib/dtls/src/context/cipher.js +58 -106
- package/lib/dtls/src/context/cipher.js.map +1 -1
- package/lib/dtls/src/context/dtls.js +4 -2
- package/lib/dtls/src/context/dtls.js.map +1 -1
- package/lib/dtls/src/context/transport.d.ts +4 -0
- package/lib/dtls/src/context/transport.js +16 -1
- package/lib/dtls/src/context/transport.js.map +1 -1
- package/lib/dtls/src/flight/client/flight1.js +2 -1
- package/lib/dtls/src/flight/client/flight1.js.map +1 -1
- package/lib/dtls/src/flight/client/flight5.js +4 -2
- package/lib/dtls/src/flight/client/flight5.js.map +1 -1
- package/lib/dtls/src/flight/flight.d.ts +1 -1
- package/lib/dtls/src/flight/flight.js +16 -5
- package/lib/dtls/src/flight/flight.js.map +1 -1
- package/lib/dtls/src/flight/server/flight2.js.map +1 -1
- package/lib/dtls/src/flight/server/flight4.d.ts +2 -1
- package/lib/dtls/src/flight/server/flight4.js +12 -4
- package/lib/dtls/src/flight/server/flight4.js.map +1 -1
- package/lib/dtls/src/flight/server/flight6.js +2 -1
- package/lib/dtls/src/flight/server/flight6.js.map +1 -1
- package/lib/dtls/src/handshake/const.d.ts +17 -13
- package/lib/dtls/src/handshake/const.js +16 -14
- package/lib/dtls/src/handshake/const.js.map +1 -1
- package/lib/dtls/src/handshake/extensions/signature.d.ts +1 -1
- package/lib/dtls/src/handshake/extensions/signature.js.map +1 -1
- package/lib/dtls/src/handshake/message/alert.js +5 -3
- package/lib/dtls/src/handshake/message/alert.js.map +1 -1
- package/lib/dtls/src/handshake/message/certificate.js +3 -2
- package/lib/dtls/src/handshake/message/certificate.js.map +1 -1
- package/lib/dtls/src/handshake/message/changeCipherSpec.js +4 -4
- package/lib/dtls/src/handshake/message/changeCipherSpec.js.map +1 -1
- package/lib/dtls/src/handshake/message/client/certificateVerify.d.ts +1 -1
- package/lib/dtls/src/handshake/message/client/certificateVerify.js +5 -3
- package/lib/dtls/src/handshake/message/client/certificateVerify.js.map +1 -1
- package/lib/dtls/src/handshake/message/client/hello.js +15 -8
- package/lib/dtls/src/handshake/message/client/hello.js.map +1 -1
- package/lib/dtls/src/handshake/message/client/keyExchange.js +3 -2
- package/lib/dtls/src/handshake/message/client/keyExchange.js.map +1 -1
- package/lib/dtls/src/handshake/message/finished.js +2 -1
- package/lib/dtls/src/handshake/message/finished.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/certificateRequest.d.ts +1 -1
- package/lib/dtls/src/handshake/message/server/certificateRequest.js +7 -4
- package/lib/dtls/src/handshake/message/server/certificateRequest.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/hello.d.ts +1 -1
- package/lib/dtls/src/handshake/message/server/hello.js +14 -8
- package/lib/dtls/src/handshake/message/server/hello.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/helloDone.js +1 -1
- package/lib/dtls/src/handshake/message/server/helloDone.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/helloVerifyRequest.js +5 -3
- package/lib/dtls/src/handshake/message/server/helloVerifyRequest.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/keyExchange.d.ts +1 -1
- package/lib/dtls/src/handshake/message/server/keyExchange.js +17 -9
- package/lib/dtls/src/handshake/message/server/keyExchange.js.map +1 -1
- package/lib/dtls/src/handshake/random.d.ts +1 -1
- package/lib/dtls/src/handshake/random.js +7 -4
- package/lib/dtls/src/handshake/random.js.map +1 -1
- package/lib/dtls/src/imports/common.d.ts +1 -0
- package/lib/dtls/src/imports/common.js +1 -0
- package/lib/dtls/src/imports/common.js.map +1 -1
- package/lib/dtls/src/index.d.ts +2 -2
- package/lib/dtls/src/index.js +2 -2
- package/lib/dtls/src/index.js.map +1 -1
- package/lib/dtls/src/record/const.d.ts +43 -33
- package/lib/dtls/src/record/const.js +43 -36
- package/lib/dtls/src/record/const.js.map +1 -1
- package/lib/dtls/src/record/message/fragment.d.ts +1 -1
- package/lib/dtls/src/record/message/fragment.js +15 -9
- package/lib/dtls/src/record/message/fragment.js.map +1 -1
- package/lib/dtls/src/record/message/header.js +12 -7
- package/lib/dtls/src/record/message/header.js.map +1 -1
- package/lib/dtls/src/record/message/plaintext.js +4 -2
- package/lib/dtls/src/record/message/plaintext.js.map +1 -1
- package/lib/dtls/src/record/receive.js +2 -2
- package/lib/dtls/src/record/receive.js.map +1 -1
- package/lib/dtls/src/server.js +1 -1
- package/lib/dtls/src/server.js.map +1 -1
- package/lib/dtls/src/socket.d.ts +2 -2
- package/lib/dtls/src/socket.js +6 -4
- package/lib/dtls/src/socket.js.map +1 -1
- package/lib/ice/src/candidate.d.ts +1 -1
- package/lib/ice/src/candidate.js +24 -12
- package/lib/ice/src/candidate.js.map +1 -1
- package/lib/ice/src/dns/lookup.d.ts +10 -1
- package/lib/ice/src/dns/lookup.js +42 -7
- package/lib/ice/src/dns/lookup.js.map +1 -1
- package/lib/ice/src/exceptions.d.ts +46 -0
- package/lib/ice/src/exceptions.js +92 -5
- package/lib/ice/src/exceptions.js.map +1 -1
- package/lib/ice/src/helper.d.ts +1 -1
- package/lib/ice/src/ice.d.ts +191 -5
- package/lib/ice/src/ice.js +1048 -156
- package/lib/ice/src/ice.js.map +1 -1
- package/lib/ice/src/iceBase.d.ts +174 -10
- package/lib/ice/src/iceBase.js +165 -12
- package/lib/ice/src/iceBase.js.map +1 -1
- package/lib/ice/src/index.d.ts +5 -5
- package/lib/ice/src/index.js +5 -5
- package/lib/ice/src/index.js.map +1 -1
- package/lib/ice/src/internal/resolveHostAddresses.d.ts +26 -0
- package/lib/ice/src/internal/resolveHostAddresses.js +45 -0
- package/lib/ice/src/internal/resolveHostAddresses.js.map +1 -0
- package/lib/ice/src/stun/protocol.d.ts +3 -1
- package/lib/ice/src/stun/protocol.js +16 -0
- package/lib/ice/src/stun/protocol.js.map +1 -1
- package/lib/ice/src/stun/tcpProtocol.d.ts +2 -0
- package/lib/ice/src/stun/tcpProtocol.js +16 -1
- package/lib/ice/src/stun/tcpProtocol.js.map +1 -1
- package/lib/ice/src/stun/transaction.d.ts +35 -1
- package/lib/ice/src/stun/transaction.js +93 -18
- package/lib/ice/src/stun/transaction.js.map +1 -1
- package/lib/ice/src/turn/credential.d.ts +49 -0
- package/lib/ice/src/turn/credential.js +78 -0
- package/lib/ice/src/turn/credential.js.map +1 -0
- package/lib/ice/src/turn/protocol.d.ts +97 -7
- package/lib/ice/src/turn/protocol.js +357 -55
- package/lib/ice/src/turn/protocol.js.map +1 -1
- package/lib/ice/src/utils.js.map +1 -1
- package/lib/ice-server/src/stun/attributes.d.ts +2 -0
- package/lib/ice-server/src/stun/attributes.js +7 -1
- package/lib/ice-server/src/stun/attributes.js.map +1 -1
- package/lib/ice-server/src/stun/const.d.ts +24 -16
- package/lib/ice-server/src/stun/const.js +22 -18
- package/lib/ice-server/src/stun/const.js.map +1 -1
- package/lib/ice-server/src/stun/message.d.ts +3 -1
- package/lib/ice-server/src/stun/message.js +41 -6
- package/lib/ice-server/src/stun/message.js.map +1 -1
- package/lib/ice-server/src/turn/auth.d.ts +1 -1
- package/lib/index.mjs +25252 -12664
- package/lib/nonstandard/index.mjs +11015 -8906
- package/lib/polyfill/dom.mjs +30779 -18386
- package/lib/polyfill/index.mjs +30779 -18386
- package/lib/rtp/src/codec/assertPayload.d.ts +4 -0
- package/lib/rtp/src/codec/assertPayload.js +12 -0
- package/lib/rtp/src/codec/assertPayload.js.map +1 -0
- package/lib/rtp/src/codec/av1.js +2 -0
- package/lib/rtp/src/codec/av1.js.map +1 -1
- package/lib/rtp/src/codec/h264.d.ts +1 -1
- package/lib/rtp/src/codec/h264.js +35 -43
- package/lib/rtp/src/codec/h264.js.map +1 -1
- package/lib/rtp/src/codec/vp8.js +11 -5
- package/lib/rtp/src/codec/vp8.js.map +1 -1
- package/lib/rtp/src/codec/vp9.js +12 -0
- package/lib/rtp/src/codec/vp9.js.map +1 -1
- package/lib/rtp/src/extra/container/mp4/container.js +2 -1
- package/lib/rtp/src/extra/container/mp4/container.js.map +1 -1
- package/lib/rtp/src/extra/container/mp4/exp-golomb.js +2 -1
- package/lib/rtp/src/extra/container/mp4/exp-golomb.js.map +1 -1
- package/lib/rtp/src/extra/container/mp4/h264.d.ts +21 -17
- package/lib/rtp/src/extra/container/mp4/h264.js +26 -24
- package/lib/rtp/src/extra/container/mp4/h264.js.map +1 -1
- package/lib/rtp/src/extra/container/ogg/index.d.ts +1 -0
- package/lib/rtp/src/extra/container/ogg/index.js +1 -0
- package/lib/rtp/src/extra/container/ogg/index.js.map +1 -1
- package/lib/rtp/src/extra/container/ogg/writer.d.ts +90 -0
- package/lib/rtp/src/extra/container/ogg/writer.js +300 -0
- package/lib/rtp/src/extra/container/ogg/writer.js.map +1 -0
- package/lib/rtp/src/extra/container/webm/container.d.ts +1 -1
- package/lib/rtp/src/extra/container/webm/ebml/ebml.d.ts +6 -0
- package/lib/rtp/src/extra/container/webm/ebml/ebml.js +26 -4
- package/lib/rtp/src/extra/container/webm/ebml/ebml.js.map +1 -1
- package/lib/rtp/src/extra/processor/depacketizer.d.ts +6 -1
- package/lib/rtp/src/extra/processor/depacketizer.js +29 -3
- package/lib/rtp/src/extra/processor/depacketizer.js.map +1 -1
- package/lib/rtp/src/extra/processor/depacketizerCallback.d.ts +1 -11
- package/lib/rtp/src/extra/processor/depacketizerTransformer.d.ts +1 -1
- package/lib/rtp/src/extra/processor/dtx.js +4 -2
- package/lib/rtp/src/extra/processor/dtx.js.map +1 -1
- package/lib/rtp/src/extra/processor/dtxCallback.d.ts +1 -11
- package/lib/rtp/src/extra/processor/index.d.ts +2 -0
- package/lib/rtp/src/extra/processor/index.js +2 -0
- package/lib/rtp/src/extra/processor/index.js.map +1 -1
- package/lib/rtp/src/extra/processor/interface.d.ts +16 -11
- package/lib/rtp/src/extra/processor/interface.js.map +1 -1
- package/lib/rtp/src/extra/processor/jitterBuffer.d.ts +29 -6
- package/lib/rtp/src/extra/processor/jitterBuffer.js +101 -111
- package/lib/rtp/src/extra/processor/jitterBuffer.js.map +1 -1
- package/lib/rtp/src/extra/processor/jitterBufferCallback.d.ts +1 -11
- package/lib/rtp/src/extra/processor/jitterBufferTransformer.d.ts +1 -1
- package/lib/rtp/src/extra/processor/jitterBufferTransformer.js +2 -1
- package/lib/rtp/src/extra/processor/jitterBufferTransformer.js.map +1 -1
- package/lib/rtp/src/extra/processor/lipsync.d.ts +63 -0
- package/lib/rtp/src/extra/processor/lipsync.js +202 -51
- package/lib/rtp/src/extra/processor/lipsync.js.map +1 -1
- package/lib/rtp/src/extra/processor/mp4.d.ts +0 -6
- package/lib/rtp/src/extra/processor/mp4.js +7 -4
- package/lib/rtp/src/extra/processor/mp4.js.map +1 -1
- package/lib/rtp/src/extra/processor/mute.js +4 -2
- package/lib/rtp/src/extra/processor/mute.js.map +1 -1
- package/lib/rtp/src/extra/processor/nack.d.ts +1 -1
- package/lib/rtp/src/extra/processor/nack.js +5 -3
- package/lib/rtp/src/extra/processor/nack.js.map +1 -1
- package/lib/rtp/src/extra/processor/nackHandlerCallback.d.ts +1 -11
- package/lib/rtp/src/extra/processor/ntpTime.js +4 -6
- package/lib/rtp/src/extra/processor/ntpTime.js.map +1 -1
- package/lib/rtp/src/extra/processor/ntpTimeCallback.d.ts +1 -11
- package/lib/rtp/src/extra/processor/ogg.d.ts +72 -0
- package/lib/rtp/src/extra/processor/ogg.js +221 -0
- package/lib/rtp/src/extra/processor/ogg.js.map +1 -0
- package/lib/rtp/src/extra/processor/oggCallback.d.ts +21 -0
- package/lib/rtp/src/extra/processor/oggCallback.js +97 -0
- package/lib/rtp/src/extra/processor/oggCallback.js.map +1 -0
- package/lib/rtp/src/extra/processor/rtcpCallback.d.ts +1 -1
- package/lib/rtp/src/extra/processor/rtcpCallback.js.map +1 -1
- package/lib/rtp/src/extra/processor/rtpCallback.d.ts +1 -1
- package/lib/rtp/src/extra/processor/rtpCallback.js +3 -2
- package/lib/rtp/src/extra/processor/rtpCallback.js.map +1 -1
- package/lib/rtp/src/extra/processor/rtpStream.d.ts +2 -2
- package/lib/rtp/src/extra/processor/rtpStream.js +2 -1
- package/lib/rtp/src/extra/processor/rtpStream.js.map +1 -1
- package/lib/rtp/src/extra/processor/rtpTime.js +2 -1
- package/lib/rtp/src/extra/processor/rtpTime.js.map +1 -1
- package/lib/rtp/src/extra/processor/rtpTimeCallback.d.ts +1 -11
- package/lib/rtp/src/extra/processor/webm.d.ts +27 -0
- package/lib/rtp/src/extra/processor/webm.js +57 -23
- package/lib/rtp/src/extra/processor/webm.js.map +1 -1
- package/lib/rtp/src/extra/processor/webmCallback.js +6 -1
- package/lib/rtp/src/extra/processor/webmCallback.js.map +1 -1
- package/lib/rtp/src/extra/processor/webmStream.js.map +1 -1
- package/lib/rtp/src/helper.d.ts +2 -2
- package/lib/rtp/src/helper.js +2 -6
- package/lib/rtp/src/helper.js.map +1 -1
- package/lib/rtp/src/index.d.ts +10 -2
- package/lib/rtp/src/index.js +10 -2
- package/lib/rtp/src/index.js.map +1 -1
- package/lib/rtp/src/rtcp/psfb/fullIntraRequest.d.ts +4 -0
- package/lib/rtp/src/rtcp/psfb/fullIntraRequest.js +6 -1
- package/lib/rtp/src/rtcp/psfb/fullIntraRequest.js.map +1 -1
- package/lib/rtp/src/rtcp/rtcp.js +9 -4
- package/lib/rtp/src/rtcp/rtcp.js.map +1 -1
- package/lib/rtp/src/rtcp/rtpfb/transportWideSequence.d.ts +58 -0
- package/lib/rtp/src/rtcp/rtpfb/transportWideSequence.js +143 -0
- package/lib/rtp/src/rtcp/rtpfb/transportWideSequence.js.map +1 -0
- package/lib/rtp/src/rtcp/rtpfb/twcc.d.ts +35 -13
- package/lib/rtp/src/rtcp/rtpfb/twcc.js +132 -54
- package/lib/rtp/src/rtcp/rtpfb/twcc.js.map +1 -1
- package/lib/rtp/src/rtcp/rtpfb/twccReceiveTiming.d.ts +13 -0
- package/lib/rtp/src/rtcp/rtpfb/twccReceiveTiming.js +29 -0
- package/lib/rtp/src/rtcp/rtpfb/twccReceiveTiming.js.map +1 -0
- package/lib/rtp/src/rtcp/rtpfb/twccReferenceTime.d.ts +41 -0
- package/lib/rtp/src/rtcp/rtpfb/twccReferenceTime.js +89 -0
- package/lib/rtp/src/rtcp/rtpfb/twccReferenceTime.js.map +1 -0
- package/lib/rtp/src/rtcp/sr.d.ts +4 -3
- package/lib/rtp/src/rtcp/sr.js +4 -2
- package/lib/rtp/src/rtcp/sr.js.map +1 -1
- package/lib/rtp/src/rtp/continuity.d.ts +36 -0
- package/lib/rtp/src/rtp/continuity.js +100 -0
- package/lib/rtp/src/rtp/continuity.js.map +1 -0
- package/lib/rtp/src/rtp/headerExtension.js +41 -21
- package/lib/rtp/src/rtp/headerExtension.js.map +1 -1
- package/lib/rtp/src/rtp/padding.d.ts +17 -0
- package/lib/rtp/src/rtp/padding.js +37 -0
- package/lib/rtp/src/rtp/padding.js.map +1 -0
- package/lib/rtp/src/rtp/red/encoder.d.ts +10 -0
- package/lib/rtp/src/rtp/red/encoder.js +14 -1
- package/lib/rtp/src/rtp/red/encoder.js.map +1 -1
- package/lib/rtp/src/rtp/red/packet.js +24 -8
- package/lib/rtp/src/rtp/red/packet.js.map +1 -1
- package/lib/rtp/src/rtp/rtp.d.ts +24 -1
- package/lib/rtp/src/rtp/rtp.js +70 -29
- package/lib/rtp/src/rtp/rtp.js.map +1 -1
- package/lib/rtp/src/rtp/rtx.js +3 -0
- package/lib/rtp/src/rtp/rtx.js.map +1 -1
- package/lib/rtp/src/rtp/sendHeaderExtensions.d.ts +36 -0
- package/lib/rtp/src/rtp/sendHeaderExtensions.js +85 -0
- package/lib/rtp/src/rtp/sendHeaderExtensions.js.map +1 -0
- package/lib/rtp/src/srtp/cipher/ctr.d.ts +2 -2
- package/lib/rtp/src/srtp/cipher/ctr.js +5 -3
- package/lib/rtp/src/srtp/cipher/ctr.js.map +1 -1
- package/lib/rtp/src/srtp/cipher/gcm.d.ts +1 -1
- package/lib/rtp/src/srtp/cipher/gcm.js +1 -1
- package/lib/rtp/src/srtp/cipher/gcm.js.map +1 -1
- package/lib/rtp/src/srtp/cipher/index.js +8 -4
- package/lib/rtp/src/srtp/cipher/index.js.map +1 -1
- package/lib/rtp/src/srtp/context/context.d.ts +29 -1
- package/lib/rtp/src/srtp/context/context.js +84 -27
- package/lib/rtp/src/srtp/context/context.js.map +1 -1
- package/lib/rtp/src/srtp/context/srtcp.d.ts +1 -1
- package/lib/rtp/src/srtp/context/srtcp.js +33 -0
- package/lib/rtp/src/srtp/context/srtcp.js.map +1 -1
- package/lib/rtp/src/srtp/context/srtp.d.ts +1 -1
- package/lib/rtp/src/srtp/context/srtp.js +36 -4
- package/lib/rtp/src/srtp/context/srtp.js.map +1 -1
- package/lib/rtp/src/srtp/error.d.ts +8 -0
- package/lib/rtp/src/srtp/error.js +13 -1
- package/lib/rtp/src/srtp/error.js.map +1 -1
- package/lib/rtp/src/srtp/packet.js +4 -1
- package/lib/rtp/src/srtp/packet.js.map +1 -1
- package/lib/rtp/src/srtp/replay.d.ts +24 -0
- package/lib/rtp/src/srtp/replay.js +75 -0
- package/lib/rtp/src/srtp/replay.js.map +1 -0
- package/lib/rtp/src/srtp/session.js +2 -1
- package/lib/rtp/src/srtp/session.js.map +1 -1
- package/lib/rtp/src/srtp/srtcp.js +2 -1
- package/lib/rtp/src/srtp/srtcp.js.map +1 -1
- package/lib/rtp/src/srtp/srtp.js +2 -1
- package/lib/rtp/src/srtp/srtp.js.map +1 -1
- package/lib/rtp/src/util.js +2 -1
- package/lib/rtp/src/util.js.map +1 -1
- package/lib/sctp/src/chunk.d.ts +5 -0
- package/lib/sctp/src/chunk.js +31 -8
- package/lib/sctp/src/chunk.js.map +1 -1
- package/lib/sctp/src/const.d.ts +25 -17
- package/lib/sctp/src/const.js +23 -19
- package/lib/sctp/src/const.js.map +1 -1
- package/lib/sctp/src/index.d.ts +4 -3
- package/lib/sctp/src/index.js +10 -8
- package/lib/sctp/src/index.js.map +1 -1
- package/lib/sctp/src/param.d.ts +6 -2
- package/lib/sctp/src/param.js +22 -8
- package/lib/sctp/src/param.js.map +1 -1
- package/lib/sctp/src/sctp.d.ts +91 -2
- package/lib/sctp/src/sctp.js +700 -134
- package/lib/sctp/src/sctp.js.map +1 -1
- package/lib/sctp/src/transport.js +4 -2
- package/lib/sctp/src/transport.js.map +1 -1
- package/lib/webrtc/src/api/peerConfig.d.ts +307 -0
- package/lib/webrtc/src/api/peerConfig.js +291 -0
- package/lib/webrtc/src/api/peerConfig.js.map +1 -0
- package/lib/webrtc/src/api/peerConnectionEvents.d.ts +36 -0
- package/lib/webrtc/src/api/peerConnectionEvents.js +44 -0
- package/lib/webrtc/src/api/peerConnectionEvents.js.map +1 -0
- package/lib/webrtc/src/dataChannel.d.ts +11 -1
- package/lib/webrtc/src/dataChannel.js +25 -5
- package/lib/webrtc/src/dataChannel.js.map +1 -1
- package/lib/webrtc/src/index.d.ts +2 -2
- package/lib/webrtc/src/index.js +2 -2
- package/lib/webrtc/src/index.js.map +1 -1
- package/lib/webrtc/src/media/index.d.ts +11 -1
- package/lib/webrtc/src/media/index.js +71 -1
- package/lib/webrtc/src/media/index.js.map +1 -1
- package/lib/webrtc/src/media/receiver/nack.js +5 -5
- package/lib/webrtc/src/media/receiver/nack.js.map +1 -1
- package/lib/webrtc/src/media/receiver/receiverTwcc.d.ts +61 -1
- package/lib/webrtc/src/media/receiver/receiverTwcc.js +218 -63
- package/lib/webrtc/src/media/receiver/receiverTwcc.js.map +1 -1
- package/lib/webrtc/src/media/router.d.ts +130 -6
- package/lib/webrtc/src/media/router.js +325 -29
- package/lib/webrtc/src/media/router.js.map +1 -1
- package/lib/webrtc/src/media/rtpReceiver.d.ts +137 -14
- package/lib/webrtc/src/media/rtpReceiver.js +420 -44
- package/lib/webrtc/src/media/rtpReceiver.js.map +1 -1
- package/lib/webrtc/src/media/rtpSender.d.ts +232 -65
- package/lib/webrtc/src/media/rtpSender.js +784 -448
- package/lib/webrtc/src/media/rtpSender.js.map +1 -1
- package/lib/webrtc/src/media/rtpTransceiver.d.ts +95 -4
- package/lib/webrtc/src/media/rtpTransceiver.js +121 -9
- package/lib/webrtc/src/media/rtpTransceiver.js.map +1 -1
- package/lib/webrtc/src/media/sender/bandwidthEstimator.d.ts +249 -0
- package/lib/webrtc/src/media/sender/bandwidthEstimator.js +144 -0
- package/lib/webrtc/src/media/sender/bandwidthEstimator.js.map +1 -0
- package/lib/webrtc/src/media/sender/createBandwidthEstimator.d.ts +20 -0
- package/lib/webrtc/src/media/sender/createBandwidthEstimator.js +26 -0
- package/lib/webrtc/src/media/sender/createBandwidthEstimator.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimatorBinding.d.ts +70 -0
- package/lib/webrtc/src/media/sender/estimatorBinding.js +175 -0
- package/lib/webrtc/src/media/sender/estimatorBinding.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/disabledBwe.d.ts +18 -0
- package/lib/webrtc/src/media/sender/estimators/disabledBwe.js +44 -0
- package/lib/webrtc/src/media/sender/estimators/disabledBwe.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/acknowledgedBitrateEstimator.d.ts +79 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/acknowledgedBitrateEstimator.js +289 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/acknowledgedBitrateEstimator.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/aimdRateControl.d.ts +87 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/aimdRateControl.js +429 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/aimdRateControl.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/alrDetector.d.ts +21 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/alrDetector.js +84 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/alrDetector.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/bandwidthLimitedCause.d.ts +37 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/bandwidthLimitedCause.js +74 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/bandwidthLimitedCause.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/constants.d.ts +383 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/constants.js +408 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/constants.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/gccBwe.d.ts +406 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/gccBwe.js +1391 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/gccBwe.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/index.d.ts +19 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/index.js +75 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/index.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/interArrivalDelta.d.ts +68 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/interArrivalDelta.js +201 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/interArrivalDelta.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/intervalBudget.d.ts +26 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/intervalBudget.js +72 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/intervalBudget.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/linkCapacityEstimator.d.ts +41 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/linkCapacityEstimator.js +99 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/linkCapacityEstimator.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/lossBasedBwe.d.ts +247 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/lossBasedBwe.js +1042 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/lossBasedBwe.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/overuseDetector.d.ts +26 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/overuseDetector.js +132 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/overuseDetector.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/probeController.d.ts +305 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/probeController.js +1073 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/probeController.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/rttBasedBackoff.d.ts +60 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/rttBasedBackoff.js +151 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/rttBasedBackoff.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/trendlineEstimator.d.ts +44 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/trendlineEstimator.js +246 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/trendlineEstimator.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/index.d.ts +7 -0
- package/lib/webrtc/src/media/sender/estimators/index.js +19 -0
- package/lib/webrtc/src/media/sender/estimators/index.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/lightweightBwe.d.ts +64 -0
- package/lib/webrtc/src/media/sender/estimators/lightweightBwe.js +216 -0
- package/lib/webrtc/src/media/sender/estimators/lightweightBwe.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/twccFeedbackAdapter.d.ts +117 -0
- package/lib/webrtc/src/media/sender/estimators/twccFeedbackAdapter.js +250 -0
- package/lib/webrtc/src/media/sender/estimators/twccFeedbackAdapter.js.map +1 -0
- package/lib/webrtc/src/media/sender/outgoingQueue.d.ts +40 -0
- package/lib/webrtc/src/media/sender/outgoingQueue.js +153 -0
- package/lib/webrtc/src/media/sender/outgoingQueue.js.map +1 -0
- package/lib/webrtc/src/media/sender/padding.d.ts +45 -0
- package/lib/webrtc/src/media/sender/padding.js +134 -0
- package/lib/webrtc/src/media/sender/padding.js.map +1 -0
- package/lib/webrtc/src/media/sender/pendingRtp.d.ts +35 -0
- package/lib/webrtc/src/media/sender/pendingRtp.js +120 -0
- package/lib/webrtc/src/media/sender/pendingRtp.js.map +1 -0
- package/lib/webrtc/src/media/sender/rtpWire.d.ts +13 -0
- package/lib/webrtc/src/media/sender/rtpWire.js +38 -0
- package/lib/webrtc/src/media/sender/rtpWire.js.map +1 -0
- package/lib/webrtc/src/media/sender/sendPacer.d.ts +27 -0
- package/lib/webrtc/src/media/sender/sendPacer.js +110 -0
- package/lib/webrtc/src/media/sender/sendPacer.js.map +1 -0
- package/lib/webrtc/src/media/sender/senderBWE.d.ts +8 -32
- package/lib/webrtc/src/media/sender/senderBWE.js +5 -142
- package/lib/webrtc/src/media/sender/senderBWE.js.map +1 -1
- package/lib/webrtc/src/media/sender/senderStats.d.ts +100 -0
- package/lib/webrtc/src/media/sender/senderStats.js +322 -0
- package/lib/webrtc/src/media/sender/senderStats.js.map +1 -0
- package/lib/webrtc/src/media/track.d.ts +21 -3
- package/lib/webrtc/src/media/track.js +24 -6
- package/lib/webrtc/src/media/track.js.map +1 -1
- package/lib/webrtc/src/negotiation/bundleTopology.d.ts +103 -0
- package/lib/webrtc/src/negotiation/bundleTopology.js +384 -0
- package/lib/webrtc/src/negotiation/bundleTopology.js.map +1 -0
- package/lib/webrtc/src/negotiation/descriptionValidation.d.ts +51 -0
- package/lib/webrtc/src/negotiation/descriptionValidation.js +267 -0
- package/lib/webrtc/src/negotiation/descriptionValidation.js.map +1 -0
- package/lib/webrtc/src/negotiation/iceRestartRequest.d.ts +21 -0
- package/lib/webrtc/src/negotiation/iceRestartRequest.js +61 -0
- package/lib/webrtc/src/negotiation/iceRestartRequest.js.map +1 -0
- package/lib/webrtc/src/negotiation/internalState.d.ts +34 -0
- package/lib/webrtc/src/negotiation/internalState.js +21 -0
- package/lib/webrtc/src/negotiation/internalState.js.map +1 -0
- package/lib/webrtc/src/negotiation/negotiationNeeded.d.ts +44 -0
- package/lib/webrtc/src/negotiation/negotiationNeeded.js +119 -0
- package/lib/webrtc/src/negotiation/negotiationNeeded.js.map +1 -0
- package/lib/webrtc/src/negotiation/remoteCandidates.d.ts +86 -0
- package/lib/webrtc/src/negotiation/remoteCandidates.js +349 -0
- package/lib/webrtc/src/negotiation/remoteCandidates.js.map +1 -0
- package/lib/webrtc/src/negotiation/remoteMediaApplication.d.ts +71 -0
- package/lib/webrtc/src/negotiation/remoteMediaApplication.js +414 -0
- package/lib/webrtc/src/negotiation/remoteMediaApplication.js.map +1 -0
- package/lib/webrtc/src/negotiation/transportActivation.d.ts +59 -0
- package/lib/webrtc/src/negotiation/transportActivation.js +356 -0
- package/lib/webrtc/src/negotiation/transportActivation.js.map +1 -0
- package/lib/webrtc/src/negotiationTransaction.d.ts +240 -0
- package/lib/webrtc/src/negotiationTransaction.js +604 -0
- package/lib/webrtc/src/negotiationTransaction.js.map +1 -0
- package/lib/webrtc/src/nonstandard/dummyMedia.js +2 -1
- package/lib/webrtc/src/nonstandard/dummyMedia.js.map +1 -1
- package/lib/webrtc/src/nonstandard/index.d.ts +1 -1
- package/lib/webrtc/src/nonstandard/index.js +1 -1
- package/lib/webrtc/src/nonstandard/index.js.map +1 -1
- package/lib/webrtc/src/nonstandard/navigator.js +4 -3
- package/lib/webrtc/src/nonstandard/navigator.js.map +1 -1
- package/lib/webrtc/src/nonstandard/recorder/index.d.ts +32 -8
- package/lib/webrtc/src/nonstandard/recorder/index.js +81 -20
- package/lib/webrtc/src/nonstandard/recorder/index.js.map +1 -1
- package/lib/webrtc/src/nonstandard/recorder/writer/index.d.ts +10 -8
- package/lib/webrtc/src/nonstandard/recorder/writer/index.js +2 -1
- package/lib/webrtc/src/nonstandard/recorder/writer/index.js.map +1 -1
- package/lib/webrtc/src/nonstandard/recorder/writer/ogg.d.ts +32 -0
- package/lib/webrtc/src/nonstandard/recorder/writer/ogg.js +185 -0
- package/lib/webrtc/src/nonstandard/recorder/writer/ogg.js.map +1 -0
- package/lib/webrtc/src/nonstandard/recorder/writer/webm.d.ts +2 -2
- package/lib/webrtc/src/nonstandard/recorder/writer/webm.js +10 -3
- package/lib/webrtc/src/nonstandard/recorder/writer/webm.js.map +1 -1
- package/lib/webrtc/src/nonstandard/userMedia/packetizer.d.ts +2 -2
- package/lib/webrtc/src/nonstandard/userMedia/packetizer.js.map +1 -1
- package/lib/webrtc/src/nonstandard/userMedia.d.ts +2 -2
- package/lib/webrtc/src/nonstandard/userMedia.js +4 -3
- package/lib/webrtc/src/nonstandard/userMedia.js.map +1 -1
- package/lib/webrtc/src/peerConnection.d.ts +176 -238
- package/lib/webrtc/src/peerConnection.js +1042 -913
- package/lib/webrtc/src/peerConnection.js.map +1 -1
- package/lib/webrtc/src/polyfill/api.d.ts +5 -5
- package/lib/webrtc/src/polyfill/api.js.map +1 -1
- package/lib/webrtc/src/polyfill/index.js.map +1 -1
- package/lib/webrtc/src/polyfill/install.js +1 -1
- package/lib/webrtc/src/polyfill/install.js.map +1 -1
- package/lib/webrtc/src/polyfill/mediaDevices.js +2 -1
- package/lib/webrtc/src/polyfill/mediaDevices.js.map +1 -1
- package/lib/webrtc/src/polyfill/registers/mp4Webm.js.map +1 -1
- package/lib/webrtc/src/polyfill/registers/rtpRtcp.js.map +1 -1
- package/lib/webrtc/src/polyfill/selectSettings.js.map +1 -1
- package/lib/webrtc/src/polyfill/sourceIo.js.map +1 -1
- package/lib/webrtc/src/sctpManager.d.ts +97 -1
- package/lib/webrtc/src/sctpManager.js +189 -9
- package/lib/webrtc/src/sctpManager.js.map +1 -1
- package/lib/webrtc/src/sdp.js +12 -6
- package/lib/webrtc/src/sdp.js.map +1 -1
- package/lib/webrtc/src/sdpManager.d.ts +55 -11
- package/lib/webrtc/src/sdpManager.js +364 -87
- package/lib/webrtc/src/sdpManager.js.map +1 -1
- package/lib/webrtc/src/secureTransportManager.d.ts +89 -28
- package/lib/webrtc/src/secureTransportManager.js +232 -53
- package/lib/webrtc/src/secureTransportManager.js.map +1 -1
- package/lib/webrtc/src/transceiverManager.d.ts +62 -18
- package/lib/webrtc/src/transceiverManager.js +272 -107
- package/lib/webrtc/src/transceiverManager.js.map +1 -1
- package/lib/webrtc/src/transport/dtls.d.ts +64 -3
- package/lib/webrtc/src/transport/dtls.js +166 -42
- package/lib/webrtc/src/transport/dtls.js.map +1 -1
- package/lib/webrtc/src/transport/ice.d.ts +199 -28
- package/lib/webrtc/src/transport/ice.js +666 -71
- package/lib/webrtc/src/transport/ice.js.map +1 -1
- package/lib/webrtc/src/transport/iceCandidateAttribute.d.ts +98 -0
- package/lib/webrtc/src/transport/iceCandidateAttribute.js +129 -0
- package/lib/webrtc/src/transport/iceCandidateAttribute.js.map +1 -0
- package/lib/webrtc/src/transport/sctp.d.ts +6 -1
- package/lib/webrtc/src/transport/sctp.js +149 -37
- package/lib/webrtc/src/transport/sctp.js.map +1 -1
- package/lib/webrtc/src/utils.d.ts +39 -6
- package/lib/webrtc/src/utils.js +57 -17
- package/lib/webrtc/src/utils.js.map +1 -1
- package/package.json +16 -15
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type MediaStreamTrack } from "../../..";
|
|
2
|
+
import { Event, EventDisposer } from "../../../imports/common";
|
|
3
|
+
import { type OggOutput, RtpSourceCallback } from "../../../imports/rtpExtra";
|
|
4
|
+
import { MediaWriter } from ".";
|
|
5
|
+
/**
|
|
6
|
+
* Records one Opus audio track into an Ogg Opus file (RFC 7845).
|
|
7
|
+
*
|
|
8
|
+
* The pipeline is the audio branch of WebmFactory without LipsyncCallback:
|
|
9
|
+
* a single audio track has nothing to synchronize with, so `disableLipSync`
|
|
10
|
+
* and `lipsync` are ignored. `width`, `height`, `roll` and `defaultDuration`
|
|
11
|
+
* are ignored as well.
|
|
12
|
+
*/
|
|
13
|
+
export declare class OggFactory extends MediaWriter<OggOutput> {
|
|
14
|
+
rtpSources: RtpSourceCallback[];
|
|
15
|
+
private onEol;
|
|
16
|
+
/**
|
|
17
|
+
* true while an eol is still to come: set once the pipeline is running and
|
|
18
|
+
* cleared when it ends. stop() waits for the eol only in this state, so a
|
|
19
|
+
* recording that never started or failed to start stops immediately
|
|
20
|
+
*/
|
|
21
|
+
private running;
|
|
22
|
+
/** a write failure stops the recording and is reported here */
|
|
23
|
+
onError: Event<[Error]>;
|
|
24
|
+
unSubscribers: EventDisposer;
|
|
25
|
+
/** throws WeriftError unless tracks is exactly one Opus audio track */
|
|
26
|
+
static validateTracks(tracks: MediaStreamTrack[]): void;
|
|
27
|
+
static validateNumOfTracks(numOfTracks: number): void;
|
|
28
|
+
static validateTrack(track: MediaStreamTrack): void;
|
|
29
|
+
start(tracks: MediaStreamTrack[]): Promise<void>;
|
|
30
|
+
private startPipeline;
|
|
31
|
+
stop(): Promise<void>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OggFactory = void 0;
|
|
4
|
+
const __1 = require("../../..");
|
|
5
|
+
const common_1 = require("../../../imports/common");
|
|
6
|
+
const rtpExtra_1 = require("../../../imports/rtpExtra");
|
|
7
|
+
const _1 = require(".");
|
|
8
|
+
const sourcePath = "packages/webrtc/src/nonstandard/recorder/writer/ogg.ts";
|
|
9
|
+
/**
|
|
10
|
+
* Records one Opus audio track into an Ogg Opus file (RFC 7845).
|
|
11
|
+
*
|
|
12
|
+
* The pipeline is the audio branch of WebmFactory without LipsyncCallback:
|
|
13
|
+
* a single audio track has nothing to synchronize with, so `disableLipSync`
|
|
14
|
+
* and `lipsync` are ignored. `width`, `height`, `roll` and `defaultDuration`
|
|
15
|
+
* are ignored as well.
|
|
16
|
+
*/
|
|
17
|
+
class OggFactory extends _1.MediaWriter {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
Object.defineProperty(this, "rtpSources", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
configurable: true,
|
|
23
|
+
writable: true,
|
|
24
|
+
value: []
|
|
25
|
+
});
|
|
26
|
+
Object.defineProperty(this, "onEol", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
configurable: true,
|
|
29
|
+
writable: true,
|
|
30
|
+
value: new common_1.Event()
|
|
31
|
+
});
|
|
32
|
+
/**
|
|
33
|
+
* true while an eol is still to come: set once the pipeline is running and
|
|
34
|
+
* cleared when it ends. stop() waits for the eol only in this state, so a
|
|
35
|
+
* recording that never started or failed to start stops immediately
|
|
36
|
+
*/
|
|
37
|
+
Object.defineProperty(this, "running", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
configurable: true,
|
|
40
|
+
writable: true,
|
|
41
|
+
value: false
|
|
42
|
+
});
|
|
43
|
+
/** a write failure stops the recording and is reported here */
|
|
44
|
+
Object.defineProperty(this, "onError", {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
configurable: true,
|
|
47
|
+
writable: true,
|
|
48
|
+
value: new common_1.Event()
|
|
49
|
+
});
|
|
50
|
+
Object.defineProperty(this, "unSubscribers", {
|
|
51
|
+
enumerable: true,
|
|
52
|
+
configurable: true,
|
|
53
|
+
writable: true,
|
|
54
|
+
value: new common_1.EventDisposer()
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/** throws WeriftError unless tracks is exactly one Opus audio track */
|
|
58
|
+
static validateTracks(tracks) {
|
|
59
|
+
OggFactory.validateNumOfTracks(tracks.length);
|
|
60
|
+
for (const track of tracks) {
|
|
61
|
+
OggFactory.validateTrack(track);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
static validateNumOfTracks(numOfTracks) {
|
|
65
|
+
if (numOfTracks !== 1) {
|
|
66
|
+
throw new __1.WeriftError({
|
|
67
|
+
message: `ogg recording supports exactly one audio track, got ${numOfTracks}`,
|
|
68
|
+
payload: { numOfTracks },
|
|
69
|
+
path: sourcePath,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
static validateTrack(track) {
|
|
74
|
+
if (track.kind !== "audio") {
|
|
75
|
+
throw new __1.WeriftError({
|
|
76
|
+
message: `ogg recording does not support ${track.kind} tracks`,
|
|
77
|
+
payload: { kind: track.kind },
|
|
78
|
+
path: sourcePath,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
const codec = track.codec?.name.toLowerCase();
|
|
82
|
+
if (codec !== undefined && codec !== "opus") {
|
|
83
|
+
throw new __1.WeriftError({
|
|
84
|
+
message: `ogg recording supports only opus, got ${track.codec?.name}`,
|
|
85
|
+
payload: { codec: track.codec?.name },
|
|
86
|
+
path: sourcePath,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
async start(tracks) {
|
|
91
|
+
try {
|
|
92
|
+
await this.startPipeline(tracks);
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
this.running = false;
|
|
96
|
+
this.unSubscribers.dispose();
|
|
97
|
+
for (const source of this.rtpSources) {
|
|
98
|
+
source.stop();
|
|
99
|
+
}
|
|
100
|
+
throw error;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
async startPipeline(tracks) {
|
|
104
|
+
OggFactory.validateTracks(tracks);
|
|
105
|
+
const [track] = tracks;
|
|
106
|
+
if (track.codec?.name.toLowerCase() !== "opus") {
|
|
107
|
+
throw new __1.WeriftError({
|
|
108
|
+
message: "ogg recording requires a negotiated opus codec",
|
|
109
|
+
payload: { codec: track.codec?.name },
|
|
110
|
+
path: sourcePath,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
// set before the pipeline can emit, so an early write failure clears it
|
|
114
|
+
this.running = true;
|
|
115
|
+
const channels = track.codec.channels === 1 ? 1 : 2;
|
|
116
|
+
const ogg = new rtpExtra_1.OggCallback({ channels });
|
|
117
|
+
ogg.onError.once((error) => {
|
|
118
|
+
this.running = false;
|
|
119
|
+
ogg.destroy();
|
|
120
|
+
// the recording is dead: stop feeding it RTP / RTCP
|
|
121
|
+
this.unSubscribers.dispose();
|
|
122
|
+
for (const source of this.rtpSources) {
|
|
123
|
+
source.stop();
|
|
124
|
+
}
|
|
125
|
+
this.onEol.execute();
|
|
126
|
+
this.onError.execute(error);
|
|
127
|
+
});
|
|
128
|
+
const clockRate = 48000;
|
|
129
|
+
const rtpSource = new rtpExtra_1.RtpSourceCallback();
|
|
130
|
+
const rtcpSource = new rtpExtra_1.RtcpSourceCallback();
|
|
131
|
+
track.onReceiveRtp
|
|
132
|
+
.subscribe((rtp) => {
|
|
133
|
+
rtpSource.input(rtp.clone());
|
|
134
|
+
})
|
|
135
|
+
.disposer(this.unSubscribers);
|
|
136
|
+
track.onReceiveRtcp
|
|
137
|
+
.subscribe((rtcp) => {
|
|
138
|
+
rtcpSource.input(rtcp);
|
|
139
|
+
})
|
|
140
|
+
.disposer(this.unSubscribers);
|
|
141
|
+
const time = this.props.disableNtp
|
|
142
|
+
? new rtpExtra_1.RtpTimeCallback(clockRate)
|
|
143
|
+
: new rtpExtra_1.NtpTimeCallback(clockRate);
|
|
144
|
+
const depacketizer = new rtpExtra_1.DepacketizeCallback("OPUS");
|
|
145
|
+
// reorders packets so late audio is not written after its gap was filled
|
|
146
|
+
const jitterBuffer = new rtpExtra_1.JitterBufferCallback(clockRate, this.props.jitterBuffer ?? {});
|
|
147
|
+
rtpSource.pipe(jitterBuffer.input);
|
|
148
|
+
jitterBuffer.pipe(time.input);
|
|
149
|
+
rtcpSource.pipe(time.input);
|
|
150
|
+
time.pipe(depacketizer.input);
|
|
151
|
+
depacketizer.pipe(ogg.inputAudio);
|
|
152
|
+
this.rtpSources = [rtpSource];
|
|
153
|
+
if (this.props.path) {
|
|
154
|
+
const save = (0, rtpExtra_1.saveOggToFileSystem)(this.props.path);
|
|
155
|
+
ogg.pipe(async (o) => {
|
|
156
|
+
const eol = await save(o);
|
|
157
|
+
if (this.props.stream) {
|
|
158
|
+
this.props.stream.execute(o);
|
|
159
|
+
}
|
|
160
|
+
if (eol) {
|
|
161
|
+
this.running = false;
|
|
162
|
+
this.onEol.execute();
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
else if (this.props.stream) {
|
|
167
|
+
ogg.pipe(async (o) => {
|
|
168
|
+
this.props.stream.execute(o);
|
|
169
|
+
if (o.eol) {
|
|
170
|
+
this.running = false;
|
|
171
|
+
this.onEol.execute();
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
async stop() {
|
|
177
|
+
await Promise.all(this.rtpSources.map((r) => r.stop()));
|
|
178
|
+
if (this.running) {
|
|
179
|
+
await this.onEol.asPromise(5000).catch((e) => e);
|
|
180
|
+
}
|
|
181
|
+
this.unSubscribers.dispose();
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
exports.OggFactory = OggFactory;
|
|
185
|
+
//# sourceMappingURL=ogg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ogg.js","sourceRoot":"","sources":["../../../../../../src/nonstandard/recorder/writer/ogg.ts"],"names":[],"mappings":";;;AAAA,gCAA8D;AAC9D,oDAA+D;AAC/D,wDAUmC;AACnC,wBAAgC;AAEhC,MAAM,UAAU,GAAG,wDAAwD,CAAC;AAE5E;;;;;;;GAOG;AACH,MAAa,UAAW,SAAQ,cAAsB;IAAtD;;QACE;;;;mBAAkC,EAAE;WAAC;QAC7B;;;;mBAAQ,IAAI,cAAK,EAAE;WAAC;QAC5B;;;;WAIG;QACK;;;;mBAAU,KAAK;WAAC;QACxB,+DAA+D;QAC/D;;;;mBAAU,IAAI,cAAK,EAAW;WAAC;QAC/B;;;;mBAAgB,IAAI,sBAAa,EAAE;WAAC;IA2ItC,CAAC;IAzIC,uEAAuE;IACvE,MAAM,CAAC,cAAc,CAAC,MAA0B;QAC9C,UAAU,CAAC,mBAAmB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC9C,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;IAED,MAAM,CAAC,mBAAmB,CAAC,WAAmB;QAC5C,IAAI,WAAW,KAAK,CAAC,EAAE,CAAC;YACtB,MAAM,IAAI,eAAW,CAAC;gBACpB,OAAO,EAAE,uDAAuD,WAAW,EAAE;gBAC7E,OAAO,EAAE,EAAE,WAAW,EAAE;gBACxB,IAAI,EAAE,UAAU;aACjB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,MAAM,CAAC,aAAa,CAAC,KAAuB;QAC1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,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;gBAC/B,CAAC;gBACD,IAAI,GAAG,EAAE,CAAC;oBACR,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;oBACrB,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;gBACvB,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;aAAM,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YAC7B,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;gBACnB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;gBAC7B,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC;oBACV,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;oBACrB,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;gBACvB,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,KAAK,CAAC,IAAI;QACR,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAExD,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QACnD,CAAC;QACD,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;IAC/B,CAAC;CACF;AAtJD,gCAsJC","sourcesContent":["import { type MediaStreamTrack, WeriftError } from \"../../..\";\nimport { Event, EventDisposer } from \"../../../imports/common\";\nimport {\n DepacketizeCallback,\n JitterBufferCallback,\n NtpTimeCallback,\n OggCallback,\n type OggOutput,\n RtcpSourceCallback,\n RtpSourceCallback,\n RtpTimeCallback,\n saveOggToFileSystem,\n} from \"../../../imports/rtpExtra\";\nimport { MediaWriter } from \".\";\n\nconst sourcePath = \"packages/webrtc/src/nonstandard/recorder/writer/ogg.ts\";\n\n/**\n * Records one Opus audio track into an Ogg Opus file (RFC 7845).\n *\n * The pipeline is the audio branch of WebmFactory without LipsyncCallback:\n * a single audio track has nothing to synchronize with, so `disableLipSync`\n * and `lipsync` are ignored. `width`, `height`, `roll` and `defaultDuration`\n * are ignored as well.\n */\nexport class OggFactory extends MediaWriter<OggOutput> {\n rtpSources: RtpSourceCallback[] = [];\n private onEol = new Event();\n /**\n * true while an eol is still to come: set once the pipeline is running and\n * cleared when it ends. stop() waits for the eol only in this state, so a\n * recording that never started or failed to start stops immediately\n */\n private running = false;\n /** a write failure stops the recording and is reported here */\n onError = new Event<[Error]>();\n unSubscribers = new EventDisposer();\n\n /** throws WeriftError unless tracks is exactly one Opus audio track */\n static validateTracks(tracks: MediaStreamTrack[]) {\n OggFactory.validateNumOfTracks(tracks.length);\n for (const track of tracks) {\n OggFactory.validateTrack(track);\n }\n }\n\n static validateNumOfTracks(numOfTracks: number) {\n if (numOfTracks !== 1) {\n throw new WeriftError({\n message: `ogg recording supports exactly one audio track, got ${numOfTracks}`,\n payload: { numOfTracks },\n path: sourcePath,\n });\n }\n }\n\n static validateTrack(track: MediaStreamTrack) {\n if (track.kind !== \"audio\") {\n throw new WeriftError({\n message: `ogg recording does not support ${track.kind} tracks`,\n payload: { kind: track.kind },\n path: sourcePath,\n });\n }\n const codec = track.codec?.name.toLowerCase();\n if (codec !== undefined && codec !== \"opus\") {\n throw new WeriftError({\n message: `ogg recording supports only opus, got ${track.codec?.name}`,\n payload: { codec: track.codec?.name },\n path: sourcePath,\n });\n }\n }\n\n async start(tracks: MediaStreamTrack[]) {\n try {\n await this.startPipeline(tracks);\n } catch (error) {\n this.running = false;\n this.unSubscribers.dispose();\n for (const source of this.rtpSources) {\n source.stop();\n }\n throw error;\n }\n }\n\n private async startPipeline(tracks: MediaStreamTrack[]) {\n OggFactory.validateTracks(tracks);\n const [track] = tracks;\n if (track.codec?.name.toLowerCase() !== \"opus\") {\n throw new WeriftError({\n message: \"ogg recording requires a negotiated opus codec\",\n payload: { codec: track.codec?.name },\n path: sourcePath,\n });\n }\n\n // set before the pipeline can emit, so an early write failure clears it\n this.running = true;\n const channels = track.codec.channels === 1 ? 1 : 2;\n const ogg = new OggCallback({ channels });\n ogg.onError.once((error) => {\n this.running = false;\n ogg.destroy();\n // the recording is dead: stop feeding it RTP / RTCP\n this.unSubscribers.dispose();\n for (const source of this.rtpSources) {\n source.stop();\n }\n this.onEol.execute();\n this.onError.execute(error);\n });\n const clockRate = 48000;\n\n const rtpSource = new RtpSourceCallback();\n const rtcpSource = new RtcpSourceCallback();\n track.onReceiveRtp\n .subscribe((rtp) => {\n rtpSource.input(rtp.clone());\n })\n .disposer(this.unSubscribers);\n track.onReceiveRtcp\n .subscribe((rtcp) => {\n rtcpSource.input(rtcp);\n })\n .disposer(this.unSubscribers);\n const time = this.props.disableNtp\n ? new RtpTimeCallback(clockRate)\n : new NtpTimeCallback(clockRate);\n const depacketizer = new DepacketizeCallback(\"OPUS\");\n\n // reorders packets so late audio is not written after its gap was filled\n const jitterBuffer = new JitterBufferCallback(\n clockRate,\n this.props.jitterBuffer ?? {},\n );\n rtpSource.pipe(jitterBuffer.input);\n jitterBuffer.pipe(time.input);\n rtcpSource.pipe(time.input);\n time.pipe(depacketizer.input);\n depacketizer.pipe(ogg.inputAudio);\n this.rtpSources = [rtpSource];\n\n if (this.props.path) {\n const save = saveOggToFileSystem(this.props.path);\n ogg.pipe(async (o) => {\n const eol = await save(o);\n if (this.props.stream) {\n this.props.stream.execute(o);\n }\n if (eol) {\n this.running = false;\n this.onEol.execute();\n }\n });\n } else if (this.props.stream) {\n ogg.pipe(async (o) => {\n this.props.stream.execute(o);\n if (o.eol) {\n this.running = false;\n this.onEol.execute();\n }\n });\n }\n }\n\n async stop() {\n await Promise.all(this.rtpSources.map((r) => r.stop()));\n\n if (this.running) {\n await this.onEol.asPromise(5000).catch((e) => e);\n }\n this.unSubscribers.dispose();\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { EventDisposer } from "../../../imports/common";
|
|
2
|
-
import { MediaWriter } from ".";
|
|
3
1
|
import { type MediaStreamTrack } from "../../..";
|
|
2
|
+
import { EventDisposer } from "../../../imports/common";
|
|
4
3
|
import { RtpSourceCallback } from "../../../imports/rtpExtra";
|
|
4
|
+
import { MediaWriter } from ".";
|
|
5
5
|
export declare class WebmFactory extends MediaWriter {
|
|
6
6
|
rtpSources: RtpSourceCallback[];
|
|
7
7
|
private onEol;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WebmFactory = void 0;
|
|
4
4
|
const promises_1 = require("fs/promises");
|
|
5
|
-
const common_1 = require("../../../imports/common");
|
|
6
|
-
const _1 = require(".");
|
|
7
5
|
const __1 = require("../../..");
|
|
6
|
+
const common_1 = require("../../../imports/common");
|
|
8
7
|
const rtpExtra_1 = require("../../../imports/rtpExtra");
|
|
8
|
+
const _1 = require(".");
|
|
9
9
|
const sourcePath = "packages/webrtc/src/nonstandard/recorder/writer/webm.ts";
|
|
10
10
|
class WebmFactory extends _1.MediaWriter {
|
|
11
11
|
constructor() {
|
|
@@ -87,12 +87,19 @@ class WebmFactory extends _1.MediaWriter {
|
|
|
87
87
|
const webm = new rtpExtra_1.WebmCallback(inputTracks, {
|
|
88
88
|
duration: this.props.defaultDuration ?? 1000 * 60 * 60 * 24,
|
|
89
89
|
});
|
|
90
|
-
const lipsync = new rtpExtra_1.LipsyncCallback(
|
|
90
|
+
const lipsync = new rtpExtra_1.LipsyncCallback({
|
|
91
|
+
...this.props.lipsync,
|
|
92
|
+
// wait only for the kinds being recorded, so a video-only recording
|
|
93
|
+
// starts on its first frame
|
|
94
|
+
kinds: [...new Set(inputTracks.map(({ kind }) => kind))],
|
|
95
|
+
});
|
|
91
96
|
this.rtpSources = inputTracks.map(({ track, clockRate, codec }) => {
|
|
92
97
|
const rtpSource = new rtpExtra_1.RtpSourceCallback();
|
|
93
98
|
const rtcpSource = new rtpExtra_1.RtcpSourceCallback();
|
|
94
99
|
track.onReceiveRtp
|
|
95
100
|
.subscribe((rtp) => {
|
|
101
|
+
// Padding-only GCC probes stay in the jitter buffer for sequence
|
|
102
|
+
// continuity; DepacketizeBase drops them before codec parse.
|
|
96
103
|
rtpSource.input(rtp.clone());
|
|
97
104
|
})
|
|
98
105
|
.disposer(this.unSubscribers);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webm.js","sourceRoot":"","sources":["../../../../../../src/nonstandard/recorder/writer/webm.ts"],"names":[],"mappings":";;;AAAA,0CAAqC;AACrC,oDAA+D;AAE/D,wBAAgC;AAChC,gCAA8D;AAC9D,wDAYmC;AAEnC,MAAM,UAAU,GAAG,yDAAyD,CAAC;AAE7E,MAAa,WAAY,SAAQ,cAAW;IAA5C;;QACE;;;;mBAAkC,EAAE;WAAC;QAC7B;;;;mBAAQ,IAAI,cAAK,EAAE;WAAC;QACpB;;;;mBAAQ,KAAK;WAAC;QACtB;;;;mBAAgB,IAAI,sBAAa,EAAE;WAAC;IA4ItC,CAAC;IA1IC,KAAK,CAAC,KAAK,CAAC,MAA0B;QACpC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;YACpB,MAAM,IAAA,iBAAM,EAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QAChD,CAAC;QAED,MAAM,WAAW,GAAgD,MAAM,CAAC,GAAG,CACzE,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;YACX,MAAM,WAAW,GAAG,CAAC,GAAG,CAAC,CAAC;YAC1B,MAAM,WAAW,GAAG,KAAK,CAAC,KAAM,CAAC,WAAW,CAAC;YAE7C,I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AAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;gBACvD,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;oBACtB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;gBAC/B,CAAC;gBACD,IAAI,GAAG,EAAE,CAAC;oBACR,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;oBACrB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;gBACpB,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;aAAM,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YAC7B,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;gBACpB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAC/B,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,KAAK,CAAC,IAAI;QACR,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAExD,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QACnD,CAAC;QACD,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;IAC/B,CAAC;CACF;AAhJD,kCAgJC;AAED,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAU,CAAC","sourcesContent":["import { unlink } from \"fs/promises\";\nimport { Event, EventDisposer } from \"../../../imports/common\";\n\nimport { MediaWriter } from \".\";\nimport { type MediaStreamTrack, WeriftError } from \"../../..\";\nimport {\n DepacketizeCallback,\n JitterBufferCallback,\n LipsyncCallback,\n NtpTimeCallback,\n RtcpSourceCallback,\n RtpSourceCallback,\n RtpTimeCallback,\n WebmCallback,\n type WebmSupportedCodec,\n type WebmTrack,\n saveToFileSystem,\n} from \"../../../imports/rtpExtra\";\n\nconst sourcePath = \"packages/webrtc/src/nonstandard/recorder/writer/webm.ts\";\n\nexport class WebmFactory extends MediaWriter {\n rtpSources: RtpSourceCallback[] = [];\n private onEol = new Event();\n private ended = false;\n unSubscribers = new EventDisposer();\n\n async start(tracks: MediaStreamTrack[]) {\n if (this.props.path) {\n await unlink(this.props.path).catch((e) => e);\n }\n\n const inputTracks: (WebmTrack & { track: MediaStreamTrack })[] = tracks.map(\n (track, i) => {\n const trackNumber = i + 1;\n const payloadType = track.codec!.payloadType;\n\n if (track.kind === \"video\") {\n const codec = ((): WebmSupportedCodec => {\n switch (track.codec?.name.toLowerCase() as SupportedVideoCodec) {\n case \"vp8\":\n return \"VP8\";\n case \"vp9\":\n return \"VP9\";\n case \"h264\":\n return \"MPEG4/ISO/AVC\";\n case \"av1\":\n case \"av1x\":\n return \"AV1\";\n default:\n throw new WeriftError({\n message: \"unsupported codec\",\n payload: { track, path: sourcePath },\n });\n }\n })();\n return {\n kind: \"video\" as const,\n codec,\n clockRate: 90000,\n trackNumber,\n width: this.props.width ?? 640,\n height: this.props.height ?? 360,\n roll: this.props.roll,\n payloadType,\n track,\n };\n } else {\n return {\n kind: \"audio\" as const,\n codec: \"OPUS\" as const,\n clockRate: 48000,\n trackNumber,\n payloadType,\n track,\n };\n }\n },\n );\n\n const webm = new WebmCallback(inputTracks, {\n duration: this.props.defaultDuration ?? 1000 * 60 * 60 * 24,\n });\n const lipsync = new LipsyncCallback(this.props.lipsync ?? {});\n\n this.rtpSources = inputTracks.map(({ track, clockRate, codec }) => {\n const rtpSource = new RtpSourceCallback();\n const rtcpSource = new RtcpSourceCallback();\n track.onReceiveRtp\n .subscribe((rtp) => {\n rtpSource.input(rtp.clone());\n })\n .disposer(this.unSubscribers);\n track.onReceiveRtcp\n .subscribe((rtcp) => {\n rtcpSource.input(rtcp);\n })\n .disposer(this.unSubscribers);\n const time = this.props.disableNtp\n ? new RtpTimeCallback(clockRate)\n : new NtpTimeCallback(clockRate);\n\n if (track.kind === \"video\") {\n const depacketizer = new DepacketizeCallback(codec, {\n isFinalPacketInSequence: (h) => h.marker,\n });\n const jitterBuffer = new JitterBufferCallback(\n clockRate,\n this.props.jitterBuffer ?? {},\n );\n\n rtpSource.pipe(jitterBuffer.input);\n rtcpSource.pipe(time.input);\n\n jitterBuffer.pipe(time.input);\n time.pipe(depacketizer.input);\n if (this.props.disableLipSync) {\n depacketizer.pipe(webm.inputVideo);\n } else {\n depacketizer.pipe(lipsync.inputVideo);\n lipsync.pipeVideo(webm.inputVideo);\n }\n } else {\n const depacketizer = new DepacketizeCallback(codec);\n\n rtpSource.pipe(time.input);\n rtcpSource.pipe(time.input);\n\n time.pipe(depacketizer.input);\n if (this.props.disableLipSync) {\n depacketizer.pipe(webm.inputAudio);\n } else {\n depacketizer.pipe(lipsync.inputAudio);\n lipsync.pipeAudio(webm.inputAudio);\n }\n }\n\n return rtpSource;\n });\n if (this.props.path) {\n webm.pipe(async (o) => {\n const eol = await saveToFileSystem(this.props.path)(o);\n if (this.props.stream) {\n this.props.stream.execute(o);\n }\n if (eol) {\n this.onEol.execute();\n this.ended = true;\n }\n });\n } else if (this.props.stream) {\n webm.pipe(async (o) => {\n this.props.stream.execute(o);\n });\n }\n }\n\n async stop() {\n await Promise.all(this.rtpSources.map((r) => r.stop()));\n\n if (!this.ended) {\n await this.onEol.asPromise(5000).catch((e) => e);\n }\n this.unSubscribers.dispose();\n }\n}\n\nconst supportedVideoCodecs = [\"h264\", \"vp8\", \"vp9\", \"av1\", \"av1x\"] as const;\ntype SupportedVideoCodec = (typeof supportedVideoCodecs)[number];\n"]}
|
|
1
|
+
{"version":3,"file":"webm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AAC;gBACD,IAAI,GAAG,EAAE,CAAC;oBACR,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;oBACrB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;gBACpB,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;aAAM,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YAC7B,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;gBACpB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAC/B,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,KAAK,CAAC,IAAI;QACR,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAExD,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QACnD,CAAC;QACD,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;IAC/B,CAAC;CACF;AAvJD,kCAuJC;AAED,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAU,CAAC","sourcesContent":["import { unlink } from \"fs/promises\";\nimport { type MediaStreamTrack, WeriftError } from \"../../..\";\nimport { Event, EventDisposer } from \"../../../imports/common\";\nimport {\n DepacketizeCallback,\n JitterBufferCallback,\n LipsyncCallback,\n NtpTimeCallback,\n RtcpSourceCallback,\n RtpSourceCallback,\n RtpTimeCallback,\n saveToFileSystem,\n WebmCallback,\n type WebmSupportedCodec,\n type WebmTrack,\n} from \"../../../imports/rtpExtra\";\nimport { MediaWriter } from \".\";\n\nconst sourcePath = \"packages/webrtc/src/nonstandard/recorder/writer/webm.ts\";\n\nexport class WebmFactory extends MediaWriter {\n rtpSources: RtpSourceCallback[] = [];\n private onEol = new Event();\n private ended = false;\n unSubscribers = new EventDisposer();\n\n async start(tracks: MediaStreamTrack[]) {\n if (this.props.path) {\n await unlink(this.props.path).catch((e) => e);\n }\n\n const inputTracks: (WebmTrack & { track: MediaStreamTrack })[] = tracks.map(\n (track, i) => {\n const trackNumber = i + 1;\n const payloadType = track.codec!.payloadType;\n\n if (track.kind === \"video\") {\n const codec = ((): WebmSupportedCodec => {\n switch (track.codec?.name.toLowerCase() as SupportedVideoCodec) {\n case \"vp8\":\n return \"VP8\";\n case \"vp9\":\n return \"VP9\";\n case \"h264\":\n return \"MPEG4/ISO/AVC\";\n case \"av1\":\n case \"av1x\":\n return \"AV1\";\n default:\n throw new WeriftError({\n message: \"unsupported codec\",\n payload: { track, path: sourcePath },\n });\n }\n })();\n return {\n kind: \"video\" as const,\n codec,\n clockRate: 90000,\n trackNumber,\n width: this.props.width ?? 640,\n height: this.props.height ?? 360,\n roll: this.props.roll,\n payloadType,\n track,\n };\n } else {\n return {\n kind: \"audio\" as const,\n codec: \"OPUS\" as const,\n clockRate: 48000,\n trackNumber,\n payloadType,\n track,\n };\n }\n },\n );\n\n const webm = new WebmCallback(inputTracks, {\n duration: this.props.defaultDuration ?? 1000 * 60 * 60 * 24,\n });\n const lipsync = new LipsyncCallback({\n ...this.props.lipsync,\n // wait only for the kinds being recorded, so a video-only recording\n // starts on its first frame\n kinds: [...new Set(inputTracks.map(({ kind }) => kind))],\n });\n\n this.rtpSources = inputTracks.map(({ track, clockRate, codec }) => {\n const rtpSource = new RtpSourceCallback();\n const rtcpSource = new RtcpSourceCallback();\n track.onReceiveRtp\n .subscribe((rtp) => {\n // Padding-only GCC probes stay in the jitter buffer for sequence\n // continuity; DepacketizeBase drops them before codec parse.\n rtpSource.input(rtp.clone());\n })\n .disposer(this.unSubscribers);\n track.onReceiveRtcp\n .subscribe((rtcp) => {\n rtcpSource.input(rtcp);\n })\n .disposer(this.unSubscribers);\n const time = this.props.disableNtp\n ? new RtpTimeCallback(clockRate)\n : new NtpTimeCallback(clockRate);\n\n if (track.kind === \"video\") {\n const depacketizer = new DepacketizeCallback(codec, {\n isFinalPacketInSequence: (h) => h.marker,\n });\n const jitterBuffer = new JitterBufferCallback(\n clockRate,\n this.props.jitterBuffer ?? {},\n );\n\n rtpSource.pipe(jitterBuffer.input);\n rtcpSource.pipe(time.input);\n\n jitterBuffer.pipe(time.input);\n time.pipe(depacketizer.input);\n if (this.props.disableLipSync) {\n depacketizer.pipe(webm.inputVideo);\n } else {\n depacketizer.pipe(lipsync.inputVideo);\n lipsync.pipeVideo(webm.inputVideo);\n }\n } else {\n const depacketizer = new DepacketizeCallback(codec);\n\n rtpSource.pipe(time.input);\n rtcpSource.pipe(time.input);\n\n time.pipe(depacketizer.input);\n if (this.props.disableLipSync) {\n depacketizer.pipe(webm.inputAudio);\n } else {\n depacketizer.pipe(lipsync.inputAudio);\n lipsync.pipeAudio(webm.inputAudio);\n }\n }\n\n return rtpSource;\n });\n if (this.props.path) {\n webm.pipe(async (o) => {\n const eol = await saveToFileSystem(this.props.path)(o);\n if (this.props.stream) {\n this.props.stream.execute(o);\n }\n if (eol) {\n this.onEol.execute();\n this.ended = true;\n }\n });\n } else if (this.props.stream) {\n webm.pipe(async (o) => {\n this.props.stream.execute(o);\n });\n }\n }\n\n async stop() {\n await Promise.all(this.rtpSources.map((r) => r.stop()));\n\n if (!this.ended) {\n await this.onEol.asPromise(5000).catch((e) => e);\n }\n this.unSubscribers.dispose();\n }\n}\n\nconst supportedVideoCodecs = [\"h264\", \"vp8\", \"vp9\", \"av1\", \"av1x\"] as const;\ntype SupportedVideoCodec = (typeof supportedVideoCodecs)[number];\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { EncodedPacket } from "mediabunny";
|
|
1
2
|
import { type RtpPacket } from "../../imports/rtp";
|
|
2
3
|
import type { RTCRtpCodecParameters } from "../../media/parameters";
|
|
3
|
-
import type { EncodedPacket } from "mediabunny";
|
|
4
4
|
export { Vp8Packetizer } from "../../imports/rtp";
|
|
5
5
|
export declare const supportedSourceCodecs: readonly ["avc", "vp8", "vp9", "av1", "opus"];
|
|
6
6
|
export type SupportedSourceCodec = (typeof supportedSourceCodecs)[number];
|
|
@@ -12,5 +12,5 @@ export declare function toSupportedMimeType(codec: SupportedSourceCodec): Suppor
|
|
|
12
12
|
export declare function createPacketizer({ codec, sourceCodec, decoderDescription, }: {
|
|
13
13
|
codec: RTCRtpCodecParameters;
|
|
14
14
|
sourceCodec: SupportedSourceCodec;
|
|
15
|
-
decoderDescription?:
|
|
15
|
+
decoderDescription?: ArrayBufferLike | ArrayBufferView<ArrayBufferLike> | null;
|
|
16
16
|
}): Packetizer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packetizer.js","sourceRoot":"","sources":["../../../../../src/nonstandard/userMedia/packetizer.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,wEAAwE;AACxE,uEAAuE;;;
|
|
1
|
+
{"version":3,"file":"packetizer.js","sourceRoot":"","sources":["../../../../../src/nonstandard/userMedia/packetizer.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,wEAAwE;AACxE,uEAAuE;;;AAsCvE,kDAeC;AAED,4CAkFC;AAtID,2CAQ2B;AAG3B,yCAAkD;AAAzC,oGAAA,aAAa,OAAA;AAEtB,MAAM,4BAA4B,GAAG,IAAK,CAAC;AAE9B,QAAA,qBAAqB,GAAG;IACnC,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,MAAM;CACE,CAAC;AAcX,SAAgB,mBAAmB,CACjC,KAA2B;IAE3B,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,KAAK;YACR,OAAO,YAAY,CAAC;QACtB,KAAK,KAAK;YACR,OAAO,WAAW,CAAC;QACrB,KAAK,KAAK;YAC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I,CAAC,EAAE,YAAY,CAAC,CAAC;gBACnE,CAAC;aACF,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,wBAAwB,CAAC,UAAmB;IACnD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,CAAC,CAAC;IACX,CAAC;IAED,MAAM,iBAAiB,GAAG,UAAU;SACjC,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SAC1B,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC,CAAC;IAE1D,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,OAAO,CAAC,CAAC;IACX,CAAC;IAED,OAAO,MAAM,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,SAAS,QAAQ,CAAC,IAAgB;IAChC,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;AACpE,CAAC","sourcesContent":["// EncodedPacket adapters over the packages/rtp packetizers.\n// Codec payload formats live in packages/rtp; this file maps mediabunny\n// EncodedPacket (data + key/delta) and SDP codec parameters onto them.\n\nimport type { EncodedPacket } from \"mediabunny\";\nimport {\n Av1Packetizer,\n H264Packetizer,\n OpusPacketizer,\n parseAvcDecoderConfigurationRecord,\n type RtpPacket,\n Vp8Packetizer,\n Vp9Packetizer,\n} from \"../../imports/rtp\";\nimport type { RTCRtpCodecParameters } from \"../../media/parameters\";\n\nexport { Vp8Packetizer } from \"../../imports/rtp\";\n\nconst DEFAULT_MAX_RTP_PAYLOAD_SIZE = 1_200;\n\nexport const supportedSourceCodecs = [\n \"avc\",\n \"vp8\",\n \"vp9\",\n \"av1\",\n \"opus\",\n] as const;\nexport type SupportedSourceCodec = (typeof supportedSourceCodecs)[number];\n\ntype SupportedMimeType =\n | \"video/h264\"\n | \"video/vp8\"\n | \"video/vp9\"\n | \"video/av1x\"\n | \"audio/opus\";\n\nexport interface Packetizer {\n packetize(packet: EncodedPacket, rtpTimestamp: number): RtpPacket[];\n}\n\nexport function toSupportedMimeType(\n codec: SupportedSourceCodec,\n): SupportedMimeType {\n switch (codec) {\n case \"avc\":\n return \"video/h264\";\n case \"vp8\":\n return \"video/vp8\";\n case \"vp9\":\n return \"video/vp9\";\n case \"av1\":\n return \"video/av1x\";\n case \"opus\":\n return \"audio/opus\";\n }\n}\n\nexport function createPacketizer({\n codec,\n sourceCodec,\n decoderDescription,\n}: {\n codec: RTCRtpCodecParameters;\n sourceCodec: SupportedSourceCodec;\n decoderDescription?:\n | ArrayBufferLike\n | ArrayBufferView<ArrayBufferLike>\n | null;\n}): Packetizer {\n const options = {\n payloadType: codec.payloadType ?? 96,\n maxPayloadSize: DEFAULT_MAX_RTP_PAYLOAD_SIZE,\n };\n\n switch (sourceCodec) {\n case \"avc\": {\n const packetizationMode = getH264PacketizationMode(codec.parameters);\n if (packetizationMode !== 1) {\n throw new Error(\n `Unsupported H264 packetization-mode=${packetizationMode}. File playback requires packetization-mode=1.`,\n );\n }\n const avcConfig = decoderDescription\n ? parseAvcDecoderConfigurationRecord(decoderDescription)\n : undefined;\n const packetizer = new H264Packetizer({\n ...options,\n naluLengthSize: avcConfig?.naluLengthSize,\n parameterSets: avcConfig?.parameterSets,\n // avcC means container (AVCC) samples; never guess Annex-B from bytes\n inputFormat: avcConfig ? \"length-prefixed\" : \"auto\",\n });\n return {\n packetize: (packet, rtpTimestamp) =>\n packetizer.packetize(toBuffer(packet.data), rtpTimestamp, {\n isKeyframe: packet.type === \"key\",\n }),\n };\n }\n case \"vp8\": {\n const packetizer = new Vp8Packetizer(options);\n return {\n packetize: (packet, rtpTimestamp) =>\n packetizer.packetize(toBuffer(packet.data), rtpTimestamp),\n };\n }\n case \"vp9\": {\n const packetizer = new Vp9Packetizer(options);\n return {\n packetize: (packet, rtpTimestamp) =>\n packetizer.packetize(toBuffer(packet.data), rtpTimestamp, {\n frameType: packet.type,\n }),\n };\n }\n case \"av1\": {\n const packetizer = new Av1Packetizer(options);\n return {\n packetize: (packet, rtpTimestamp) =>\n packetizer.packetize(toBuffer(packet.data), rtpTimestamp, {\n frameType: packet.type,\n // Sources may carry the sequence header only out of band (av1C),\n // so every key packet starts a coded video sequence (N=1).\n startsNewCodedVideoSequence: packet.type === \"key\",\n }),\n };\n }\n case \"opus\": {\n const packetizer = new OpusPacketizer(options);\n return {\n packetize: (packet, rtpTimestamp) => {\n // userMedia has always marked every Opus packet; receivers split\n // audio frames on the marker, so keep that instead of talkspurts.\n packetizer.startTalkspurt();\n return packetizer.packetize(toBuffer(packet.data), rtpTimestamp);\n },\n };\n }\n }\n}\n\nfunction getH264PacketizationMode(parameters?: string) {\n if (!parameters) {\n return 1;\n }\n\n const packetizationMode = parameters\n .split(\";\")\n .map((part) => part.trim())\n .find((part) => part.startsWith(\"packetization-mode=\"));\n\n if (!packetizationMode) {\n return 1;\n }\n\n return Number(packetizationMode.split(\"=\")[1] ?? 1);\n}\n\nfunction toBuffer(data: Uint8Array) {\n return Buffer.from(data.buffer, data.byteOffset, data.byteLength);\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Readable } from "stream";
|
|
2
1
|
import { Input, type InputTrack } from "mediabunny";
|
|
2
|
+
import { Readable } from "stream";
|
|
3
3
|
import { Event } from "../imports/common";
|
|
4
4
|
import { MediaStreamTrack } from "../media/track";
|
|
5
5
|
import { type SupportedSourceCodec } from "./userMedia/packetizer";
|
|
@@ -62,7 +62,7 @@ interface PlaybackTrack {
|
|
|
62
62
|
inputTrack: InputTrack;
|
|
63
63
|
track: MediaStreamTrack;
|
|
64
64
|
sourceCodec: SupportedSourceCodec;
|
|
65
|
-
decoderDescription?:
|
|
65
|
+
decoderDescription?: ArrayBufferLike | ArrayBufferView<ArrayBufferLike> | null;
|
|
66
66
|
sourceChannels?: number;
|
|
67
67
|
}
|
|
68
68
|
interface PlaybackSession {
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createFileMediaPlayer = void 0;
|
|
4
4
|
const crypto_1 = require("crypto");
|
|
5
|
+
const promises_1 = require("fs/promises");
|
|
6
|
+
const mediabunny_1 = require("mediabunny");
|
|
5
7
|
const os_1 = require("os");
|
|
6
8
|
const path_1 = require("path");
|
|
7
9
|
const stream_1 = require("stream");
|
|
8
|
-
const promises_1 = require("fs/promises");
|
|
9
10
|
const promises_2 = require("timers/promises");
|
|
10
|
-
const mediabunny_1 = require("mediabunny");
|
|
11
11
|
const common_1 = require("../imports/common");
|
|
12
12
|
const codec_1 = require("../media/codec");
|
|
13
13
|
const codecCompatibility_1 = require("../media/codecCompatibility");
|
|
@@ -229,7 +229,7 @@ class TrackPlaybackRunner {
|
|
|
229
229
|
enumerable: true,
|
|
230
230
|
configurable: true,
|
|
231
231
|
writable: true,
|
|
232
|
-
value:
|
|
232
|
+
value: void 0
|
|
233
233
|
});
|
|
234
234
|
// Reused across loops so per-stream packetizer state (e.g. VP8 PictureID)
|
|
235
235
|
// stays continuous; recreated only when the negotiated codec changes.
|
|
@@ -239,6 +239,7 @@ class TrackPlaybackRunner {
|
|
|
239
239
|
writable: true,
|
|
240
240
|
value: void 0
|
|
241
241
|
});
|
|
242
|
+
this.props = props;
|
|
242
243
|
}
|
|
243
244
|
async play({ startedAt, signal, sourceChanged, }) {
|
|
244
245
|
const codec = this.requireNegotiatedCodec();
|