|
|
|
|
@ -36,12 +36,6 @@ public class NeomediaActivator
|
|
|
|
|
implements BundleActivator
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The <tt>Logger</tt> used by the <tt>NeomediaActivator</tt> class and its
|
|
|
|
|
* instances for logging output.
|
|
|
|
|
*/
|
|
|
|
|
private final Logger logger = Logger.getLogger(NeomediaActivator.class);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Indicates if the audio configuration form should be disabled, i.e.
|
|
|
|
|
* not visible to the user.
|
|
|
|
|
@ -50,25 +44,21 @@ public class NeomediaActivator
|
|
|
|
|
= "net.java.sip.communicator.impl.neomedia.AUDIO_CONFIG_DISABLED";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Indicates if the video configuration form should be disabled, i.e.
|
|
|
|
|
* not visible to the user.
|
|
|
|
|
* The audio configuration form used to define the capture/notify/playback
|
|
|
|
|
* audio devices.
|
|
|
|
|
*/
|
|
|
|
|
private static final String VIDEO_CONFIG_DISABLED_PROP
|
|
|
|
|
= "net.java.sip.communicator.impl.neomedia.VIDEO_CONFIG_DISABLED";
|
|
|
|
|
private static ConfigurationForm audioConfigurationForm;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Indicates if the H.264 configuration form should be disabled, i.e.
|
|
|
|
|
* not visible to the user.
|
|
|
|
|
* The audio notifier service.
|
|
|
|
|
*/
|
|
|
|
|
private static final String H264_CONFIG_DISABLED_PROP
|
|
|
|
|
= "net.java.sip.communicator.impl.neomedia.h264config.DISABLED";
|
|
|
|
|
private static AudioNotifierService audioNotifierService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Indicates if the ZRTP configuration form should be disabled, i.e.
|
|
|
|
|
* not visible to the user.
|
|
|
|
|
* The context in which the one and only <tt>NeomediaActivator</tt> instance
|
|
|
|
|
* has started executing.
|
|
|
|
|
*/
|
|
|
|
|
private static final String ZRTP_CONFIG_DISABLED_PROP
|
|
|
|
|
= "net.java.sip.communicator.impl.neomedia.zrtpconfig.DISABLED";
|
|
|
|
|
private static BundleContext bundleContext;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Indicates if the call recording config form should be disabled, i.e.
|
|
|
|
|
@ -77,6 +67,13 @@ public class NeomediaActivator
|
|
|
|
|
private static final String CALL_RECORDING_CONFIG_DISABLED_PROP
|
|
|
|
|
= "net.java.sip.communicator.impl.neomedia.callrecordingconfig.DISABLED";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The <tt>ConfigurationService</tt> registered in {@link #bundleContext}
|
|
|
|
|
* and used by the <tt>NeomediaActivator</tt> instance to read and write
|
|
|
|
|
* configuration properties.
|
|
|
|
|
*/
|
|
|
|
|
private static ConfigurationService configurationService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The name of the notification pop-up event displayed when the device
|
|
|
|
|
* configration has changed.
|
|
|
|
|
@ -85,30 +82,35 @@ public class NeomediaActivator
|
|
|
|
|
= "DeviceConfigurationChanged";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The name of the notification pop-up event displayed when a new device
|
|
|
|
|
* is selected (for audio in, audio out or notifications).
|
|
|
|
|
* The <tt>FileAccessService</tt> registered in {@link #bundleContext} and
|
|
|
|
|
* used by the <tt>NeomediaActivator</tt> instance to safely access files.
|
|
|
|
|
*/
|
|
|
|
|
public static final String NEW_SELECTED_DEVICE
|
|
|
|
|
= "NewSelectedDevice";
|
|
|
|
|
private static FileAccessService fileAccessService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The context in which the one and only <tt>NeomediaActivator</tt> instance
|
|
|
|
|
* has started executing.
|
|
|
|
|
* Indicates if the H.264 configuration form should be disabled, i.e.
|
|
|
|
|
* not visible to the user.
|
|
|
|
|
*/
|
|
|
|
|
private static BundleContext bundleContext;
|
|
|
|
|
private static final String H264_CONFIG_DISABLED_PROP
|
|
|
|
|
= "net.java.sip.communicator.impl.neomedia.h264config.DISABLED";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The <tt>ConfigurationService</tt> registered in {@link #bundleContext}
|
|
|
|
|
* and used by the <tt>NeomediaActivator</tt> instance to read and write
|
|
|
|
|
* configuration properties.
|
|
|
|
|
* A {@link MediaConfigurationService} instance.
|
|
|
|
|
*/
|
|
|
|
|
private static ConfigurationService configurationService;
|
|
|
|
|
private static MediaConfigurationImpl mediaConfiguration;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The <tt>FileAccessService</tt> registered in {@link #bundleContext} and
|
|
|
|
|
* used by the <tt>NeomediaActivator</tt> instance to safely access files.
|
|
|
|
|
* The one and only <tt>MediaServiceImpl</tt> instance registered in
|
|
|
|
|
* {@link #bundleContext} by the <tt>NeomediaActivator</tt> instance.
|
|
|
|
|
*/
|
|
|
|
|
private static FileAccessService fileAccessService;
|
|
|
|
|
private static MediaServiceImpl mediaServiceImpl;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The name of the notification pop-up event displayed when a new device
|
|
|
|
|
* is selected (for audio in, audio out or notifications).
|
|
|
|
|
*/
|
|
|
|
|
public static final String NEW_SELECTED_DEVICE
|
|
|
|
|
= "NewSelectedDevice";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The notifcation service to pop-up messages.
|
|
|
|
|
@ -116,10 +118,10 @@ public class NeomediaActivator
|
|
|
|
|
private static NotificationService notificationService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The one and only <tt>MediaServiceImpl</tt> instance registered in
|
|
|
|
|
* {@link #bundleContext} by the <tt>NeomediaActivator</tt> instance.
|
|
|
|
|
* The OSGi <tt>PacketLoggingService</tt> of {@link #mediaServiceImpl} in
|
|
|
|
|
* {@link #bundleContext} and used for debugging.
|
|
|
|
|
*/
|
|
|
|
|
private static MediaServiceImpl mediaServiceImpl;
|
|
|
|
|
private static PacketLoggingService packetLoggingService = null;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The <tt>ResourceManagementService</tt> registered in
|
|
|
|
|
@ -130,17 +132,11 @@ public class NeomediaActivator
|
|
|
|
|
private static ResourceManagementService resources;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The OSGi <tt>PacketLoggingService</tt> of {@link #mediaServiceImpl} in
|
|
|
|
|
* {@link #bundleContext} and used for debugging.
|
|
|
|
|
*/
|
|
|
|
|
private static PacketLoggingService packetLoggingService = null;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A listener to the click on the popup message concerning audio device
|
|
|
|
|
* configuration changes.
|
|
|
|
|
* Indicates if the video configuration form should be disabled, i.e.
|
|
|
|
|
* not visible to the user.
|
|
|
|
|
*/
|
|
|
|
|
private AudioDeviceConfigurationListener
|
|
|
|
|
audioDeviceConfigurationPropertyChangeListener;
|
|
|
|
|
private static final String VIDEO_CONFIG_DISABLED_PROP
|
|
|
|
|
= "net.java.sip.communicator.impl.neomedia.VIDEO_CONFIG_DISABLED";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A listener to the click on the popup message concerning video device
|
|
|
|
|
@ -151,25 +147,218 @@ public class NeomediaActivator
|
|
|
|
|
// videoDeviceConfigurationPropertyChangeListener;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A {@link MediaConfigurationService} instance.
|
|
|
|
|
* The video configuration form.
|
|
|
|
|
*/
|
|
|
|
|
private static MediaConfigurationImpl mediaConfiguration;
|
|
|
|
|
private static ConfigurationForm videoConfigurationForm;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The audio configuration form used to define the capture/notify/playback
|
|
|
|
|
* audio devices.
|
|
|
|
|
* Indicates if the ZRTP configuration form should be disabled, i.e.
|
|
|
|
|
* not visible to the user.
|
|
|
|
|
*/
|
|
|
|
|
private static ConfigurationForm audioConfigurationForm;
|
|
|
|
|
private static final String ZRTP_CONFIG_DISABLED_PROP
|
|
|
|
|
= "net.java.sip.communicator.impl.neomedia.zrtpconfig.DISABLED";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The video configuration form.
|
|
|
|
|
* Returns the audio configuration form used to define the
|
|
|
|
|
* capture/notify/playback audio devices.
|
|
|
|
|
*
|
|
|
|
|
* @return The audio configuration form used to define the
|
|
|
|
|
* capture/notify/playback audio devices.
|
|
|
|
|
*/
|
|
|
|
|
private static ConfigurationForm videoConfigurationForm;
|
|
|
|
|
public static ConfigurationForm getAudioConfigurationForm()
|
|
|
|
|
{
|
|
|
|
|
return audioConfigurationForm;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The audio notifier service.
|
|
|
|
|
* Returns the <tt>AudioService</tt> obtained from the bundle
|
|
|
|
|
* context.
|
|
|
|
|
* @return the <tt>AudioService</tt> obtained from the bundle
|
|
|
|
|
* context
|
|
|
|
|
*/
|
|
|
|
|
private static AudioNotifierService audioNotifierService;
|
|
|
|
|
public static AudioNotifierService getAudioNotifierService()
|
|
|
|
|
{
|
|
|
|
|
if(audioNotifierService == null)
|
|
|
|
|
{
|
|
|
|
|
audioNotifierService
|
|
|
|
|
= ServiceUtils.getService(
|
|
|
|
|
bundleContext,
|
|
|
|
|
AudioNotifierService.class);
|
|
|
|
|
}
|
|
|
|
|
return audioNotifierService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the context in which the one and only <tt>NeomediaActivator</tt>
|
|
|
|
|
* instance has started executing.
|
|
|
|
|
*
|
|
|
|
|
* @return The context in which the one and only <tt>NeomediaActivator</tt>
|
|
|
|
|
* instance has started executing.
|
|
|
|
|
*/
|
|
|
|
|
public static BundleContext getBundleContext()
|
|
|
|
|
{
|
|
|
|
|
return bundleContext;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns a reference to a ConfigurationService implementation currently
|
|
|
|
|
* registered in the bundle context or null if no such implementation was
|
|
|
|
|
* found.
|
|
|
|
|
*
|
|
|
|
|
* @return a currently valid implementation of the ConfigurationService.
|
|
|
|
|
*/
|
|
|
|
|
public static ConfigurationService getConfigurationService()
|
|
|
|
|
{
|
|
|
|
|
if (configurationService == null)
|
|
|
|
|
{
|
|
|
|
|
configurationService
|
|
|
|
|
= ServiceUtils.getService(
|
|
|
|
|
bundleContext,
|
|
|
|
|
ConfigurationService.class);
|
|
|
|
|
}
|
|
|
|
|
return configurationService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns a reference to a FileAccessService implementation
|
|
|
|
|
* currently registered in the bundle context or null if no such
|
|
|
|
|
* implementation was found.
|
|
|
|
|
*
|
|
|
|
|
* @return a currently valid implementation of the
|
|
|
|
|
* FileAccessService .
|
|
|
|
|
*/
|
|
|
|
|
public static FileAccessService getFileAccessService()
|
|
|
|
|
{
|
|
|
|
|
if (fileAccessService == null)
|
|
|
|
|
{
|
|
|
|
|
fileAccessService
|
|
|
|
|
= ServiceUtils.getService(
|
|
|
|
|
bundleContext,
|
|
|
|
|
FileAccessService.class);
|
|
|
|
|
}
|
|
|
|
|
return fileAccessService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static MediaConfigurationService getMediaConfiguration()
|
|
|
|
|
{
|
|
|
|
|
return mediaConfiguration;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Gets the <tt>MediaService</tt> implementation instance registered by the
|
|
|
|
|
* neomedia bundle.
|
|
|
|
|
*
|
|
|
|
|
* @return the <tt>MediaService</tt> implementation instance registered by
|
|
|
|
|
* the neomedia bundle
|
|
|
|
|
*/
|
|
|
|
|
public static MediaServiceImpl getMediaServiceImpl()
|
|
|
|
|
{
|
|
|
|
|
return mediaServiceImpl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the <tt>NotificationService</tt> obtained from the bundle
|
|
|
|
|
* context.
|
|
|
|
|
*
|
|
|
|
|
* @return The <tt>NotificationService</tt> obtained from the bundle
|
|
|
|
|
* context.
|
|
|
|
|
*/
|
|
|
|
|
public static NotificationService getNotificationService()
|
|
|
|
|
{
|
|
|
|
|
if(notificationService == null)
|
|
|
|
|
{
|
|
|
|
|
// Get the notification service implementation
|
|
|
|
|
ServiceReference notifReference = bundleContext
|
|
|
|
|
.getServiceReference(NotificationService.class.getName());
|
|
|
|
|
|
|
|
|
|
notificationService = (NotificationService) bundleContext
|
|
|
|
|
.getService(notifReference);
|
|
|
|
|
|
|
|
|
|
if(notificationService != null)
|
|
|
|
|
{
|
|
|
|
|
// Register a popup message for a device configuration changed
|
|
|
|
|
// notification.
|
|
|
|
|
notificationService.registerDefaultNotificationForEvent(
|
|
|
|
|
DEVICE_CONFIGURATION_HAS_CHANGED,
|
|
|
|
|
net.java.sip.communicator.service.notification.NotificationAction.ACTION_POPUP_MESSAGE,
|
|
|
|
|
"Device configuration has changed",
|
|
|
|
|
null);
|
|
|
|
|
|
|
|
|
|
// Register a popup message for a new device selected for audio
|
|
|
|
|
// in, audio out or notifications.
|
|
|
|
|
notificationService.registerDefaultNotificationForEvent(
|
|
|
|
|
NEW_SELECTED_DEVICE,
|
|
|
|
|
net.java.sip.communicator.service.notification.NotificationAction.ACTION_POPUP_MESSAGE,
|
|
|
|
|
"New selected device",
|
|
|
|
|
null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return notificationService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns a reference to the <tt>PacketLoggingService</tt> implementation
|
|
|
|
|
* currently registered in the bundle context or null if no such
|
|
|
|
|
* implementation was found.
|
|
|
|
|
*
|
|
|
|
|
* @return a reference to a <tt>PacketLoggingService</tt> implementation
|
|
|
|
|
* currently registered in the bundle context or null if no such
|
|
|
|
|
* implementation was found.
|
|
|
|
|
*/
|
|
|
|
|
public static PacketLoggingService getPacketLogging()
|
|
|
|
|
{
|
|
|
|
|
if (packetLoggingService == null)
|
|
|
|
|
{
|
|
|
|
|
packetLoggingService
|
|
|
|
|
= ServiceUtils.getService(
|
|
|
|
|
bundleContext,
|
|
|
|
|
PacketLoggingService.class);
|
|
|
|
|
}
|
|
|
|
|
return packetLoggingService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Gets the <tt>ResourceManagementService</tt> instance which represents the
|
|
|
|
|
* resources such as internationalized and localized text and images used by
|
|
|
|
|
* the neomedia bundle.
|
|
|
|
|
*
|
|
|
|
|
* @return the <tt>ResourceManagementService</tt> instance which represents
|
|
|
|
|
* the resources such as internationalized and localized text and images
|
|
|
|
|
* used by the neomedia bundle
|
|
|
|
|
*/
|
|
|
|
|
public static ResourceManagementService getResources()
|
|
|
|
|
{
|
|
|
|
|
if (resources == null)
|
|
|
|
|
{
|
|
|
|
|
resources
|
|
|
|
|
= ResourceManagementServiceUtils.getService(bundleContext);
|
|
|
|
|
}
|
|
|
|
|
return resources;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the video configuration form.
|
|
|
|
|
*
|
|
|
|
|
* @return The video configuration form.
|
|
|
|
|
*/
|
|
|
|
|
public static ConfigurationForm getVideoConfigurationForm()
|
|
|
|
|
{
|
|
|
|
|
return videoConfigurationForm;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A listener to the click on the popup message concerning audio device
|
|
|
|
|
* configuration changes.
|
|
|
|
|
*/
|
|
|
|
|
private AudioDeviceConfigurationListener
|
|
|
|
|
audioDeviceConfigurationPropertyChangeListener;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The <tt>Logger</tt> used by the <tt>NeomediaActivator</tt> class and its
|
|
|
|
|
* instances for logging output.
|
|
|
|
|
*/
|
|
|
|
|
private final Logger logger = Logger.getLogger(NeomediaActivator.class);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Starts the execution of the neomedia bundle in the specified context.
|
|
|
|
|
@ -382,30 +571,24 @@ public void stop(BundleContext bundleContext)
|
|
|
|
|
{
|
|
|
|
|
mediaServiceImpl
|
|
|
|
|
.getDeviceConfiguration()
|
|
|
|
|
.removePropertyChangeListener(
|
|
|
|
|
audioDeviceConfigurationPropertyChangeListener);
|
|
|
|
|
if(audioDeviceConfigurationPropertyChangeListener != null)
|
|
|
|
|
{
|
|
|
|
|
audioDeviceConfigurationPropertyChangeListener
|
|
|
|
|
.managePopupMessageListenerRegistration(false);
|
|
|
|
|
audioDeviceConfigurationPropertyChangeListener = null;
|
|
|
|
|
}
|
|
|
|
|
.removePropertyChangeListener(
|
|
|
|
|
audioDeviceConfigurationPropertyChangeListener);
|
|
|
|
|
audioDeviceConfigurationPropertyChangeListener.dispose();
|
|
|
|
|
audioDeviceConfigurationPropertyChangeListener = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Disabled until video hotplug is not available.
|
|
|
|
|
/*if(videoDeviceConfigurationPropertyChangeListener != null)
|
|
|
|
|
// Disabled until video hotplug is available.
|
|
|
|
|
/*
|
|
|
|
|
if(videoDeviceConfigurationPropertyChangeListener != null)
|
|
|
|
|
{
|
|
|
|
|
mediaServiceImpl
|
|
|
|
|
.getDeviceConfiguration()
|
|
|
|
|
.removePropertyChangeListener(
|
|
|
|
|
videoDeviceConfigurationPropertyChangeListener);
|
|
|
|
|
if(videoDeviceConfigurationPropertyChangeListener != null)
|
|
|
|
|
{
|
|
|
|
|
videoDeviceConfigurationPropertyChangeListener
|
|
|
|
|
.managePopupMessageListenerRegistration(false);
|
|
|
|
|
videoDeviceConfigurationPropertyChangeListener = null;
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
.removePropertyChangeListener(
|
|
|
|
|
videoDeviceConfigurationPropertyChangeListener);
|
|
|
|
|
videoDeviceConfigurationPropertyChangeListener.dispose();
|
|
|
|
|
videoDeviceConfigurationPropertyChangeListener = null;
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
finally
|
|
|
|
|
{
|
|
|
|
|
@ -415,193 +598,4 @@ public void stop(BundleContext bundleContext)
|
|
|
|
|
resources = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns a reference to a ConfigurationService implementation currently
|
|
|
|
|
* registered in the bundle context or null if no such implementation was
|
|
|
|
|
* found.
|
|
|
|
|
*
|
|
|
|
|
* @return a currently valid implementation of the ConfigurationService.
|
|
|
|
|
*/
|
|
|
|
|
public static ConfigurationService getConfigurationService()
|
|
|
|
|
{
|
|
|
|
|
if (configurationService == null)
|
|
|
|
|
{
|
|
|
|
|
configurationService
|
|
|
|
|
= ServiceUtils.getService(
|
|
|
|
|
bundleContext,
|
|
|
|
|
ConfigurationService.class);
|
|
|
|
|
}
|
|
|
|
|
return configurationService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns a reference to a FileAccessService implementation
|
|
|
|
|
* currently registered in the bundle context or null if no such
|
|
|
|
|
* implementation was found.
|
|
|
|
|
*
|
|
|
|
|
* @return a currently valid implementation of the
|
|
|
|
|
* FileAccessService .
|
|
|
|
|
*/
|
|
|
|
|
public static FileAccessService getFileAccessService()
|
|
|
|
|
{
|
|
|
|
|
if (fileAccessService == null)
|
|
|
|
|
{
|
|
|
|
|
fileAccessService
|
|
|
|
|
= ServiceUtils.getService(
|
|
|
|
|
bundleContext,
|
|
|
|
|
FileAccessService.class);
|
|
|
|
|
}
|
|
|
|
|
return fileAccessService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Gets the <tt>MediaService</tt> implementation instance registered by the
|
|
|
|
|
* neomedia bundle.
|
|
|
|
|
*
|
|
|
|
|
* @return the <tt>MediaService</tt> implementation instance registered by
|
|
|
|
|
* the neomedia bundle
|
|
|
|
|
*/
|
|
|
|
|
public static MediaServiceImpl getMediaServiceImpl()
|
|
|
|
|
{
|
|
|
|
|
return mediaServiceImpl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static MediaConfigurationService getMediaConfiguration()
|
|
|
|
|
{
|
|
|
|
|
return mediaConfiguration;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Gets the <tt>ResourceManagementService</tt> instance which represents the
|
|
|
|
|
* resources such as internationalized and localized text and images used by
|
|
|
|
|
* the neomedia bundle.
|
|
|
|
|
*
|
|
|
|
|
* @return the <tt>ResourceManagementService</tt> instance which represents
|
|
|
|
|
* the resources such as internationalized and localized text and images
|
|
|
|
|
* used by the neomedia bundle
|
|
|
|
|
*/
|
|
|
|
|
public static ResourceManagementService getResources()
|
|
|
|
|
{
|
|
|
|
|
if (resources == null)
|
|
|
|
|
{
|
|
|
|
|
resources
|
|
|
|
|
= ResourceManagementServiceUtils.getService(bundleContext);
|
|
|
|
|
}
|
|
|
|
|
return resources;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns a reference to the <tt>PacketLoggingService</tt> implementation
|
|
|
|
|
* currently registered in the bundle context or null if no such
|
|
|
|
|
* implementation was found.
|
|
|
|
|
*
|
|
|
|
|
* @return a reference to a <tt>PacketLoggingService</tt> implementation
|
|
|
|
|
* currently registered in the bundle context or null if no such
|
|
|
|
|
* implementation was found.
|
|
|
|
|
*/
|
|
|
|
|
public static PacketLoggingService getPacketLogging()
|
|
|
|
|
{
|
|
|
|
|
if (packetLoggingService == null)
|
|
|
|
|
{
|
|
|
|
|
packetLoggingService
|
|
|
|
|
= ServiceUtils.getService(
|
|
|
|
|
bundleContext,
|
|
|
|
|
PacketLoggingService.class);
|
|
|
|
|
}
|
|
|
|
|
return packetLoggingService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the <tt>NotificationService</tt> obtained from the bundle
|
|
|
|
|
* context.
|
|
|
|
|
*
|
|
|
|
|
* @return The <tt>NotificationService</tt> obtained from the bundle
|
|
|
|
|
* context.
|
|
|
|
|
*/
|
|
|
|
|
public static NotificationService getNotificationService()
|
|
|
|
|
{
|
|
|
|
|
if(notificationService == null)
|
|
|
|
|
{
|
|
|
|
|
// Get the notification service implementation
|
|
|
|
|
ServiceReference notifReference = bundleContext
|
|
|
|
|
.getServiceReference(NotificationService.class.getName());
|
|
|
|
|
|
|
|
|
|
notificationService = (NotificationService) bundleContext
|
|
|
|
|
.getService(notifReference);
|
|
|
|
|
|
|
|
|
|
if(notificationService != null)
|
|
|
|
|
{
|
|
|
|
|
// Register a popup message for a device configuration changed
|
|
|
|
|
// notification.
|
|
|
|
|
notificationService.registerDefaultNotificationForEvent(
|
|
|
|
|
DEVICE_CONFIGURATION_HAS_CHANGED,
|
|
|
|
|
net.java.sip.communicator.service.notification.NotificationAction.ACTION_POPUP_MESSAGE,
|
|
|
|
|
"Device configuration has changed",
|
|
|
|
|
null);
|
|
|
|
|
|
|
|
|
|
// Register a popup message for a new device selected for audio
|
|
|
|
|
// in, audio out or notifications.
|
|
|
|
|
notificationService.registerDefaultNotificationForEvent(
|
|
|
|
|
NEW_SELECTED_DEVICE,
|
|
|
|
|
net.java.sip.communicator.service.notification.NotificationAction.ACTION_POPUP_MESSAGE,
|
|
|
|
|
"New selected device",
|
|
|
|
|
null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return notificationService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the context in which the one and only <tt>NeomediaActivator</tt>
|
|
|
|
|
* instance has started executing.
|
|
|
|
|
*
|
|
|
|
|
* @return The context in which the one and only <tt>NeomediaActivator</tt>
|
|
|
|
|
* instance has started executing.
|
|
|
|
|
*/
|
|
|
|
|
public static BundleContext getBundleContext()
|
|
|
|
|
{
|
|
|
|
|
return bundleContext;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the audio configuration form used to define the
|
|
|
|
|
* capture/notify/playback audio devices.
|
|
|
|
|
*
|
|
|
|
|
* @return The audio configuration form used to define the
|
|
|
|
|
* capture/notify/playback audio devices.
|
|
|
|
|
*/
|
|
|
|
|
public static ConfigurationForm getAudioConfigurationForm()
|
|
|
|
|
{
|
|
|
|
|
return audioConfigurationForm;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the video configuration form.
|
|
|
|
|
*
|
|
|
|
|
* @return The video configuration form.
|
|
|
|
|
*/
|
|
|
|
|
public static ConfigurationForm getVideoConfigurationForm()
|
|
|
|
|
{
|
|
|
|
|
return videoConfigurationForm;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the <tt>AudioService</tt> obtained from the bundle
|
|
|
|
|
* context.
|
|
|
|
|
* @return the <tt>AudioService</tt> obtained from the bundle
|
|
|
|
|
* context
|
|
|
|
|
*/
|
|
|
|
|
public static AudioNotifierService getAudioNotifierService()
|
|
|
|
|
{
|
|
|
|
|
if(audioNotifierService == null)
|
|
|
|
|
{
|
|
|
|
|
audioNotifierService
|
|
|
|
|
= ServiceUtils.getService(
|
|
|
|
|
bundleContext,
|
|
|
|
|
AudioNotifierService.class);
|
|
|
|
|
}
|
|
|
|
|
return audioNotifierService;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|