@Override
    public IoBuffer getKeyframe() {
        IoBuffer result = IoBuffer.allocate(1024);
        result.setAutoExpand(true);

        // Header
        result.put((byte) (FLV_FRAME_KEY | VideoCodec.SCREEN_VIDEO.getId()));

        // Frame size
        result.putShort((short) this.widthInfo);
        result.putShort((short) this.heightInfo);

        // Get compressed blocks
        byte[] tmpData = new byte[this.blockDataSize];
        int pos = 0;
        for (int idx = 0; idx < this.blockCount; idx++) {
            int size = this.blockSize[idx];
            if (size == 0) {
                // this should not happen: no data for this block
                return null;
            }

            result.putShort((short) size);
            System.arraycopy(this.blockData, pos, tmpData, 0, size);
            result.put(tmpData, 0, size);
            pos += this.blockDataSize;
        }

        result.rewind();
        return result;
    }
@ Override public IoBuffer getKeyframe ( ) { IoBuffer result = IoBuffer . allocate ( 1024 ) ; result . setAutoExpand ( true ) ; result . put ( ( byte ) ( FLV_FRAME_KEY | VideoCodec . SCREEN_VIDEO . getId ( ) ) ) ; result . putShort ( ( short ) this . widthInfo ) ; result . putShort ( ( short ) this . heightInfo ) ; byte [ ] tmpData = new byte [ this . blockDataSize ] ; int pos = 0 ; for ( int idx = 0 ; idx < this . blockCount ; idx ++ ) { int size = this . blockSize [ idx ] ; if ( size == 0 ) { return null ; } result . putShort ( ( short ) size ) ; System . arraycopy ( this . blockData , pos , tmpData , 0 , size ) ; result . put ( tmpData , 0 , size ) ; pos += this . blockDataSize ; } result . rewind ( ) ; return result ; }
{@inheritDoc}