Switches from JMF to FMJ.

cusax-fix
Lyubomir Marinov 14 years ago
parent 3d4463838b
commit 6c2a8919d2

@ -20,7 +20,6 @@
<classpathentry kind="lib" path="lib/installer-exclude/jdic_misc.jar"/>
<classpathentry kind="lib" path="lib/installer-exclude/jdom.jar"/>
<classpathentry kind="lib" path="lib/installer-exclude/jfontchooser-1.0.5.jar"/>
<classpathentry kind="lib" path="lib/installer-exclude/jmf.jar"/>
<classpathentry kind="lib" path="lib/installer-exclude/jml-1.0b5.jar"/>
<classpathentry kind="lib" path="lib/installer-exclude/jna.jar"/>
<classpathentry kind="lib" path="lib/installer-exclude/joscar-client.jar"/>
@ -34,7 +33,6 @@
<classpathentry kind="lib" path="lib/installer-exclude/laf-widget.jar"/>
<classpathentry kind="lib" path="lib/installer-exclude/libphonenumber-2.4.jar"/>
<classpathentry kind="lib" path="lib/installer-exclude/log4j-1.2.8.jar"/>
<classpathentry kind="lib" path="lib/installer-exclude/lti-civil-no_s_w_t.jar"/>
<classpathentry kind="lib" path="lib/installer-exclude/jain-sdp.jar">
<attributes>
<attribute name="javadoc_location" value="https://hudson.jboss.org/jenkins/job/jain-sip/lastStableBuild/artifact/javadoc/"/>
@ -50,17 +48,12 @@
<classpathentry kind="lib" path="lib/installer-exclude/transparency.jar"/>
<classpathentry kind="lib" path="lib/installer-exclude/ymsg_network_v0_67.jar"/>
<classpathentry kind="lib" path="lib/installer-exclude/zrtp4j-light.jar"/>
<classpathentry kind="lib" path="lib/os-specific/linux/installer-exclude/jmf.jar"/>
<classpathentry kind="lib" path="lib/os-specific/linux/jdic_stub.jar"/>
<classpathentry kind="lib" path="lib/os-specific/mac/installer-exclude/jmf.jar"/>
<classpathentry kind="lib" path="lib/os-specific/mac/OrangeExtensions.jar"/>
<classpathentry kind="lib" path="lib/os-specific/mac/growl4j.jar"/>
<classpathentry kind="lib" path="lib/os-specific/mac/jdic_stub.jar"/>
<classpathentry kind="lib" path="lib/os-specific/solaris/installer-exclude/jmf.jar"/>
<classpathentry kind="lib" path="lib/os-specific/solaris/jdic_stub.jar"/>
<classpathentry kind="lib" path="lib/os-specific/windows/installer-exclude/jmf.jar"/>
<classpathentry kind="lib" path="lib/os-specific/windows/installer-exclude/jna-platform-win32.jar"/>
<classpathentry kind="lib" path="lib/os-specific/windows/installer-exclude/sound.jar"/>
<classpathentry kind="lib" path="lib/os-specific/windows/jdic_stub.jar"/>
<classpathentry kind="lib" path="lib/installer-exclude/lcrypto-jdk16-143.jar"/>
<classpathentry kind="lib" path="lib/installer-exclude/otr4j.jar"/>

