Class RTPUtils


  • public class RTPUtils
    extends Object
    • Constructor Detail

      • RTPUtils

        public RTPUtils()
    • Method Detail

      • updateSDPDestination

        public static String updateSDPDestination​(RTPDestination rtpDestination,
                                                  String sdpData)
        Update SDP data information with RTP destination information
        Parameters:
        rtpDestination - RTP destination
        sdpData - SDP data
        Returns:
        modified SDP data
      • decodeRangeHeader

        public static double[] decodeRangeHeader​(String rangeStr)
        Decode RTP range header, Internal use.
        Parameters:
        rangeStr -
        Returns:
        range values
      • stopRTPPull

        public static void stopRTPPull​(RTPPushPublishSession rtpPushPublishSession)
        Stop pushing an RTP stream
        Parameters:
        rtpPushPublishSession - RTP push session
      • startRTPPull

        public static RTPPushPublishSession startRTPPull​(IApplicationInstance appInstance,
                                                         String streamName,
                                                         boolean streamPacketizer,
                                                         String ipAddress,
                                                         int streamPort,
                                                         boolean isRTPWrapped)
        Start pushing an RTP stream
        Parameters:
        appInstance - application instance
        streamName - stream name
        streamPacketizer - stream packetizer
        ipAddress - IP address
        streamPort - stream port
        isRTPWrapped - is RTP wrapped
        Returns:
        RTP push session
      • startRTPPull

        public static RTPPushPublishSession startRTPPull​(IApplicationInstance appInstance,
                                                         String streamName,
                                                         boolean streamPacketizer,
                                                         String ipAddress,
                                                         int streamPort)
        Start pushing an RTP stream
        Parameters:
        appInstance - application instance
        streamName - stream name
        streamPacketizer - stream packetizer
        ipAddress - IP address
        streamPort - stream port
        Returns:
        RTP push session
      • startRTPPull

        public static RTPPushPublishSession startRTPPull​(IApplicationInstance appInstance,
                                                         String streamName,
                                                         boolean streamPacketizer,
                                                         String ipAddress,
                                                         int audioPort,
                                                         int videoPort)
        Start pushing an RTP stream
        Parameters:
        appInstance - application instance
        streamName - stream name
        streamPacketizer - stream packetizer
        ipAddress - IP address
        audioPort - audio port
        videoPort - video port
        Returns:
        RTP push session
      • startRTPPull

        public static RTPPushPublishSession startRTPPull​(IApplicationInstance appInstance,
                                                         String streamName,
                                                         boolean streamPacketizer,
                                                         String ipAddress,
                                                         int audioPort,
                                                         int videoPort,
                                                         boolean isRTPWrapped)
        Start pushing an RTP stream
        Parameters:
        appInstance - application instance
        streamName - stream name
        streamPacketizer - stream packetizer
        ipAddress - IP address
        audioPort - audio port
        videoPort - video port
        isRTPWrapped - is RTP wrapped
        Returns:
        RTP push session
      • startRTPPull

        public static RTPPushPublishSession startRTPPull​(IApplicationInstance appInstance,
                                                         String streamName,
                                                         RTPDestination rtpDestination)
        Start pushing an RTP stream
        Parameters:
        appInstance - application instance
        streamName - stream name
        rtpDestination - RTP destination
        Returns:
        RTP push session
      • writeCodecConfig

        public static void writeCodecConfig​(com.wowza.wms.rtp.model.RTPTrack rtpTrack,
                                            int codecId,
                                            long adjTimecode,
                                            byte[] codecConfig)
      • writeCodecConfig

        public static void writeCodecConfig​(com.wowza.wms.rtp.model.RTPTrack rtpTrack,
                                            long adjTimecode,
                                            byte[] codecConfig)
        Write codec config information, Internal use.
        Parameters:
        rtpTrack - RTP track
        adjTimecode - timecode (milliseconds)
        codecConfig - codec config
      • writeCodecConfig

        public static void writeCodecConfig​(com.wowza.wms.rtp.model.RTPTrack rtpTrack,
                                            long adjTimecode,
                                            byte[] codecConfig,
                                            int codec)
      • loadConfigFile

        public static boolean loadConfigFile​(RTPContext rtpContext,
                                             String fileURL)
        Load config file, Internal use.
        Parameters:
        rtpContext -
        fileURL -
      • decodeStreamInfo

        public static RTPStream decodeStreamInfo​(RTPContext context,
                                                 String streamId,
                                                 String streamInfo)
        Decode SDP info and create RTP stream
        Parameters:
        context - RTP context
        streamId - stream id
        streamInfo - SDP data
        Returns:
        RTP stream
      • decodeStreamInfo

        public static RTPStream decodeStreamInfo​(IApplicationInstance appInstance,
                                                 RTPContext context,
                                                 String streamId,
                                                 String streamInfo)
        Decode SDP info and create RTP stream
        Parameters:
        appInstance - app instance
        context - rtp context
        streamId - stream id
        streamInfo - stream info (SDP data)
        Returns:
        rtp stream
      • decodeStreamInfo

        public static RTPStream decodeStreamInfo​(IApplicationInstance appInstance,
                                                 com.wowza.wms.rtp.model.RTPStreamContext rtpStreamContext,
                                                 RTPContext context,
                                                 String streamId,
                                                 String streamInfo)
        Decode SDP info and create RTP stream
        Parameters:
        appInstance - app instance
        rtpStreamContext - rtp stream context
        context - rtp context
        streamId - stream id
        streamInfo - stream info (SDP data)
        Returns:
        rtp stream
      • formatH264CodecConfigPacket

        public static byte[] formatH264CodecConfigPacket​(byte[] sps,
                                                         java.util.List<byte[]> ppss,
                                                         byte[] profileLevel)
        Format codec config info, Internal use.
        Parameters:
        sps -
        ppss -
        profileLevel -
        Returns:
        bytes
      • formatH264CodecConfig

        public static byte[] formatH264CodecConfig​(byte[] sps,
                                                   java.util.List<byte[]> ppss,
                                                   byte[] profileLevel)
        Format codec config info, Internal use.
        Parameters:
        sps -
        ppss -
        profileLevel -
        Returns:
        bytes