Package org.jitsi.impl.neomedia.format
Class MediaFormatFactoryImpl
- java.lang.Object
-
- org.jitsi.impl.neomedia.format.MediaFormatFactoryImpl
-
- All Implemented Interfaces:
MediaFormatFactory
public class MediaFormatFactoryImpl extends Object implements MediaFormatFactory
Implements MediaFormatFactory for the JMF Format types.- Author:
- Lyubomir Marinov
-
-
Field Summary
-
Fields inherited from interface org.jitsi.service.neomedia.format.MediaFormatFactory
CHANNELS_NOT_SPECIFIED, CLOCK_RATE_NOT_SPECIFIED
-
-
Constructor Summary
Constructors Constructor Description MediaFormatFactoryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MediaFormatcreateMediaFormat(byte rtpPayloadType)Creates a MediaFormat for the specified RTP payload type with default clock rate and set of format parameters.MediaFormatcreateMediaFormat(byte rtpPayloadType, String encoding, double clockRate, int channels, float frameRate, Map<String,String> formatParams, Map<String,String> advancedParams)Creates a MediaFormat either for the specified rtpPayloadType or for the specified encoding, clockRate, channels and set of format parameters.MediaFormatcreateMediaFormat(String encoding)Creates a MediaFormat for the specified encoding with default clock rate and set of format parameters.MediaFormatcreateMediaFormat(String encoding, double clockRate)Creates a MediaFormat for the specified encoding with the specified clockRate and a default set of format parameters.MediaFormatcreateMediaFormat(String encoding, double clockRate, int channels)Creates a MediaFormat for the specified encoding, clockRate and channels and a default set of format parameters.MediaFormatcreateMediaFormat(String encoding, double clockRate, int channels, float frameRate, Map<String,String> formatParams, Map<String,String> advancedParams)Creates a MediaFormat for the specified encoding, clockRate, channels and set of format parameters.MediaFormatcreateMediaFormat(String encoding, double clockRate, Map<String,String> formatParams, Map<String,String> advancedParams)Creates a MediaFormat for the specified encoding, clockRate and set of format parameters.MediaFormatcreateUnknownMediaFormat(org.jitsi.utils.MediaType type)Creates an unknown MediaFormat.
-
-
-
Method Detail
-
createUnknownMediaFormat
public MediaFormat createUnknownMediaFormat(org.jitsi.utils.MediaType type)
Creates an unknown MediaFormat.- Specified by:
createUnknownMediaFormatin interfaceMediaFormatFactory- Parameters:
type- MediaType- Returns:
- unknown MediaFormat
-
createMediaFormat
public MediaFormat createMediaFormat(String encoding)
Creates a MediaFormat for the specified encoding with default clock rate and set of format parameters. If encoding is known to this MediaFormatFactory, returns a MediaFormat which is either an AudioMediaFormat or a VideoMediaFormat instance. Otherwise, returns null.- Specified by:
createMediaFormatin interfaceMediaFormatFactory- Parameters:
encoding- the well-known encoding (name) to create a MediaFormat for- Returns:
- a MediaFormat with the specified encoding which is either an AudioMediaFormat or a VideoMediaFormat instance if encoding is known to this MediaFormatFactory; otherwise, null
- See Also:
MediaFormatFactory.createMediaFormat(String)
-
createMediaFormat
public MediaFormat createMediaFormat(byte rtpPayloadType)
Creates a MediaFormat for the specified RTP payload type with default clock rate and set of format parameters. If rtpPayloadType is known to this MediaFormatFactory, returns a MediaFormat which is either an AudioMediaFormat or a VideoMediaFormat instance. Otherwise, returns null.- Specified by:
createMediaFormatin interfaceMediaFormatFactory- Parameters:
rtpPayloadType- the RTP payload type of the MediaFormat to create- Returns:
- a MediaFormat with the specified rtpPayloadType which is either an AudioMediaFormat or a VideoMediaFormat instance if rtpPayloadType is known to this MediaFormatFactory; otherwise, null
- See Also:
MediaFormatFactory.createMediaFormat(byte)
-
createMediaFormat
public MediaFormat createMediaFormat(String encoding, double clockRate)
Creates a MediaFormat for the specified encoding with the specified clockRate and a default set of format parameters. If encoding is known to this MediaFormatFactory, returns a MediaFormat which is either an AudioMediaFormat or a VideoMediaFormat instance. Otherwise, returns null.- Specified by:
createMediaFormatin interfaceMediaFormatFactory- Parameters:
encoding- the well-known encoding (name) to create a MediaFormat forclockRate- the clock rate in Hz to create a MediaFormat for- Returns:
- a MediaFormat with the specified encoding and clockRate which is either an AudioMediaFormat or a VideoMediaFormat instance if encoding is known to this MediaFormatFactory; otherwise, null
- See Also:
MediaFormatFactory.createMediaFormat(String, double)
-
createMediaFormat
public MediaFormat createMediaFormat(String encoding, double clockRate, int channels)
Creates a MediaFormat for the specified encoding, clockRate and channels and a default set of format parameters. If encoding is known to this MediaFormatFactory, returns a MediaFormat which is either an AudioMediaFormat or a VideoMediaFormat instance. Otherwise, returns null.- Specified by:
createMediaFormatin interfaceMediaFormatFactory- Parameters:
encoding- the well-known encoding (name) to create a MediaFormat forclockRate- the clock rate in Hz to create a MediaFormat forchannels- the number of available channels (1 for mono, 2 for stereo) if it makes sense for the MediaFormat with the specified encoding; otherwise, ignored- Returns:
- a MediaFormat with the specified encoding, clockRate and channels and a default set of format parameters which is either an AudioMediaFormat or a VideoMediaFormat instance if encoding is known to this MediaFormatFactory; otherwise, null
- See Also:
MediaFormatFactory.createMediaFormat(String, double, int)
-
createMediaFormat
public MediaFormat createMediaFormat(String encoding, double clockRate, Map<String,String> formatParams, Map<String,String> advancedParams)
Creates a MediaFormat for the specified encoding, clockRate and set of format parameters. If encoding is known to this MediaFormatFactory, returns a MediaFormat which is either an AudioMediaFormat or a VideoMediaFormat instance. Otherwise, returns null.- Specified by:
createMediaFormatin interfaceMediaFormatFactory- Parameters:
encoding- the well-known encoding (name) to create a MediaFormat forclockRate- the clock rate in Hz to create a MediaFormat forformatParams- any codec specific parameters which have been received via SIP/SDP or XMPP/JingleadvancedParams- advanced attributes received via SIP/SDP or XMPP/Jingle- Returns:
- a MediaFormat with the specified encoding, clockRate and set of format parameters which is either an AudioMediaFormat or a VideoMediaFormat instance if encoding is known to this MediaFormatFactory; otherwise, null
- See Also:
MediaFormatFactory.createMediaFormat(String, double, Map, Map)
-
createMediaFormat
public MediaFormat createMediaFormat(String encoding, double clockRate, int channels, float frameRate, Map<String,String> formatParams, Map<String,String> advancedParams)
Creates a MediaFormat for the specified encoding, clockRate, channels and set of format parameters. If encoding is known to this MediaFormatFactory, returns a MediaFormat which is either an AudioMediaFormat or a VideoMediaFormat instance. Otherwise, returns null.- Specified by:
createMediaFormatin interfaceMediaFormatFactory- Parameters:
encoding- the well-known encoding (name) to create a MediaFormat forclockRate- the clock rate in Hz to create a MediaFormat forframeRate- the frame rate in number of frames per second to create a MediaFormat forchannels- the number of available channels (1 for mono, 2 for stereo) if it makes sense for the MediaFormat with the specified encoding; otherwise, ignoredformatParams- any codec specific parameters which have been received via SIP/SDP or XMPP/JingleadvancedParams- any parameters which have been received via SIP/SDP or XMPP/Jingle- Returns:
- a MediaFormat with the specified encoding, clockRate, channels and set of format parameters which is either an AudioMediaFormat or a VideoMediaFormat instance if encoding is known to this MediaFormatFactory; otherwise, null
- See Also:
MediaFormatFactory.createMediaFormat(String, double, int, float, Map, Map)
-
createMediaFormat
public MediaFormat createMediaFormat(byte rtpPayloadType, String encoding, double clockRate, int channels, float frameRate, Map<String,String> formatParams, Map<String,String> advancedParams)
Creates a MediaFormat either for the specified rtpPayloadType or for the specified encoding, clockRate, channels and set of format parameters. If encoding is known to this MediaFormatFactory, ignores rtpPayloadType and returns a MediaFormat which is either an AudioMediaFormat or a VideoMediaFormat instance. If rtpPayloadType is notMediaFormat.RTP_PAYLOAD_TYPE_UNKNOWNand encoding is null, uses the encoding associated with rtpPayloadType.- Specified by:
createMediaFormatin interfaceMediaFormatFactory- Parameters:
rtpPayloadType- the RTP payload type to create a MediaFormat for;MediaFormat.RTP_PAYLOAD_TYPE_UNKNOWNif encoding is not null. If rtpPayloadType is not MediaFormat#RTP_PAYLOAD_TYPE_UNKNOWN and encoding is not null, rtpPayloadType is ignoredencoding- the well-known encoding (name) to create a MediaFormat for; nullclockRate- the clock rate in Hz to create a MediaFormat forframeRate- the frame rate in number of frames per second to create a MediaFormat forchannels- the number of available channels (1 for mono, 2 for stereo) if it makes sense for the MediaFormat with the specified encoding; otherwise, ignoredformatParams- any codec specific parameters which have been received via SIP/SDP or XMPP/JingleadvancedParams- any parameters which have been received via SIP/SDP or XMPP/Jingle- Returns:
- a MediaFormat with the specified encoding, clockRate, channels and set of format parameters which is either an AudioMediaFormat or a VideoMediaFormat instance if encoding is known to this MediaFormatFactory; otherwise, null
-
-