@@ -0,0 +1,2385 @@
+/*%0A * Copyright @ 2015 Atlassian Pty Ltd%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.jitsi.impl.neomedia.transform.delay;%0A%0Aimport org.jitsi.impl.neomedia.*;%0Aimport org.jitsi.impl.neomedia.transform.*;%0Aimport org.jitsi.util.*;%0A%0A/**%0A * A %7B@link TransformEngine%7D that delays the RTP stream by specified packet%0A * count by holding them in a buffer.%0A *%0A * @author Boris Grozev%0A * @author Pawel Domas%0A */%0Apublic class DelayingTransformEngine%0A    implements TransformEngine%0A%7B%0A    private DelayingTransformer delayingTransformer;%0A%0A    /**%0A     * Creates new instance of %3Ctt%3EDelayingTransformEngine%3C/tt%3E which will delay%0A     * the RTP stream by given amount of packets.%0A     * @param packetCount the delay counted in packets.%0A     */%0A    public DelayingTransformEngine(int packetCount)%0A    %7B%0A        delayingTransformer = new DelayingTransformer(packetCount);%0A    %7D%0A%0A    /**%0A     * %7B@inheritDoc%7D%0A     */%0A    @Override%0A    public PacketTransformer getRTPTransformer()%0A    %7B%0A        return delayingTransformer;%0A    %7D%0A%0A    /**%0A     * %7B@inheritDoc%7D%0A     */%0A    @Override%0A    public PacketTransformer getRTCPTransformer()%0A    %7B%0A        return null;%0A    %7D%0A%0A    private class DelayingTransformer extends SinglePacketTransformer%0A    %7B%0A        private RawPacket%5B%5D buffer;%0A%0A        private int idx = 0;%0A%0A        DelayingTransformer(int pktCount)%0A        %7B%0A            this.buffer = new RawPacket%5BpktCount%5D;%0A        %7D%0A%0A        @Override%0A        public RawPacket reverseTransform(RawPacket pkt)%0A        %7B%0A            if (pkt != null)%0A            %7B%0A                RawPacket ret = buffer%5Bidx%5D;%0A                buffer%5Bidx%5D = pkt;%0A                idx = (idx + 1) %25 buffer.length;%0A                return ret;%0A            %7D%0A            return null;%0A        %7D%0A%0A        @Override%0A        public RawPacket transform(RawPacket pkt)%0A        %7B%0A            return pkt;%0A        %7D%0A    %7D%0A%7D%0A

Add DelayingTransformEngine