In neomedia, introduces AudioMediaStream#isMute(). Support for firing events on changes to the mute property of AudioMediaStream is not implemented and is to be added.

cusax-fix
Lyubomir Marinov 17 years ago
parent 878222e0df
commit cd6a51e1e6

@ -122,6 +122,20 @@ public void addSoundLevelListener(SoundLevelListener listener)
// TODO Auto-generated method stub
}
/**
* Determines whether this <tt>AudioMediaStream</tt> is set to transmit
* silence instead of the audio being fed from its <tt>MediaDevice</tt>.
*
* @return <tt>true</tt> if this <tt>AudioMediaStream</tt> is set to
* transmit silence instead of the audio fed from its <tt>MediaDevice</tt>;
* <tt>false</tt>, otherwise
* @see AudioMediaStream#isMute()
*/
public boolean isMute()
{
return ((AudioCaptureMediaDevice) getDevice()).isMute();
}
/**
* Registers {@link #CUSTOM_CODEC_FORMATS} with a specific
* <tt>RTPManager</tt>.

@ -48,6 +48,23 @@ public AudioCaptureMediaDevice(CaptureDeviceInfo captureDeviceInfo)
super(captureDeviceInfo, MediaType.AUDIO);
}
/**
* Determines whether this <tt>MediaDevice</tt> will provide silence instead
* of actual captured data next time it is read.
*
* @return <tt>true</tt> if this <tt>MediaDevice</tt> will provide silence
* instead of actual captured data next time it is read; <tt>false</tt>,
* otherwise
*/
public boolean isMute()
{
CaptureDevice captureDevice = getCaptureDevice(false);
if (captureDevice instanceof MutePushBufferDataSource)
return ((MutePushBufferDataSource) captureDevice).isMute();
return false;
}
/**
* Sets the JMF <tt>CaptureDevice</tt> this instance wraps and provides a
* <tt>MediaDevice</tt> implementation for. Tries to enable muting.
@ -69,7 +86,7 @@ protected void setCaptureDevice(CaptureDevice captureDevice)
/**
* Sets the indicator which determines whether this <tt>MediaDevice</tt>
* will start providing silence instead of actual capture data next time it
* will start providing silence instead of actual captured data next time it
* is read.
*
* @param mute <tt>true</tt> to have this <tt>MediaDevice</tt> start

@ -150,7 +150,27 @@ DataSource createOutputDataSource()
*/
public CaptureDevice getCaptureDevice()
{
if (captureDevice == null)
return getCaptureDevice(true);
}
/**
* Gets the JMF <tt>CaptureDevice</tt> this instance wraps and provides an
* implementation of <tt>MediaDevice</tt> for and, optionally, creates it if
* it does not exist yet.
*
* @param create <tt>true</tt> to create the <tt>CaptureDevice</tt> this
* instance provides an implementation of <tt>MediaDevice</tt> for it it
* does not exist yet; <tt>false</tt> to not create it and return
* <tt>null</tt> if it does not exist yet
* @return the JMF <tt>CaptureDevice</tt> this instance wraps and provides
* an implementation of <tt>MediaDevice</tt> for if it exists or
* <tt>create</tt> is <tt>true</tt> and its creation succeeds; <tt>null</tt>
* if it does not exist yet and <tt>create</tt> is <tt>false</tt> or its
* creation fails
*/
protected CaptureDevice getCaptureDevice(boolean create)
{
if ((captureDevice == null) && create)
{
CaptureDevice captureDevice = null;
Throwable exception = null;

@ -82,4 +82,14 @@ public interface AudioMediaStream
* <tt>MediaDevice</tt> again.
*/
public void setMute(boolean mute);
/**
* Determines whether this <tt>AudioMediaStream</tt> is set to transmit
* silence instead of the audio being fed from its <tt>MediaDevice</tt>.
*
* @return <tt>true</tt> if this <tt>AudioMediaStream</tt> is set to
* transmit silence instead of the audio fed from its <tt>MediaDevice</tt>;
* <tt>false</tt>, otherwise
*/
public boolean isMute();
}

Loading…
Cancel
Save