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)
|
return FormatContextFlags(fc.c.flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fc *FormatContext) SetInterruptCallback() IOInterrupter {
|
func (fc *FormatContext) SetInterruptCallback() *IOInterrupter {
|
||||||
i := newIOInterrupter()
|
i := newIOInterrupter()
|
||||||
fc.c.interrupt_callback = i.c
|
fc.c.interrupt_callback = i.c
|
||||||
return i
|
return i
|
||||||
|
@@ -15,23 +15,17 @@ AVIOInterruptCB astiavNewInterruptCallback(int *ret)
|
|||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
type IOInterrupter interface {
|
type IOInterrupter struct {
|
||||||
Interrupt()
|
|
||||||
}
|
|
||||||
|
|
||||||
var _ IOInterrupter = (*ioInterrupter)(nil)
|
|
||||||
|
|
||||||
type ioInterrupter struct {
|
|
||||||
c C.struct_AVIOInterruptCB
|
c C.struct_AVIOInterruptCB
|
||||||
i C.int
|
i C.int
|
||||||
}
|
}
|
||||||
|
|
||||||
func newIOInterrupter() *ioInterrupter {
|
func newIOInterrupter() *IOInterrupter {
|
||||||
cb := &ioInterrupter{}
|
cb := &IOInterrupter{}
|
||||||
cb.c = C.astiavNewInterruptCallback(&cb.i)
|
cb.c = C.astiavNewInterruptCallback(&cb.i)
|
||||||
return cb
|
return cb
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cb *ioInterrupter) Interrupt() {
|
func (cb *IOInterrupter) Interrupt() {
|
||||||
cb.i = 1
|
cb.i = 1
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user