make IsCodecSupported global
This commit is contained in:
parent
6a3c769980
commit
59af05730d
4
muxer.go
4
muxer.go
@ -26,7 +26,7 @@ type Muxer struct {
|
|||||||
mdatWriter *atom.Writer
|
mdatWriter *atom.Writer
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *Muxer) IsCodecSupported(codec av.CodecData) bool {
|
func IsCodecSupported(codec av.CodecData) bool {
|
||||||
switch codec.Type() {
|
switch codec.Type() {
|
||||||
case av.H264, av.AAC:
|
case av.H264, av.AAC:
|
||||||
return true
|
return true
|
||||||
@ -36,7 +36,7 @@ func (self *Muxer) IsCodecSupported(codec av.CodecData) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (self *Muxer) NewStream(codec av.CodecData) (err error) {
|
func (self *Muxer) NewStream(codec av.CodecData) (err error) {
|
||||||
if !self.IsCodecSupported(codec) {
|
if !IsCodecSupported(codec) {
|
||||||
err = fmt.Errorf("codec type=%x is not supported", codec.Type())
|
err = fmt.Errorf("codec type=%x is not supported", codec.Type())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user