|
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.impl.media.MediaServiceImpl
public class MediaServiceImpl
The service is meant to be a wrapper of media libraries such as JMF, (J)FFMPEG, JMFPAPI, and others. It takes care of all media play and capture as well as media transport (e.g. over RTP). Before being able to use this service calls would have to make sure that it is initialized (i.e. consult the isInitialized() method).
| Field Summary |
|---|
| Fields inherited from interface net.java.sip.communicator.service.media.MediaService |
|---|
BIND_RETRIES_DEFAULT_VALUE, BIND_RETRIES_PROPERTY_NAME, DISABLE_VIDEO_SUPPORT_PROPERTY_NAME, MAX_PORT_NUMBER_PROPERTY_NAME, MIN_PORT_NUMBER_PROPERTY_NAME |
| Constructor Summary | |
|---|---|
MediaServiceImpl()
Default constructor |
|
| Method Summary | |
|---|---|
void |
addMediaListener(MediaListener listener)
Adds a listener that will be listening for incoming media and changes in the state of the media listener. |
protected void |
assertStarted()
Verifies whether the media service is started and ready for use and throws an exception otherwise. |
CallSession |
createCallSession(Call call)
Creates a call session for call. |
RtpFlow |
createRtpFlow(String localIP,
int localPort,
String remoteIP,
int remotePort,
Map<String,List<String>> mediaEncodings)
A RtpFlow is an object which role is to handle media data transfer, capture and playback. |
double |
getDataSourceDurationSeconds(Call call)
Returns the duration (in milliseconds) of the data source being used for the given call. |
DeviceConfiguration |
getDeviceConfiguration()
A valid instance of the DeviceConfiguration that a call session may use to query for supported support of audio/video capture. |
EncodingConfiguration |
getEncodingConfiguration()
A valid instance of the EncodingConfiguration that a call session may use to query for encodings and their priority. |
MediaControl |
getMediaControl()
A valid instance of the Media Control that the call session may use to query for supported audio video encodings. |
MediaControl |
getMediaControl(Call call)
The MediaControl instance that is mapped to call. |
javax.sdp.SdpFactory |
getSdpFactory()
A valid instance of an SDP factory that call session may use for manipulating sdp data. |
String[] |
getSupportedAudioEncodings()
Implements getSupportedAudioEncodings from interface MediaService |
String[] |
getSupportedVideoEncodings()
Implements getSupportedVideoEncodings from interface MediaService |
boolean |
isStarted()
Returns true if the media service implementation is initialized and ready for use by other services, and false otherwise. |
static void |
main(String[] args)
This method is here most probably only temporarily for the sake of testing. |
void |
removeMediaListener(MediaListener listener)
Removes a listener that was listening for incoming media and changes in the state of the media listener |
void |
setCallDataSink(Call call,
URL dataSinkURL)
Sets the Data Destination for call to the URL dataSinkURL instead of the default data destination. |
void |
setCallDataSource(Call call,
URL dataSourceURL)
Sets the data source for call to the URL dataSourceURL instead of the default data source. |
void |
shutdown()
Makes the service implementation close all release any devices or other resources that it might have allocated and prepare for shutdown/garbage collection. |
void |
start()
Initializes the service implementation, and puts it in a state where it could interoperate with other services. |
void |
stop()
Releases all resources and prepares for shutdown. |
void |
unsetCallDataSink(Call call)
Unsets the data destination for call, which will now send data to the default destination. |
void |
unsetCallDataSource(Call call)
Unsets the data source for call, which will now use the default data source. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MediaServiceImpl()
| Method Detail |
|---|
public String[] getSupportedAudioEncodings()
getSupportedAudioEncodings in interface MediaServicepublic String[] getSupportedVideoEncodings()
getSupportedVideoEncodings in interface MediaService
public CallSession createCallSession(Call call)
throws MediaException
createCallSession in interface MediaServicecall - the Call that we'll be encapsulating in the newly created
session.
MediaException - with code IO_ERROR if we fail allocating ports.
public RtpFlow createRtpFlow(String localIP,
int localPort,
String remoteIP,
int remotePort,
Map<String,List<String>> mediaEncodings)
throws MediaException
createRtpFlow in interface MediaServicelocalIP - local address of this RtpFlowlocalPort - local port of this RtpFlowremoteIP - remote address of this RtpFlowremotePort - remote port of this RtpFlowmediaEncodings - format used to encode data on this flow
MediaException - if operation failspublic void addMediaListener(MediaListener listener)
addMediaListener in interface MediaServicelistener - the listener to registerpublic void removeMediaListener(MediaListener listener)
removeMediaListener in interface MediaServicelistener - the listener to removepublic void start()
public void stop()
public boolean isStarted()
isStarted in interface MediaService
protected void assertStarted()
throws MediaException
MediaException - if the media service is not started and ready for
use.public void shutdown()
public javax.sdp.SdpFactory getSdpFactory()
public MediaControl getMediaControl()
public MediaControl getMediaControl(Call call)
call - the call to fetch the MediaControl of
public DeviceConfiguration getDeviceConfiguration()
public EncodingConfiguration getEncodingConfiguration()
public void setCallDataSource(Call call,
URL dataSourceURL)
throws MediaException
setCallDataSource in interface MediaServicecall - the Call whose data source will be changeddataSourceURL - the URL of the new data source
MediaException - if we fail to initialize the data sourcepublic double getDataSourceDurationSeconds(Call call)
getDataSourceDurationSeconds in interface MediaServicecall - the call whose data source duration will be retrieved
public void unsetCallDataSource(Call call)
unsetCallDataSource in interface MediaServicecall - the call whose data source mapping will be released
public void setCallDataSink(Call call,
URL dataSinkURL)
setCallDataSink in interface MediaServicecall - the call whose data destination will be changeddataSinkURL - the URL of the new data sink.public void unsetCallDataSink(Call call)
unsetCallDataSink in interface MediaServicecall - the call whose data destination mapping will be released
public static void main(String[] args)
throws Throwable
args - String[]
Throwable - if it doesn't feel like executing today.
|
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 | |||||||||