提交 d7b65168 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Clean up some doc files

上级 d669653d
# TODO in mediasoup v2 (server-side) # TODO in mediasoup v2 (server-side)
* Remove `seq32` everywhere and use the new seq counter/manager utils.
* `RtpStreamer` should have its own RTP capabilities rather than using the ones from the room. * `RtpStreamer` should have its own RTP capabilities rather than using the ones from the room.
* Instead of using `static_cast<size_t>(number)` use `size_t{ number }`. NOTE: Investigate it.
* Set a proper value for `Producer::FullFrameRequestBlockTimeout` (currently 1 second).
* Add `gulp lint/format/tidy` also for `worker/test/*`. * Add `gulp lint/format/tidy` also for `worker/test/*`.
* Rethink the auto close of the worker `Transport` when receiving a DTLS CLOSE ALERT (or when it's just TCP and the connection fails...). Yes/no? BTW it's generating some issues because the JS closes the Producer/Transport and gets `request failed [id:84026423, reason:"Consumer/Transport does not exist"]` (because it was already closed due to DTLS ALERT). * Rethink the auto close of the worker `Transport` when receiving a DTLS CLOSE ALERT (or when it's just TCP and the connection fails...). Yes/no? BTW it's generating some issues because the JS closes the Producer/Transport and gets `request failed [id:84026423, reason:"Consumer/Transport does not exist"]` (because it was already closed due to DTLS ALERT).
* Implement `mandatoryCodecPayloadTypes`. * Implement `mandatoryCodecPayloadTypes`.
* JS: Remove tons of useless debugs (for example in `Peer._createProducer()`). * Automate `compile_commands_template.json` generation.
* Update `compile_commands_template.json`.
# Room Overview
This documentation details how *mediasoup* rooms are created, how peers are added to the room, how `Producer` and `Consumer` instances are created/generated, and how RTP parameters are handled.
## Creating a Room
A `Room` is created by calling `server.createRoom(roomOptions)` where `roomOptions` is a mandatory object that must include a `mediaCodecs` array of media codecs supported by the room.
Each media codec must define some mandatory fields:
* `kind`: "audio"/"video"/"depth" or empty string which means all the kinds
* `name`: "audio/opus", etc
* `clockRate`: 48000, etc
Media codecs can also define some optional fields such as:
* `payloadType`: if not set, a random one is assigned
* `numChannels`: defaults to 1 except for Opus in which it defaults to 2
* `parameters`: needed for defining the `packetizationMode` for H264, etc
* `maxptime`
* `ptime`
Feature codecs ("video/rtx", "video/ulpfec", "video/flexfec" and "video/red") are **NOT** media codecs and hence MUST NOT be placed into `roomOptions.mediaCodecs` (they will be ignored if present).
Given media codecs are matched to the media codec configurations supported by mediasoup (check them at [lib/supportedRtpCapabilities.js](../lib/supportedRtpCapabilities.js)). No matching codecs are ignored.
At the end, the room `RtpCapabilities` object is a clone of the mediasoup's supported capabilities with the matching subset of given room media codecs.
And the room is done.
## Creating a Peer
A `Peer` is created by calling `room.Peer(name)`.
Once created, peer's capabilities must be set (otherwise no `Producer` can be created) by calling `peer.setCapabilities(capabilities)`. Those capabilities include codecs, RTP header extensions and FEC mechanisms.
These codecs have the same fields as the room codecs, with some variations:
* `payloadType` is ignored (it will be mapped to the same room codec).
* `rtcpFeedback` is optional.
After that, C++ `Room::onPeerCapabilities(capabilities)` is called. This method removes peer's codecs not supported by the room, removes the unsupported RTCP feedback mechanisms from the supported codecs, and removes RTP header extensions and FEC mechanisms not supported by mediasoup.
This is, peer's capabilities are a subset of the mediasoup capabilities and the room capabilities.
## Creating a Producer
A `Producer` is created by calling `peer.Producer(kind, transport)` where `kind` can be "audio", "video" or "depth", and `transport` must be a `Transport` instance previously created by the peer.
Once created, `producer.receive(parameters)` must be called (otherwise the `Producer` is ignored by the room. `parameters` is a `RtpParameters` object which the following fields:
* `muxId` is optional.
* `codecs` is mandatory.
* `encodings` is optional.
* `rtcp` is optional.
* `userParameters` is an optional object.
These codecs have the same fields as the peer's capabilities codecs above, with some variations:
* `kind` is ignored.
* `payloadType` MUST match the same value as the one set by the room (otherwise it will fail).
If `receive()` is called with a codec that is not supported by the room or not present in the peer's given capabilities, it fails.
Unsupported RTCP feedback mechanisms and RTP header extensions not supported by mediasoup or by the peer itself are removed.
Effective RTP parameters are returned to the `receive()` promise.
`Room::onPeerProducerParameters()` creates `Consumers` associated to this `Producer` (for every other `Peer` with its capabilities already set) by calling `Peer::AddConsumer()` on them.
`Peer::AddConsumer()` takes the associated `RtpParameters` of the `Producer` as parameter and call `Consumer::Send(parameters)`.
`Consumer::Send(parameters)` clones the given parameters and removes non supported codecs and non supported RTP header extensions.
*TODO:* This must be analyzed.
# Documentation # Documentation
Internal documentation for developming purposes. Get the *mediasoup* public documentetation at [mediasoup.org](https://mediasoup.org). Internal documentation for developming purposes. Get the **mediasoup** public documentation at [mediasoup.org](https://mediasoup.org).
* [Room Overview](RoomOverview.md) * [Building](Building.md)
* [RTCP](RTCP.md) * [RTCP](RTCP.md)
* [Consumer](Consumer.md)
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论