Audio Media. This is a lite wrapper class for audio conference bridge port, i.e: this class only maintains one data member, conference slot ID, and the methods are simply proxies for conference bridge operations.
Application can create a derived class and use registerMediaPort2()/ unregisterMediaPort() to register/unregister a media port to/from the conference bridge.
The library will not keep a list of AudioMedia instances, so any AudioMedia (descendant) instances instantiated by application must be maintained and destroyed by the application itself.
Note that any PJSUA2 APIs that return AudioMedia instance(s) such as Endpoint::mediaEnumPorts2() or Call::getAudioMedia() will just return generated copy. All AudioMedia methods should work normally on this generated copy instance.
void pj::AudioMedia::startTransmit |
( |
const AudioMedia & |
sink | ) |
const |
throw | ( | Error |
| ) | | |
Establish unidirectional media flow to sink. This media port will act as a source, and it may transmit to multiple destinations/sink. And if multiple sources are transmitting to the same sink, the media will be mixed together. Source and sink may refer to the same Media, effectively looping the media.
If bidirectional media flow is desired, application needs to call this method twice, with the second one called from the opposite source media.
- Parameters
-
sink | The destination Media. |
Establish unidirectional media flow to sink. This media port will act as a source, and it may transmit to multiple destinations/sink. And if multiple sources are transmitting to the same sink, the media will be mixed together. Source and sink may refer to the same Media, effectively looping the media.
Signal level from this source to the sink can be adjusted by making it louder or quieter via the parameter param. The level adjustment will apply to a specific connection only (i.e. only for signal from this source to the sink), as compared to adjustTxLevel()/adjustRxLevel() which applies to all signals from/to this media port. The signal adjustment will be cumulative, in this following order: signal from this source will be adjusted with the level specified in adjustTxLevel(), then with the level specified via this API, and finally with the level specified to the sink's adjustRxLevel().
If bidirectional media flow is desired, application needs to call this method twice, with the second one called from the opposite source media.
- Parameters
-
sink | The destination Media. |
param | The parameter. |