|
SIP Communicator: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.java.sip.communicator.util.PropertyChangeNotifier
net.java.sip.communicator.impl.media.MediaControl
public class MediaControl
Provides a generic way to control media package.
| Field Summary | |
|---|---|
static String |
VIDEO_DATA_SOURCE
The property which represents the current video DataSource. |
| Constructor Summary | |
|---|---|
MediaControl()
The default constructor. |
|
| Method Summary | |
|---|---|
void |
closeCaptureDevices()
Closes all currently used capture devices and data sources so that they would be usable by other applications. |
static javax.media.protocol.DataSource |
createDataSource(javax.media.MediaLocator locator)
Returns a JMF DataSource object over the device that locator points to. |
javax.media.protocol.DataSource |
createDataSourceForEncodings(Map<String,List<String>> encodingSets)
Creates a processing data source using the encodingSets map to determine the formats/encodings allowed for the various media types. |
javax.media.protocol.DataSource |
createLocalVideoDataSource()
Creates a DataSource which gives access to the local video
this instance captures and controls. |
protected int |
findFirstMatchingFormat(javax.media.Format[] availableFormats,
Map<String,List<String>> requestedEncodings)
Looks for the first encoding (among the requested encodings elements) that is also present in the availableFormats array and returns the index of the corresponding Format. |
javax.media.Time |
getOutputDuration()
Returns the duration of the output data source. |
String[] |
getSupportedAudioEncodings()
Returns an array of Strings containing audio formats in the order of preference. |
String[] |
getSupportedVideoEncodings()
Returns an array of Strings containing video formats in the order of preference. |
void |
initDataSourceFromURL(URL dataSourceURL)
Opens the source pointed to by the dataSourceURL URL and prepares to use it instead of capture devices |
void |
initDebugDataSource(String debugMediaSource)
Opens the source pointed to by the debugMediaSource URL and prepares to use it instead of capture devices. |
void |
initialize(DeviceConfiguration deviceConfig,
EncodingConfiguration encodingConfig)
Initializes the media control. |
boolean |
isLocalVideoAllowed()
Gets the indicator which determines whether the streaming of local video through this MediaControl is allowed. |
boolean |
isMute()
Determines whether the audio of this instance is mute. |
static Dimension |
selectVideoSize(javax.media.protocol.DataSource videoDS,
int preferredWidth,
int preferredHeight)
|
void |
setLocalVideoAllowed(boolean allowed)
Sets the indicator which determines whether the streaming of local video through this MediaControl is allowed. |
void |
setMute(boolean mute)
Sets the mute state of the audio of this instance. |
void |
startProcessingMedia(Object reader)
Starts reading media from the source data sources. |
void |
stopProcessingMedia(Object reader)
Stops reading media from the source data sources. |
| Methods inherited from class net.java.sip.communicator.util.PropertyChangeNotifier |
|---|
addPropertyChangeListener, firePropertyChange, getPropertyChangeSource, removePropertyChangeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String VIDEO_DATA_SOURCE
DataSource.
| Constructor Detail |
|---|
public MediaControl()
| Method Detail |
|---|
public javax.media.Time getOutputDuration()
public void initialize(DeviceConfiguration deviceConfig,
EncodingConfiguration encodingConfig)
throws MediaException
deviceConfig - the DeviceConfiguration that we should use
when retrieving device handlers.
MediaException - if initialization fails.
public void initDebugDataSource(String debugMediaSource)
throws MediaException
debugMediaSource - an url (e.g. file:/home/user/movie.mov) pointing
to a media file to use instead of capture devices.
MediaException - if opening the devices fails.
public void initDataSourceFromURL(URL dataSourceURL)
throws MediaException
dataSourceURL - an URL (e.g. file:/home/user/outgoing_message.wav)
pointing to a media file to use instead of capture devices
MediaException - if opening the devices fails
public void closeCaptureDevices()
throws MediaException
MediaException - if closing the devices fails with an IO
Exception.public static javax.media.protocol.DataSource createDataSource(javax.media.MediaLocator locator)
locator - the MediaLocator of the device/movie that we'd like to
transmit from.
public javax.media.protocol.DataSource createDataSourceForEncodings(Map<String,List<String>> encodingSets)
throws MediaException
encodingSets - a hashtable mapping media types such as "audio" or
"video" to Lista of encodings (ordered by preference)
accepted for the corresponding type.
MediaException - if creating the data source fails for some reason.
protected int findFirstMatchingFormat(javax.media.Format[] availableFormats,
Map<String,List<String>> requestedEncodings)
availableFormats - an array of JMF Formats that we're
currently able to transmit.requestedEncodings - a table mapping media types (e.g. audio or
video) to a list of encodings that our interlocutor has sent
in order of preference.
public String[] getSupportedVideoEncodings()
public String[] getSupportedAudioEncodings()
public void startProcessingMedia(Object reader)
reader - a reference to the object calling this method, that we
could use for keeping the number of simultaneous active readers.public void stopProcessingMedia(Object reader)
reader - a reference to the object calling this method, that we
could use for keeping the number of simultaneous active readers.public boolean isMute()
public void setMute(boolean mute)
mute - true to mute the audio of this instance;
false, otherwise
public static Dimension selectVideoSize(javax.media.protocol.DataSource videoDS,
int preferredWidth,
int preferredHeight)
public javax.media.protocol.DataSource createLocalVideoDataSource()
DataSource which gives access to the local video
this instance captures and controls.
DataSource which gives access to the local video
this instance captures and controls; null if video is
not utilized by this instance
public void setLocalVideoAllowed(boolean allowed)
throws MediaException
MediaControl is allowed. The setting does not
reflect the availability of actual video capture devices, it just
expresses the desire of the user to have the local video streamed in the
case the system is actually able to do so.
allowed - true to allow the streaming of local video for
this MediaControl; false to disallow it
MediaExceptionpublic boolean isLocalVideoAllowed()
MediaControl is allowed. The setting does not
reflect the availability of actual video capture devices, it just
expresses the desire of the user to have the local video streamed in the
case the system is actually able to do so.
MediaControl is allowed; false, otherwise
|
SIP Communicator: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||