Interface MediaFormatFactory

  • All Known Implementing Classes:
    MediaFormatFactoryImpl

    public interface MediaFormatFactory
    Allows the creation of audio and video MediaFormat instances.
    Author:
    Emil Ivov, Lubomir Marinov
    • Field Detail

      • CHANNELS_NOT_SPECIFIED

        static final int CHANNELS_NOT_SPECIFIED
        The constant to be used as an argument representing number of channels to denote that a specific number of channels is not specified.
        See Also:
        Constant Field Values
      • CLOCK_RATE_NOT_SPECIFIED

        static final double CLOCK_RATE_NOT_SPECIFIED
        The constant to be used as an argument representing a clock rate to denote that a specific clock rate is not specified.
        See Also:
        Constant Field Values
    • Method Detail

      • createUnknownMediaFormat

        MediaFormat createUnknownMediaFormat​(org.jitsi.utils.MediaType type)
        Creates an unknown MediaFormat.
        Parameters:
        type - MediaType
        Returns:
        unknown MediaFormat
      • createMediaFormat

        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.
        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
      • createMediaFormat

        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.
        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
      • createMediaFormat

        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.
        Parameters:
        encoding - the well-known encoding (name) to create a MediaFormat for
        clockRate - 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
      • createMediaFormat

        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.
        Parameters:
        encoding - the well-known encoding (name) to create a MediaFormat for
        clockRate - the clock rate in Hz to create a MediaFormat for
        channels - 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
      • createMediaFormat

        MediaFormat createMediaFormat​(String encoding,
                                      double clockRate,
                                      Map<String,​String> formatParams,
                                      Map<String,​String> advancedAttrs)
        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.
        Parameters:
        encoding - the well-known encoding (name) to create a MediaFormat for
        clockRate - the clock rate in Hz to create a MediaFormat for
        formatParams - any codec specific parameters which have been received via SIP/SDP or XMPP/Jingle
        advancedAttrs - 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
      • createMediaFormat

        MediaFormat createMediaFormat​(String encoding,
                                      double clockRate,
                                      int channels,
                                      float frameRate,
                                      Map<String,​String> formatParams,
                                      Map<String,​String> advancedAttrs)
        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.
        Parameters:
        encoding - the well-known encoding (name) to create a MediaFormat for
        clockRate - the clock rate in Hz to create a MediaFormat for
        frameRate - the frame rate in number of frames per second to create a MediaFormat for
        channels - the number of available channels (1 for mono, 2 for stereo) if it makes sense for the MediaFormat with the specified encoding; otherwise, ignored
        formatParams - any codec specific parameters which have been received via SIP/SDP or XMPP/Jingle
        advancedAttrs - advanced attributes 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
      • createMediaFormat

        MediaFormat createMediaFormat​(byte rtpPayloadType,
                                      String encoding,
                                      double clockRate,
                                      int channels,
                                      float frameRate,
                                      Map<String,​String> formatParams,
                                      Map<String,​String> advancedAttrs)
        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 not MediaFormat.RTP_PAYLOAD_TYPE_UNKNOWN and encoding is null, uses the encoding associated with rtpPayloadType.
        Parameters:
        rtpPayloadType - the RTP payload type to create a MediaFormat for; MediaFormat.RTP_PAYLOAD_TYPE_UNKNOWN if encoding is not null. If rtpPayloadType is not MediaFormat#RTP_PAYLOAD_TYPE_UNKNOWN and encoding is not null, rtpPayloadType is ignored
        encoding - the well-known encoding (name) to create a MediaFormat for; null
        clockRate - the clock rate in Hz to create a MediaFormat for
        frameRate - the frame rate in number of frames per second to create a MediaFormat for
        channels - the number of available channels (1 for mono, 2 for stereo) if it makes sense for the MediaFormat with the specified encoding; otherwise, ignored
        formatParams - any codec specific parameters which have been received via SIP/SDP or XMPP/Jingle
        advancedAttrs - advanced attributes 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