Adds work on the new MediaService (Work in Progress)

cusax-fix
Emil Ivov 17 years ago
parent a1bb5aed2d
commit 3fa60052e6

@ -55,7 +55,7 @@ public interface MediaService
* new random port).
*/
public static final int BIND_RETRIES_DEFAULT_VALUE = 50;
/**
* With this property video support can be disabled
* (enabled by default).
@ -111,7 +111,7 @@ public CallSession createCallSession(Call call)
* @param remotePort remote port of for this flow
* @param mediaEncodings encoding used for media on this flow
* @return a <tt>RtpFlow</tt> with the corresponding parameters
* @throws MediaException throw a media exception if we fail to create the
* @throws MediaException throw a media exception if we fail to create the
* flow
*/
public RtpFlow createRtpFlow(String localIP,

@ -6,28 +6,19 @@
*/
package net.java.sip.communicator.service.neomedia;
import java.util.*;
import net.java.sip.communicator.service.neomedia.device.*;
/**
* The <tt>MediaService</tt> service is meant to be a wrapper of media libraries
* such as JMF, FMJ, FFMPEG, and others. It takes care of all media play and
* such as JMF, FMJ, FFMPEG, and/or others. It takes care of all media play and
* capture as well as media transport (e.g. over RTP).
*
* @author Emil Ivov
*/
public interface MediaService
{
/**
* Returns an array of <tt>MediaType</tt> instances indicating the types
* that an implementation supports. A <tt>MediaType</tt> is considered
* supported if an implementation supports either rendering or capturing
* that type of media.
*
* @return an array of <tt>MediaType</tt> instances indicating the types of
* media that this service supports.
*/
public MediaType[] getSupportedMediaTypes();
/**
* Returns the default <tt>MediaDevice</tt> for the specified media
* <tt>type</tt>. In most cases users
@ -39,4 +30,17 @@ public interface MediaService
* <tt>MediaType</tt>, or <tt>null</tt> if no such device exists.
*/
public MediaDevice getDefaultDevice(MediaType type);
/**
* Returns a list containing all devices known to this service
* implementation and handling the specified <tt>MediaType</tt>.
*
* @param mediaType the media type that
*
* @return the list of <tt>MediaDevices</tt> currently known to handle the
* specified <tt>mediaType</tt>.
*/
public List<MediaDevice> getDevices(MediaType mediaType);
}

@ -6,6 +6,11 @@
*/
package net.java.sip.communicator.service.neomedia.device;
import java.util.*;
import net.java.sip.communicator.service.neomedia.*;
import net.java.sip.communicator.service.neomedia.format.*;
/**
* The <tt>MediaDevice</tt> class represents capture and playback devices that
* can be used to grab or render media. Sound cards, USB phones and webcams are
@ -13,7 +18,46 @@
*
* @author Emil Ivov
*/
public class MediaDevice
public interface MediaDevice
{
/**
* Direction values
*/
public static enum Direction{ IN, OUT, INOUT};
/**
* Returns a list of <tt>MediaFormat</tt> instances representing the media
* formats supported by this <tt>MediaDevice</tt>.
*
* @return the list of <tt>MediaFormat</tt>s supported by this device.
*/
public List<MediaFormat> getSupportedFormats();
/**
* Returns the <tt>MediaType</tt> that this device supports.
*
* @return <tt>MediaType.AUDIO</tt> if this is an audio device or
* <tt>MediaType.VIDEO</tt> in case of a video device.
*/
public MediaType getMediaType();
/**
* Specifies the <tt>MediaFormat</tt> that this device should use when
* capturing data.
*
* @param format the <tt>MediaFormat</tt> that this device should use when
* capturing media.
*
* @throws IllegalArgumentException if <tt>format</tt> is not among
* <tt>MediaFormet</tt>s supported by this <tt>MediaDevice</tt>.
*/
public void setFormat(MediaFormat format) throws IllegalArgumentException;
/**
* Returns the <tt>MediaFormat</tt> that this device is currently set to use
* when capturing data.
*
* @return the <tt>MediaFormat</tt> that this device is currently set to
* provide media in.
*/
public MediaFormat getFormat();
}

Loading…
Cancel
Save