public class AudioMediaDeviceSession extends MediaDeviceSession
OUTPUT_DATA_SOURCE, outputSizeChanged, SSRC_LIST
Constructor and Description |
---|
AudioMediaDeviceSession(AbstractMediaDevice device)
Initializes a new MediaDeviceSession instance which is to
represent the use of a specific MediaDevice by a
MediaStream.
|
Modifier and Type | Method and Description |
---|---|
void |
copyPlayback(MediaDeviceSession deviceSession)
Copies the playback part of a specific MediaDeviceSession into
this instance.
|
protected javax.media.Processor |
createProcessor()
Performs additional configuration on the Processor, after it is
configured, but before it is realized.
|
protected javax.media.Renderer |
createRenderer(javax.media.Player player,
javax.media.control.TrackControl trackControl)
Initializes a Renderer instance which is to be utilized by a
specific Player in order to play back the media represented by
a specific TrackControl.
|
void |
enableOutputSSRCAudioLevels(boolean enabled,
byte extensionID)
Enables or disables measuring audio levels for the output
DataSource of this AudioMediaDeviceSession.
|
int |
getLastMeasuredAudioLevel(long ssrc)
Returns the last audio level that was measured by this device session
for the specified ssrc.
|
int |
getLastMeasuredLocalUserAudioLevel()
Returns the last audio level that was measured by the underlying
mixer for local user.
|
protected void |
playerConfigureComplete(javax.media.Processor player)
Called by
MediaDeviceSession.playerControllerUpdate(
ControllerEvent event) when the player associated with this session's
ReceiveStream moves enters the Configured state, so
we use the occasion to add our audio level effect. |
protected void |
processorControllerUpdate(javax.media.ControllerEvent event)
Gets notified about ControllerEvents generated by the
processor reading our capture data source, calls the corresponding
method from the parent class so that it would initialize the processor
and then adds the level effect for the local user audio levels.
|
protected void |
registerLocalUserAudioLevelEffect(javax.media.Processor processor)
Creates an audio level effect and add its to the codec chain of the
TrackControl assuming that it only contains a single track.
|
void |
setLocalUserAudioLevelListener(SimpleAudioLevelListener listener)
Sets the SimpleAudioLevelListener that this session should be
notifying about changes in local audio level related information.
|
void |
setOutputVolumeControl(VolumeControl outputVolumeControl)
Sets the VolumeControl which is to control the volume (level) of
the audio (to be) played back by this instance.
|
void |
setStreamAudioLevelListener(SimpleAudioLevelListener listener)
Sets listener as the SimpleAudioLevelListener that we
are going to notify every time a change occurs in the audio level of
the media that this device session is receiving from the remote party.
|
static void |
setVolumeControl(javax.media.Renderer renderer,
VolumeControl volumeControl)
Implements a utility which facilitates setting a specific
VolumeControl on a specific Renderer for the purposes
of control over the volume (level) of the audio (to be) played back by
the specified Renderer.
|
addDTMF, addPlaybackDataSource, addReceiveStream, addSSRC, checkDevice, close, createCaptureDevice, createPlayer, createProcessorContentDescriptor, disposePlayer, getCaptureDevice, getConnectedCaptureDevice, getDecoderControls, getDevice, getEncoderControls, getFormat, getOutputDataSource, getPlayer, getPlayers, getProcessorFormat, getReceiveStreams, getRemoteSSRCList, getStartedDirection, getSupportedFormats, getTranscodingDataSource, isMute, playbackDataSourceAdded, playbackDataSourceChanged, playbackDataSourceRemoved, playbackDataSourceUpdated, playerControllerUpdate, playerRealizeComplete, receiveStreamAdded, receiveStreamRemoved, removePlaybackDataSource, removeReceiveStream, removeSSRC, setCaptureDeviceFormat, setContentDescriptor, setDisposePlayerOnClose, setFormat, setMute, setProcessorFormat, setProcessorFormat, start, startedDirectionChanged, startProcessorInAccordWithDirection, stop
addPropertyChangeListener, firePropertyChange, getPropertyChangeSource, removePropertyChangeListener
public AudioMediaDeviceSession(AbstractMediaDevice device)
device
- the MediaDevice the use of which by a
MediaStream is to be represented by the new instancepublic void copyPlayback(MediaDeviceSession deviceSession)
copyPlayback
in class MediaDeviceSession
deviceSession
- the MediaDeviceSession to copy the playback
part of into this instanceprotected javax.media.Renderer createRenderer(javax.media.Player player, javax.media.control.TrackControl trackControl)
createRenderer
in class MediaDeviceSession
player
- the Player which is to utilize the
initialized/returned RenderertrackControl
- the TrackControl which represents the media
to be played back (and, technically, on which the initialized/returned
Renderer is to be set)TrackControl.setRenderer(Renderer)
is not invoked on the
specified trackControl.public int getLastMeasuredAudioLevel(long ssrc)
ssrc
- the SSRC ID whose last measured audio level we'd like to
retrieve.public int getLastMeasuredLocalUserAudioLevel()
protected void playerConfigureComplete(javax.media.Processor player)
MediaDeviceSession.playerControllerUpdate(
ControllerEvent event)
when the player associated with this session's
ReceiveStream moves enters the Configured state, so
we use the occasion to add our audio level effect.playerConfigureComplete
in class MediaDeviceSession
player
- the Player which is the source of a
ConfigureCompleteEventMediaDeviceSession.playerConfigureComplete(Processor)
protected void processorControllerUpdate(javax.media.ControllerEvent event)
processorControllerUpdate
in class MediaDeviceSession
event
- the ControllerEvent specifying the
Controller which is the source of the event and the very type of
the eventprotected void registerLocalUserAudioLevelEffect(javax.media.Processor processor)
processor
- the processor on which track control we need
to register a level effect with.public void setLocalUserAudioLevelListener(SimpleAudioLevelListener listener)
listener
- the SimpleAudioLevelListener to addpublic void setOutputVolumeControl(VolumeControl outputVolumeControl)
outputVolumeControl
- the VolumeControl which is to be
control the volume (level) of the audio (to be) played back by this
instancepublic void setStreamAudioLevelListener(SimpleAudioLevelListener listener)
listener
- the SimpleAudioLevelListener that we want
notified for audio level changes in the remote participant's media.public static void setVolumeControl(javax.media.Renderer renderer, VolumeControl volumeControl)
renderer
- the Renderer on which the specified
volumeControl is to be setvolumeControl
- the VolumeControl to be set on the
specified rendererprotected javax.media.Processor createProcessor()
MediaDeviceSession.captureDevice
into the format of this instance.createProcessor
in class MediaDeviceSession
public void enableOutputSSRCAudioLevels(boolean enabled, byte extensionID)
MediaDeviceSession.getOutputDataSource()
and MediaDeviceSession.getProcessor()
).
This limitation allows to not insert an Effect in the codec
chain when measuring audio levels is not required (since we can only do
this before the Processor is realized).enabled
- whether to enable or disable output audio levels.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.