mirror of
https://github.com/asticode/go-astiav.git
synced 2025-10-04 15:52:52 +08:00
Remove io interrupter interface
This commit is contained in:
@@ -84,7 +84,7 @@ func (fc *FormatContext) Flags() FormatContextFlags {
|
||||
return FormatContextFlags(fc.c.flags)
|
||||
}
|
||||
|
||||
func (fc *FormatContext) SetInterruptCallback() IOInterrupter {
|
||||
func (fc *FormatContext) SetInterruptCallback() *IOInterrupter {
|
||||
i := newIOInterrupter()
|
||||
fc.c.interrupt_callback = i.c
|
||||
return i
|
||||
|
@@ -15,23 +15,17 @@ AVIOInterruptCB astiavNewInterruptCallback(int *ret)
|
||||
*/
|
||||
import "C"
|
||||
|
||||
type IOInterrupter interface {
|
||||
Interrupt()
|
||||
}
|
||||
|
||||
var _ IOInterrupter = (*ioInterrupter)(nil)
|
||||
|
||||
type ioInterrupter struct {
|
||||
type IOInterrupter struct {
|
||||
c C.struct_AVIOInterruptCB
|
||||
i C.int
|
||||
}
|
||||
|
||||
func newIOInterrupter() *ioInterrupter {
|
||||
cb := &ioInterrupter{}
|
||||
func newIOInterrupter() *IOInterrupter {
|
||||
cb := &IOInterrupter{}
|
||||
cb.c = C.astiavNewInterruptCallback(&cb.i)
|
||||
return cb
|
||||
}
|
||||
|
||||
func (cb *ioInterrupter) Interrupt() {
|
||||
func (cb *IOInterrupter) Interrupt() {
|
||||
cb.i = 1
|
||||
}
|
||||
|
Reference in New Issue
Block a user