rm SupportedCodecTypes from av.Muxer
This commit is contained in:
parent
7f312cf177
commit
d1c21513c7
1
av/av.go
1
av/av.go
@ -190,7 +190,6 @@ type Muxer interface {
|
|||||||
PacketWriter
|
PacketWriter
|
||||||
WriteHeader([]CodecData) error
|
WriteHeader([]CodecData) error
|
||||||
WriteTrailer() error
|
WriteTrailer() error
|
||||||
SupportedCodecTypes() []CodecType
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type MuxCloser interface {
|
type MuxCloser interface {
|
||||||
|
@ -65,6 +65,10 @@ func (self *Demuxer) prepare() (err error) {
|
|||||||
|
|
||||||
transopts := transcode.Options{}
|
transopts := transcode.Options{}
|
||||||
transopts.FindAudioDecoderEncoder = func(codec av.AudioCodecData, i int) (ok bool, err error, dec av.AudioDecoder, enc av.AudioEncoder) {
|
transopts.FindAudioDecoderEncoder = func(codec av.AudioCodecData, i int) (ok bool, err error, dec av.AudioDecoder, enc av.AudioEncoder) {
|
||||||
|
if len(supports) == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
support := false
|
support := false
|
||||||
for _, typ := range supports {
|
for _, typ := range supports {
|
||||||
if typ == codec.Type() {
|
if typ == codec.Type() {
|
||||||
@ -172,7 +176,13 @@ func ConvertCmdline(args []string) (err error) {
|
|||||||
}
|
}
|
||||||
defer muxer.Close()
|
defer muxer.Close()
|
||||||
|
|
||||||
options.OutputCodecTypes = muxer.SupportedCodecTypes()
|
type intf interface {
|
||||||
|
SupportedCodecTypes() []av.CodecType
|
||||||
|
}
|
||||||
|
if fn, ok := muxer.(intf); ok {
|
||||||
|
options.OutputCodecTypes = fn.SupportedCodecTypes()
|
||||||
|
}
|
||||||
|
|
||||||
convdemux := &Demuxer{
|
convdemux := &Demuxer{
|
||||||
Options: options,
|
Options: options,
|
||||||
Demuxer: demuxer,
|
Demuxer: demuxer,
|
||||||
@ -214,7 +224,7 @@ func ConvertCmdline(args []string) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if flagv {
|
if flagv {
|
||||||
fmt.Println(pkt.Idx, pkt.Time, len(pkt.Data))
|
fmt.Println(pkt.Idx, pkt.Time, len(pkt.Data), pkt.IsKeyFrame)
|
||||||
}
|
}
|
||||||
if duration != 0 && pkt.Time > duration {
|
if duration != 0 && pkt.Time > duration {
|
||||||
break
|
break
|
||||||
|
Loading…
x
Reference in New Issue
Block a user