@ -186,11 +186,6 @@
<!-- set the os.lib.home here in case it was not set before -->
<property name="os.lib.home" value="${lib}"/>
<!-- set the jmf.properties here in case they were not set before -->
<property name="jmf.jar" value="${os.lib.home}/installer-exclude/jmf.jar"/>
<property name="sound.jar" value="${os.lib.home}/installer-exclude/sound.jar"/>
<!-- end jmf.home-->
<property name="jdic_stub.jar" value="${os.lib.home}/jdic_stub.jar"/>
<property name="profiler.args" value="" />
@ -1116,70 +1111,9 @@
<!--BUNDLE-NEOMEDIA-->
<target name="bundle-neomedia">
<!-- Creates a bundle containing the impl of the neomedia package and
the win jmf implementation.-->
<jar
compress="false" destfile="${bundles.dest.win}/neomedia.jar"
manifest="${src}/net/java/sip/communicator/impl/neomedia/neomedia.manifest.mf">
<zipfileset dir="${dest}/net/java/sip/communicator/service/neomedia"
prefix="net/java/sip/communicator/service/neomedia"/>
<zipfileset dir="${dest}/net/java/sip/communicator/impl/neomedia"
prefix="net/java/sip/communicator/impl/neomedia"/>
<zipfileset dir="${dest}/net/java/sip/communicator/service/audionotifier"
prefix="net/java/sip/communicator/service/audionotifier"/>
<zipfileset dir="${resources}/images/impl/media"
prefix="resources/images/impl/media"/>
<zipfileset src="${lib.win.noinst}/jmf.jar" prefix=""/>
<zipfileset src="${lib.win.noinst}/sound.jar" prefix=""/>
<zipfileset src="${lib.noinst}/fmj.jar" prefix=""/>
<zipfileset src="${lib.noinst}/jspeex.jar" prefix=""/>
<zipfileset src="${lib.noinst}/lti-civil-no_s_w_t.jar" prefix=""/>
</jar>
<!-- Creates a bundle containing the impl of the neomedia package and
the linux jmf implementation.-->
<jar
compress="false" destfile="${bundles.dest.lin}/neomedia.jar"
manifest="${src}/net/java/sip/communicator/impl/neomedia/neomedia.manifest.mf">
<zipfileset dir="${dest}/net/java/sip/communicator/service/neomedia"
prefix="net/java/sip/communicator/service/neomedia"/>
<zipfileset dir="${dest}/net/java/sip/communicator/impl/neomedia"
prefix="net/java/sip/communicator/impl/neomedia"/>
<zipfileset dir="${dest}/net/java/sip/communicator/service/audionotifier"
prefix="net/java/sip/communicator/service/audionotifier"/>
<zipfileset dir="${resources}/images/impl/media"
prefix="resources/images/impl/media"/>
<zipfileset src="${lib.lin.noinst}/jmf.jar" prefix=""/>
<zipfileset src="${lib.noinst}/fmj.jar" prefix=""/>
<zipfileset src="${lib.noinst}/jspeex.jar" prefix=""/>
<zipfileset src="${lib.noinst}/lti-civil-no_s_w_t.jar" prefix=""/>
</jar>
<!-- Creates a bundle containing the impl of the neomedia package and
the mac jmf implementation.-->
<jar
compress="false" destfile="${bundles.dest.mac}/neomedia.jar"
manifest="${src}/net/java/sip/communicator/impl/neomedia/neomedia.manifest.mf">
<zipfileset dir="${dest}/net/java/sip/communicator/service/neomedia"
prefix="net/java/sip/communicator/service/neomedia"/>
<zipfileset dir="${dest}/net/java/sip/communicator/impl/neomedia"
prefix="net/java/sip/communicator/impl/neomedia"/>
<zipfileset dir="${dest}/net/java/sip/communicator/service/audionotifier"
prefix="net/java/sip/communicator/service/audionotifier"/>
<zipfileset dir="${resources}/images/impl/media"
prefix="resources/images/impl/media"/>
<zipfileset src="${lib.mac.noinst}/jmf.jar" prefix=""/>
<zipfileset src="${lib.noinst}/fmj.jar" prefix=""/>
<zipfileset src="${lib.noinst}/jspeex.jar" prefix=""/>
<zipfileset src="${lib.noinst}/lti-civil-no_s_w_t.jar" prefix=""/>
</jar>
<!-- Creates a bundle containing the impl of the neomedia package and
the standard jmf implementation.-->
FMJ. -->
<jar
compress="false" destfile="${bundles.dest.freebsd}/neomedia.jar"
compress="false" destfile="${bundles.dest}/neomedia.jar"
manifest="${src}/net/java/sip/communicator/impl/neomedia/neomedia.manifest.mf">
<zipfileset dir="${dest}/net/java/sip/communicator/service/neomedia"
@ -1190,10 +1124,8 @@
prefix="net/java/sip/communicator/service/audionotifier"/>
<zipfileset dir="${resources}/images/impl/media"
prefix="resources/images/impl/media"/>
<zipfileset src="${lib.noinst}/jmf.jar" prefix=""/>
<zipfileset src="${lib.noinst}/fmj.jar" prefix=""/>
<zipfileset src="${lib.noinst}/jspeex.jar" prefix=""/>
<zipfileset src="${lib.noinst}/lti-civil-no_s_w_t.jar" prefix=""/>
</jar>
</target>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

