示例#1
0
func cPadArrayToPadSlice(cPads *C.AVFilterPad) []*Pad {
	var pads []*Pad
	for i := C.uint(0); ; i++ {
		cPad := C.go_av_pads_get(cPads, i)
		if cPad == nil {
			break
		}
		pad := NewPadFromC(unsafe.Pointer(cPad))
		pads = append(pads, pad)
	}
	return pads
}
示例#2
0
func (ctx *Context) OutputPads() []*Pad {
	count := ctx.NumberOfOutputs()
	if count <= 0 {
		return nil
	}
	pads := make([]*Pad, 0, count)
	for i := uint(0); i < count; i++ {
		cPad := C.go_av_pads_get(ctx.CAVFilterContext.output_pads, C.uint(i))
		pad := NewPadFromC(unsafe.Pointer(cPad))
		pads = append(pads, pad)
	}
	return pads
}