Source:
public boolean isKeyFrame(byte[] buf, int off, int len) { if (buf == null || buf.length < off + len) { return false; } Byte redPT = null, vp8PT = null, h264PT = null; for (Map.Entry<Byte, MediaFormat> entry : getDynamicRTPPayloadTypes().entrySet()) { String encoding = entry.getValue().getEncoding(); Byte payloadType = entry.getKey(); if (Constants.RED.equalsIgnoreCase(encoding)) { redPT = payloadType; } else if (Constants.VP8.equalsIgnoreCase(encoding)) { vp8PT = payloadType; } else if (Constants.H264.equalsIgnoreCase(encoding)) { h264PT = payloadType; } } int payloadOff, payloadLen; byte payloadType; try { if (redPT != null && redPT == RawPacket.getPayloadType(buf, off, len)) { REDBlock block = REDBlockIterator .getPrimaryBlock(buf, RawPacket.getPayloadOffset(buf, off, len), RawPacket.getPayloadLength(buf, off, len)); payloadOff = block.getOffset(); payloadLen = block.getLength(); payloadType = block.getPayloadType(); } else { payloadOff = RawPacket.getPayloadOffset(buf, off, len); payloadLen = RawPacket.getPayloadLength(buf, off, len); payloadType = RawPacket.getPayloadType(buf, off, len); } } catch (ArrayIndexOutOfBoundsException e) { logger.warn("Caught an exception while checking for keyframe:", e); return false; } if (vp8PT != null && payloadType == vp8PT) { return org.jitsi.impl.neomedia.codec.video.vp8.DePacketizer .isKeyFrame(buf, payloadOff, payloadLen); } else if (h264PT != null && payloadType == h264PT) { return org.jitsi.impl.neomedia.codec.video.h264.DePacketizer .isKeyFrame(buf, payloadOff, len); } else { return false; } }

Target:
public boolean isKeyFrame(byte[] buf, int off, int len) { if (buf == null || buf.length < off + len) { return false; } Byte redPT = null, vp8PT = null, h264PT = null; for (Map.Entry<Byte, MediaFormat> entry : getDynamicRTPPayloadTypes().entrySet()) { String encoding = entry.getValue().getEncoding(); Byte payloadType = entry.getKey(); if (Constants.RED.equalsIgnoreCase(encoding)) { redPT = payloadType; } else if (Constants.VP8.equalsIgnoreCase(encoding)) { vp8PT = payloadType; } else if (Constants.H264.equalsIgnoreCase(encoding)) { h264PT = payloadType; } } int payloadOff, payloadLen; byte payloadType; try { if (redPT != null && redPT == RawPacket.getPayloadType(buf, off, len)) { REDBlock block = REDBlockIterator .getPrimaryBlock(buf, RawPacket.getPayloadOffset(buf, off, len), RawPacket.getPayloadLength(buf, off, len) - RawPacket.getPaddingSize(buf, off, len) - RawPacket.getHeaderLength(buf, off, len)); payloadOff = block.getOffset(); payloadLen = block.getLength(); payloadType = block.getPayloadType(); } else { payloadOff = RawPacket.getPayloadOffset(buf, off, len); payloadLen = RawPacket.getPayloadLength(buf, off, len) - RawPacket.getPayloadOffset(buf, off, len) - RawPacket.getHeaderLength(buf, off, len); payloadType = RawPacket.getPayloadType(buf, off, len); } if (vp8PT != null && payloadType == vp8PT) { return org.jitsi.impl.neomedia.codec.video.vp8.DePacketizer .isKeyFrame(buf, payloadOff, payloadLen); } else if (h264PT != null && payloadType == h264PT) { return org.jitsi.impl.neomedia.codec.video.h264.DePacketizer .isKeyFrame(buf, payloadOff, len); } else { return false; } } catch (ArrayIndexOutOfBoundsException e) { logger.warn("Caught an exception while checking for keyframe:", e); return false; } }