@ -10,68 +10,17 @@
#include <jni.h>
/**
* The minimum number of frames by which the playback is to be delayed before it
* is accessible to the echo cancellation/capture.
*/
#define MIN_PLAY_DELAY_IN_FRAMES 2
#ifndef AUDIO_QUALITY_IMPROVEMENT_IMPLEMENTATION
typedef void *AudioQualityImprovement;
#else /* #ifndef AUDIO_QUALITY_IMPROVEMENT_IMPLEMENTATION */
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
typedef CRITICAL_SECTION Mutex;
static inline int mutex_init(Mutex* mutex, void* arg)
{
InitializeCriticalSection(mutex);
arg = NULL; /* unused */
return 0;
}
static inline int mutex_destroy(Mutex* mutex)
{
DeleteCriticalSection(mutex);
return 0;
}
static inline int mutex_lock(Mutex* mutex)
{
EnterCriticalSection(mutex);
return 0;
}
static inline int mutex_unlock(Mutex* mutex)
{
LeaveCriticalSection(mutex);
return 0;
}
#else /* Unix */
#include <pthread.h>
typedef pthread_mutex_t Mutex;
static inline int mutex_init(Mutex* mutex, void* arg)
{
return pthread_mutex_init(mutex, arg);
}
static inline int mutex_destroy(Mutex* mutex)
{
return pthread_mutex_destroy(mutex);
}
static inline int mutex_lock(Mutex* mutex)
{
return pthread_mutex_lock(mutex);
}
static inline int mutex_unlock(Mutex* mutex)
{
return pthread_mutex_unlock(mutex);
return 0;
}
#endif
#include "Mutex.h"
#include <speex/speex_echo.h>
#include <speex/speex_preprocess.h>
#include <speex/speex_resampler.h>
@ -81,50 +30,136 @@ typedef struct _AudioQualityImprovement
jboolean denoise;
SpeexEchoState *echo;
jlong echoFilterLengthInMillis;
/** The length of the echo cancelling filter of #echo in samples. */
int filterLengthOfEcho;
jint frameSize;
int frameSizeOfPreprocess;
/** The capture latency in milliseconds. */
jlong inputLatency;
jlong longID;
Mutex *mutex;
struct _AudioQualityImprovement *next;
/**
* The intermediate buffer into which the result of echo cancellation is
* written for a specific <tt>buffer</tt> of captured audio.
*/
spx_int16_t *out;
/** The capacity of #out in bytes. */
spx_uint32_t outCapacity;
/** The playback latency in milliseconds. */
jlong outputLatency;
spx_int16_t *play;
/**
* The number of samples allocated to #play regardless of whether they are
* valid or not.
*/
spx_uint32_t playCapacity;
spx_uint32_t playSize;
/** The number of frames to delay playback with. */
spx_uint32_t playDelay;
/**
* The indicator which determines whether #play is currently delaying the
* access to it from #echo.
*/
jboolean playIsDelaying;
/** The number of valid samples written into #play. */
spx_uint32_t playLength;
SpeexPreprocessState *preprocess;
SpeexResamplerState *resampler;
int retainCount;
int sampleRate;
int sampleRateOfPreprocess;
char *stringID;
/** The indicator which determines whether echo suppression is enabled. */
jboolean suppressEcho;
/**
* The sound pressure level in dB depending on which the echo suppression,
* if enabled, decreases the sound volume of the captured oudio.
*/
float suppressEchoSPL;
/** The decay in dB per millisecond of #suppressEchoSPL. */
float suppressEchoSPLDecay;
/**
* The time in milliseconds at which #suppressEchoSPL has last been assigned
* a value and thus determines how much #suppressEchoSPLDecay is to be
* applied to #suppressEchoSPL at a certain point in time.
*/
jlong suppressEchoSPLTime;
} AudioQualityImprovement;
#endif /* #ifndef AUDIO_QUALITY_IMPROVEMENT_IMPLEMENTATION */
typedef enum
{
/**
* The constant which indicates that the associated samples have originated
* from an input stream i.e. capture.
*/
AUDIO_QUALITY_IMPROVEMENT_SAMPLE_ORIGIN_INPUT,
/**
* The constant which indicates that the associated samples have originated
* from an output stream i.e. playback.
*/
AUDIO_QUALITY_IMPROVEMENT_SAMPLE_ORIGIN_OUTPUT
} AudioQualityImprovementSampleOrigin;
AudioQualityImprovement *AudioQualityImprovement_getSharedInstance
(const char *stringID, jlong longID);
/** Loads the <tt>AudioQualityImprovement</tt> class. */
void AudioQualityImprovement_load();
void AudioQualityImprovement_process
(AudioQualityImprovement *audioQualityImprovement,
(AudioQualityImprovement *aqi,
AudioQualityImprovementSampleOrigin sampleOrigin,
double sampleRate,
unsigned long sampleSizeInBits,
int channels,
void *buffer,
unsigned long length);
void AudioQualityImprovement_release
(AudioQualityImprovement *audioQualityImprovement);
double sampleRate, unsigned long sampleSizeInBits, int channels,
jlong latency,
void *buffer, unsigned long length);
void AudioQualityImprovement_release(AudioQualityImprovement *aqi);
/**
* Sets the indicator which determines whether noise suppression is to be
* performed by the specified <tt>AudioQualityImprovement</tt> (for captured
* audio).
*
* @param aqi the <tt>AudioQualityImprovement</tt> on which to set the indicator
* which determines whether it is to perform noise suppression (for captured audio)
* @param denoise <tt>JNI_TRUE</tt> if the specified <tt>aqi</tt> is to perform
* noise suppression (for captured audio); otherwise, <tt>JNI_FALSE</tt>
*/
void AudioQualityImprovement_setDenoise
(AudioQualityImprovement *audioQualityImprovement, jboolean denoise);
(AudioQualityImprovement *aqi, jboolean denoise);
/**
* Sets the filter length in milliseconds of the echo cancellation
* implementation of the specified <tt>AudioQualityImprovement</tt>. The
* recommended filter length is approximately the third of the room
* reverberation time. For example, in a small room, reverberation time is in
* the order of 300 ms, so a filter length of 100 ms is a good choice (800
* samples at 8000 Hz sampling rate).
*
* @param aqi the <tt>AudioQualityImprovement</tt> to set the filter length of
* @param echoFilterLengthInMillis the filter length in milliseconds of the echo
* cancellation of <tt>aqi</tt>
*/
void AudioQualityImprovement_setEchoFilterLengthInMillis
(AudioQualityImprovement *audioQualityImprovement,
jlong echoFilterLengthInMillis);
(AudioQualityImprovement *aqi, jlong echoFilterLengthInMillis);
void AudioQualityImprovement_setSampleRate
(AudioQualityImprovement *audioQualityImprovement, int sampleRate);
(AudioQualityImprovement *aqi, int sampleRate);
/** Unloads the <tt>AudioQualityImprovement</tt> class. */
void AudioQualityImprovement_unload();
#endif /* #ifndef _NET_JAVA_SIP_COMMUNICATOR_IMPL_NEOMEDIA_PORTAUDIO_AUDIOQUALITYIMPROVEMENT_H_ */

