code: func (self *Queue) DelayedGopCount(n int) *QueueCursor {
  	cursor := self.newCursor()
  	cursor.init = func(buf *pktque.Buf, videoidx int) pktque.BufPos {
  		i := buf.Tail - 1
  		if videoidx != -1 {
  			for gop := 0; buf.IsValidPos(i) && gop < n; i-- {
  				pkt := buf.Get(i)
  				if pkt.Idx == int8(self.videoidx) && pkt.IsKeyFrame {
  					gop++
  				}
  			}
  		}
  		return i
  	}
  	return cursor
  }
docs: // Create cursor position at specific delayed GOP count in buffered packets.