mirror of
https://github.com/asticode/go-astiav.git
synced 2025-10-05 00:02:45 +08:00
29 lines
433 B
Go
29 lines
433 B
Go
package astiav
|
|
|
|
//#include "io_interrupter.h"
|
|
import "C"
|
|
|
|
type IOInterrupter interface {
|
|
Interrupt()
|
|
Resume()
|
|
}
|
|
|
|
type defaultIOInterrupter struct {
|
|
c C.AVIOInterruptCB
|
|
i C.int
|
|
}
|
|
|
|
func newDefaultIOInterrupter() *defaultIOInterrupter {
|
|
i := &defaultIOInterrupter{}
|
|
i.c = C.astiavNewInterruptCallback(&i.i)
|
|
return i
|
|
}
|
|
|
|
func (i *defaultIOInterrupter) Interrupt() {
|
|
i.i = 1
|
|
}
|
|
|
|
func (i *defaultIOInterrupter) Resume() {
|
|
i.i = 0
|
|
}
|