@ -0,0 +1,95 @@
/*
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
#ifndef _NET_JAVA_SIP_COMMUNICATOR_IMPL_NEOMEDIA_CONDITIONVARIABLE_H_
#define _NET_JAVA_SIP_COMMUNICATOR_IMPL_NEOMEDIA_CONDITIONVARIABLE_H_
#include "Mutex.h"
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
typedef HANDLE ConditionVariable;
static inline void ConditionVariable_free(ConditionVariable *condVar)
{
if (CloseHandle(*condVar))
free(condVar);
}
static inline ConditionVariable *ConditionVariable_new(void *attr)
{
ConditionVariable *condVar = malloc(sizeof(ConditionVariable));
if (condVar)
{
HANDLE event = CreateEvent(NULL, FALSE, FALSE, NULL);
if (event)
*condVar = event;
else
{
free(condVar);
condVar = NULL;
}
}
return condVar;
}
static inline int ConditionVariable_notify(ConditionVariable *condVar)
{
return SetEvent(*condVar) ? 0 : GetLastError();
}
static inline int ConditionVariable_wait
(ConditionVariable *condVar, Mutex *mutex)
{
DWORD waitForSingleObject;
LeaveCriticalSection(mutex);
waitForSingleObject = WaitForSingleObject(*condVar, INFINITE);
EnterCriticalSection(mutex);
return waitForSingleObject;
}
#else /* #ifdef _WIN32 */
#include <pthread.h>
typedef pthread_cond_t ConditionVariable;
static inline void ConditionVariable_free(ConditionVariable *condVar)
{
if (!pthread_cond_destroy(condVar))
free(condVar);
}
static inline ConditionVariable *ConditionVariable_new(void *attr)
{
ConditionVariable *condVar = malloc(sizeof(ConditionVariable));
if (condVar && pthread_cond_init(condVar, attr))
{
free(condVar);
condVar = NULL;
}
return condVar;
}
static inline int ConditionVariable_notify(ConditionVariable *condVar)
{
return pthread_cond_signal(condVar);
}
static inline int ConditionVariable_wait
(ConditionVariable *condVar, Mutex *mutex)
{
return pthread_cond_wait(condVar, mutex);
}
#endif /* #ifdef _WIN32 */
#endif /* _NET_JAVA_SIP_COMMUNICATOR_IMPL_NEOMEDIA_CONDITIONVARIABLE_H_ */

