Solves an issue with synchronization when creating a conference call reported by Emil Ivov. The noticeable problem was that only one of the two invited peers would get their ReceiveStream included into the audio mixing carried out in the conference.

cusax-fix
Lyubomir Marinov 16 years ago
parent 468621f780
commit 3a35214a95

@ -508,27 +508,7 @@ public static Object getControl(Controls controlsImpl, String controlType)
*/
Time getDuration()
{
Time duration = null;
synchronized (inputDataSources)
{
for (InputDataSourceDesc inputDataSourceDesc : inputDataSources)
{
Time inputDuration
= inputDataSourceDesc
.getEffectiveInputDataSource().getDuration();
if (Duration.DURATION_UNBOUNDED.equals(inputDuration)
|| Duration.DURATION_UNKNOWN.equals(inputDuration))
return inputDuration;
if ((duration == null)
|| (duration.getNanoseconds()
< inputDuration.getNanoseconds()))
duration = inputDuration;
}
}
return (duration == null) ? Duration.DURATION_UNKNOWN : duration;
return ((DataSource) captureDevice).getDuration();
}
/**

@ -108,7 +108,7 @@ public synchronized MediaDeviceSession createSession()
* @return the <tt>AudioMixer</tt> which performs audio mixing in this
* <tt>MediaDevice</tt> (and rather the session it represents)
*/
private AudioMixer getAudioMixer()
private synchronized AudioMixer getAudioMixer()
{
if (audioMixer == null)
audioMixer = new AudioMixer(device.createCaptureDevice())

@ -124,7 +124,7 @@ CaptureDevice createCaptureDevice()
logger
.error(
"Failed to create CaptureDevice"
+ "from CaptureDeviceInfo "
+ " from CaptureDeviceInfo "
+ captureDeviceInfo,
exception);
else

@ -210,7 +210,7 @@ public void addReceiveStream(ReceiveStream receiveStream)
* @param receiveStreamDataSource the <tt>DataSource</tt> to be used for
* accessing the media data of <tt>receiveStream</tt> during its playback
*/
protected void addReceiveStream(
protected synchronized void addReceiveStream(
ReceiveStream receiveStream,
DataSource receiveStreamDataSource)
{
@ -599,7 +599,7 @@ private static Format findFirstMatchingFormat(
* @return the <tt>DataSource</tt> that this instance uses to read captured
* media from
*/
protected DataSource getCaptureDevice()
protected synchronized DataSource getCaptureDevice()
{
if (captureDevice == null)
captureDevice = createCaptureDevice();
@ -1028,7 +1028,7 @@ protected void realizeComplete(Processor player)
* <tt>MediaDeviceSession</tt> and playback on the associated
* <tt>MediaDevice</tt>
*/
public void removeReceiveStream(ReceiveStream receiveStream)
public synchronized void removeReceiveStream(ReceiveStream receiveStream)
{
DataSource receiveStreamDataSource
= receiveStreams.remove(receiveStream);

Loading…
Cancel
Save