i am currently trying out LibJitsi for an RTP Streaming Server. To get to know the inner workings i wanted to set up a simple RTP Mirror, a small program that accepts an RTP Audio Stream and sends it to another target. The code i wrote looks like this (LibJitsi.start() is called elsewhere):
var mediaService = LibJitsi.getMediaService(); var con = new DefaultStreamConnector(new DatagramSocket(50001), new DatagramSocket(50002)); var stream = mediaService.createMediaStream(con, MediaType.AUDIO); stream.setDirection(MediaDirection.SENDRECV); var format = mediaService.getFormatFactory().createMediaFormat("PCMU", 8000); stream.setFormat(format); var rtpTarget = new InetSocketAddress(remoteAddr, remotePort); var crtpTarget = new InetSocketAddress(remoteAddr, remotePort + 1); var tar = new MediaStreamTarget(rtpTarget, crtpTarget); stream.setTarget(tar); this.outStream = stream; this.outStream.start();
If i interpret the log output correctly, the RTP Packets arrive correctly, but the Mediastream doesnt have a target to stream to, even tho its explicitly set. My own delving into the Source leads me to believe i need some form of MediaDevice in there.
Is my above approach in the right direction overall?
Does a MediaDevice have to be backed by a hardware device?
What is the RTPTranslator used for in the MediaStream?