@ -0,0 +1,82 @@
/*
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
#ifndef _NET_JAVA_SIP_COMMUNICATOR_IMPL_NEOMEDIA_PORTAUDIO_MUTEX_H_
#define _NET_JAVA_SIP_COMMUNICATOR_IMPL_NEOMEDIA_PORTAUDIO_MUTEX_H_
#include <stdlib.h>
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
typedef CRITICAL_SECTION Mutex;
static inline void Mutex_free(Mutex* mutex)
{
DeleteCriticalSection(mutex);
free(mutex);
}
static inline int Mutex_lock(Mutex* mutex)
{
EnterCriticalSection(mutex);
return 0;
}
static inline Mutex *Mutex_new(void* attr)
{
Mutex *mutex = malloc(sizeof(Mutex));
(void) attr;
if (mutex)
InitializeCriticalSection(mutex);
return mutex;
}
static inline int Mutex_unlock(Mutex* mutex)
{
LeaveCriticalSection(mutex);
return 0;
}
#else /* #ifdef _WIN32 */
#include <pthread.h>
typedef pthread_mutex_t Mutex;
static inline void Mutex_free(Mutex* mutex)
{
if (!pthread_mutex_destroy(mutex))
free(mutex);
}
static inline int Mutex_lock(Mutex* mutex)
{
return pthread_mutex_lock(mutex);
}
static inline Mutex *Mutex_new(void* attr)
{
Mutex *mutex = malloc(sizeof(Mutex));
if (mutex && pthread_mutex_init(mutex, attr))
{
free(mutex);
mutex = NULL;
}
return mutex;
}
static inline int Mutex_unlock(Mutex* mutex)
{
return pthread_mutex_unlock(mutex);
}
#endif /* #ifdef _WIN32 */
#endif /* #ifndef _NET_JAVA_SIP_COMMUNICATOR_IMPL_NEOMEDIA_PORTAUDIO_MUTEX_H_ */

