diff options
author | Emil Ivov <emcho@jitsi.org> | 2005-11-02 14:08:43 +0000 |
---|---|---|
committer | Emil Ivov <emcho@jitsi.org> | 2005-11-02 14:08:43 +0000 |
commit | c82e7e1327fd89ec30929a7d4e529039b751bf41 (patch) | |
tree | b2694122644e90a21bd0348f81a53a45841a37dd /src/net/java/sip/communicator/service/media/MediaService.java | |
parent | 462770b17bdbdffcf61b8862635738e46d58e505 (diff) | |
download | jitsi-c82e7e1327fd89ec30929a7d4e529039b751bf41.zip jitsi-c82e7e1327fd89ec30929a7d4e529039b751bf41.tar.gz jitsi-c82e7e1327fd89ec30929a7d4e529039b751bf41.tar.bz2 |
Initial sip-communicator-1.0 commit
Diffstat (limited to 'src/net/java/sip/communicator/service/media/MediaService.java')
-rw-r--r-- | src/net/java/sip/communicator/service/media/MediaService.java | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/src/net/java/sip/communicator/service/media/MediaService.java b/src/net/java/sip/communicator/service/media/MediaService.java new file mode 100644 index 0000000..6ee1acb --- /dev/null +++ b/src/net/java/sip/communicator/service/media/MediaService.java @@ -0,0 +1,86 @@ +/* + * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package net.java.sip.communicator.service.media; + +import net.java.sip.communicator.service.media.event.MediaListener; +import net.java.sip.communicator.service.protocol.*; + +/** + * 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 calles would have to make sure that + * it is initialized (i.e. consult the isInitialized() method). + * @author Emil Ivov + * @author Martin Andre + */ +public interface MediaService +{ + /** + * The method is meant for use by protocol service implementations when + * willing to send an invitation to a remote callee. It is at that point + * that the media service would open a port where it would be waiting for + * data coming from the specified call participant. Subsequent sdpoffers + * requested for the call that the original call participant belonged to, + * would receive, the same IP/port couple as the first one in order to allow + * conferencing. The associated port will be released once the call has + * ended. + * + * @param callParticipant the call participant meant to receive the offer + * @return a String containing an SDP offer. + */ + public String generateSdpOffer(CallParticipant callParticipant); + + /** + * The method is meant for use by protocol service implementations when + * willing to respond to an invitation received from a remote caller. It is + * at that point that the media service would open a port where it would + * wait for data coming from the specified call participant. Subsequent sdp + * offers/answers requested for the call that the original call participant + * belonged to will receive the same IP/port couple as the first one in + * order to allow conferencing. The associated port will be released once + * the call has ended. + * + * @param callParticipant the call participant meant to receive the answer + * @return a String containing an SDP answer. + */ + public String generateSdpAnswer(CallParticipant callParticipant); + + /** + * Adds a listener that will be listening for incoming media and changes + * in the state of the media listener + * @param listener the listener to register + */ + public void addMediaListener(MediaListener listener); + + /** + * Removes a listener that was listening for incoming media and changes + * in the state of the media listener + * @param listener the listener to remove + */ + public void removeMediaListener(MediaListener listener); + + /** + * Initializes the service implementation, and puts it in a state where it + * could interoperate with other services. + */ + public void initialize(); + + /** + * Returns true if the media service implementation is initialized and ready + * for use by other services, and false otherwise. + */ + public boolean isInitialized(); + + /** + * Makes the service implementation close all release any devices or other + * resources that it might have allocated and prepare for shutdown/garbage + * collection. + */ + public void shutdown(); +} |