You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
joy4/format/raw/handler.go

33 lines
580 B
Go

package raw
import (
"io"
"git.icomsys.co.kr/ljhwan026/joy4/av"
"git.icomsys.co.kr/ljhwan026/joy4/av/avutil"
)
var CodecTypes = []av.CodecType{av.H264, av.AAC}
func Handler(h *avutil.RegisterHandler) {
h.Ext = ".rec"
h.Probe = func(b []byte) bool {
switch string(b[4:8]) {
case "moov", "ftyp", "free", "mdat", "moof":
return true
}
return false
}
h.ReaderDemuxer = func(r io.Reader) av.Demuxer {
return NewDemuxer(r.(io.ReadSeeker))
}
h.WriterMuxer = func(w io.Writer) av.Muxer {
return NewMuxer(w.(io.WriteSeeker))
}
h.CodecTypes = CodecTypes
}