@ -6,8 +6,11 @@
*/
package net.java.sip.communicator.impl.neomedia;
import java.io.*;
import java.util.*;
import net.java.sip.communicator.impl.neomedia.codec.video.h264.*;
import net.java.sip.communicator.impl.neomedia.notify.*;
import net.java.sip.communicator.service.audionotifier.*;
import net.java.sip.communicator.service.configuration.*;
import net.java.sip.communicator.service.fileaccess.*;
@ -18,17 +21,16 @@
import net.java.sip.communicator.service.resources.*;
import net.java.sip.communicator.util.*;
import net.java.sip.communicator.impl.neomedia.codec.video.h264.ConfigurationPanel;
import net.java.sip.communicator.impl.neomedia.notify.*;
import org.osgi.framework.*;
import com.sun.media.util.*;
/**
* Implements <tt>BundleActivator</tt> for the neomedia bundle.
*
* @author Martin Andre
* @author Emil Ivov
* @author Lubomir Marinov
* @author Lyubomir Marinov
*/
public class NeomediaActivator
implements BundleActivator
@ -111,6 +113,51 @@ public class NeomediaActivator
*/
private static UIService uiService = null;
/**
* Sets up FMJ for execution. For example, sets properties which instruct
* FMJ whether it is to create a log, where the log is to be created.
*/
private void setupFMJ()
{
/*
* Since FMJ is part of neomedia, FMJ's log should be enabled when
* neomedia's log is enabled.
*/
Registry.set("allowLogging", logger.isDebugEnabled());
String scHomeDirLocation
= System.getProperty(
ConfigurationService.PNAME_SC_HOME_DIR_LOCATION);
if (scHomeDirLocation != null)
{
String scHomeDirName
= System.getProperty(
ConfigurationService.PNAME_SC_HOME_DIR_NAME);
if (scHomeDirName != null)
{
File scHomeDir = new File(scHomeDirLocation, scHomeDirName);
/* Write FMJ's log in Jitsi's log directory. */
Registry.set(
"secure.logDir",
new File(scHomeDir, "log").getPath());
/* Write FMJ's registry in Jitsi's user data directory. */
String jmfRegistryFilename
= "net.sf.fmj.utility.JmfRegistry.filename";
if (System.getProperty(jmfRegistryFilename) == null)
{
System.setProperty(
jmfRegistryFilename,
new File(scHomeDir, ".fmj.registry").getAbsolutePath());
}
}
}
}
/**
* Starts the execution of the neomedia bundle in the specified context.
*
@ -127,6 +174,8 @@ public void start(BundleContext bundleContext)
NeomediaActivator.bundleContext = bundleContext;
setupFMJ();
// MediaService
mediaServiceImpl = new MediaServiceImpl();
mediaServiceImpl.start();

@ -6,14 +6,12 @@
*/
package net.java.sip.communicator.impl.neomedia.device;
import java.io.*;
import java.util.*;
import javax.media.*;
import javax.media.format.*;
import net.java.sip.communicator.impl.neomedia.*;
import net.java.sip.communicator.service.fileaccess.*;
import net.java.sip.communicator.util.*;
import com.sun.media.util.*;
@ -24,7 +22,7 @@
*
* @author Emil Ivov
* @author Ken Larson
* @author Lubomir Marinov
* @author Lyubomir Marinov
*/
public class JmfDeviceDetector
{
@ -63,12 +61,6 @@ public class JmfDeviceDetector
private static final String PROP_REGISTRY_AUTHOR_VALUE
= "sip-communicator.org";
/**
* The name of the file that the JMF registry uses for storing and loading
* JMF properties.
*/
private static final String JMF_PROPERTIES_FILE_NAME = "jmf.properties";
/**
* Default constructor - does nothing.
*/
@ -231,25 +223,6 @@ public void initializeVideo()
if (logger.isInfoEnabled())
logger.info("Looking for video capture devices");
//FMJ
/* disable LTI-CIVIL for now as we have native capture for all OS */
/*
boolean fmjVideoAvailable = isFMJVideoAvailable();
try
{
if(fmjVideoAvailable)
new FMJCivilVideoAuto();
}
catch (Throwable exc)
{
if (logger.isDebugEnabled())
logger.debug("No FMJ CIVIL video detected: " + exc.getMessage(),
exc);
fmjVideoAvailable = false;
}
*/
if (OSUtils.IS_MAC) // QuickTime
{
try
@ -303,84 +276,6 @@ else if (OSUtils.IS_WINDOWS) /* DirectShow */
}
}
/**
* Currently fmj video under macosx using java version 1.6 is not supported.
* As macosx video support is using libQTJNative.jnilib which supports
* only java 1.5 and is deprecated.
* @return is fmj video supported under current OS and environment.
*/
private boolean isFMJVideoAvailable()
{
return
!(OSUtils.IS_MAC
&& System.getProperty("java.version").startsWith("1.6"));
}
/**
* Runs JMFInit the first time the application is started so that capture
* devices are properly detected and initialized by JMF.
*/
public static void setupJMF()
{
logger.logEntry();
try
{
// we'll be storing our jmf.properties file inside the
//sip-communicator directory. If it does not exist - we created it.
//If the jmf.properties file has 0 length then this is the first
//time we're running and should detect capture devices
File jmfPropsFile = null;
try
{
FileAccessService faService
= NeomediaActivator.getFileAccessService();
if(faService != null)
{
jmfPropsFile = faService.
getPrivatePersistentFile(JMF_PROPERTIES_FILE_NAME);
}
//small hack for when running from outside oscar
else
{
jmfPropsFile
= new File(System.getProperty("user.home")
+ File.separator
+ ".sip-communicator/jmf.properties");
}
//force reinitialization
if(jmfPropsFile.exists())
jmfPropsFile.delete();
jmfPropsFile.createNewFile();
}
catch (Exception exc)
{
throw new RuntimeException(
"Failed to create the jmf.properties file.", exc);
}
String classpath = System.getProperty("java.class.path");
classpath = jmfPropsFile.getParentFile().getAbsolutePath()
+ System.getProperty("path.separator")
+ classpath;
System.setProperty("java.class.path", classpath);
/** @todo run this only if necessary and in parallel. Right now
* we're running detection no matter what. We should be more
* intelligent and detect somehow whether new devices are present
* before we run our detection tests.*/
JmfDeviceDetector detector = new JmfDeviceDetector();
detector.initialize();
}
finally
{
logger.logExit();
}
setupRenderers();
}
/**
* Sets the renderers appropriate for the current platform.
*/
@ -441,7 +336,8 @@ else if(!OSUtils.IS_LINUX32)
*/
public static void detectAndConfigureCaptureDevices()
{
setupJMF();
new JmfDeviceDetector().initialize();
setupRenderers();
}
/**
@ -449,7 +345,6 @@ public static void detectAndConfigureCaptureDevices()
*/
public static void reinitializeVideoCaptureDevices()
{
JmfDeviceDetector detector = new JmfDeviceDetector();
detector.reinitializeVideo();
new JmfDeviceDetector().reinitializeVideo();
}
}

@ -15,14 +15,12 @@
import net.java.sip.communicator.impl.neomedia.portaudio.*;
import net.java.sip.communicator.util.*;
import com.sun.media.util.*;
/**
* Creates PortAudio capture devices by enumerating all host devices that have
* input channels.
*
* @author Damian Minkov
* @author Lubomir Marinov
* @author Lyubomir Marinov
*/
public class PortAudioAuto
{
@ -68,10 +66,6 @@ public class PortAudioAuto
PortAudioAuto()
throws Exception
{
// enable jmf logging, so we can track codec chains and formats
if(logger.isDebugEnabled())
Registry.set("allowLogging", true);
// if PortAudio has a problem initializing like missing native
// components it will trow exception here and PortAudio rendering will
// not be inited.

@ -18,7 +18,7 @@
import net.java.sip.communicator.impl.neomedia.control.*;
import net.java.sip.communicator.util.*;
import com.sun.media.util.*;
import net.sf.fmj.media.util.*;
/**
* Facilitates the implementations of the <tt>CaptureDevice</tt> and

@ -388,15 +388,17 @@ public MediaDevice getDefaultDevice(MediaType mediaType)
if(device == null)
device = mediaService.getDefaultDevice(mediaType, mediaUseCase);
/*
* Make sure that the audio device has an AudioMixer in order to support
* conferencing and call recording.
*/
if (MediaType.AUDIO.equals(mediaType))
{
if (conferenceAudioMixer == null)
{
if (device != null)
conferenceAudioMixer = mediaService.createMixer(device);
}
return conferenceAudioMixer;
if ((conferenceAudioMixer == null) && (device != null))
conferenceAudioMixer = mediaService.createMixer(device);
device = conferenceAudioMixer;
}
return device;
}

@ -26,7 +26,7 @@
* semi-transparent background.
*
* @author Yana Stamcheva
* @author Lubomir Marinov
* @author Lyubomir Marinov
* @author Adam Netocny
*/
public class SIPCommFrame
@ -222,23 +222,24 @@ public void actionPerformed(ActionEvent e)
protected void setKeybindingInput(KeybindingSet.Category category)
{
// Removes old binding set
if (this.bindings != null)
if (bindings != null)
{
this.bindings.deleteObserver(this);
bindings.deleteObserver(this);
resetInputMap();
}
// Adds new bindings to input map
this.bindings =
UtilActivator.getKeybindingsService().getBindings(category);
bindings
= UtilActivator.getKeybindingsService().getBindings(category);
for (Map.Entry<KeyStroke, String> key2action : this.bindings
.getBindings().entrySet())
if (bindings != null)
{
imap.put(key2action.getKey(), key2action.getValue());
}
for (Map.Entry<KeyStroke, String> key2action
: bindings.getBindings().entrySet())
imap.put(key2action.getKey(), key2action.getValue());
this.bindings.addObserver(this);
bindings.addObserver(this);
}
}
/**

Loading…
Cancel
Save