2022-12-13 19:54:17 +00:00
|
|
|
package core
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/aler9/gortsplib/v2/pkg/format"
|
|
|
|
)
|
|
|
|
|
|
|
|
type formatProcessor interface {
|
|
|
|
process(data, bool) error
|
|
|
|
}
|
|
|
|
|
|
|
|
func newFormatProcessor(forma format.Format, generateRTPPackets bool) (formatProcessor, error) {
|
|
|
|
switch forma := forma.(type) {
|
|
|
|
case *format.H264:
|
|
|
|
return newFormatProcessorH264(forma, generateRTPPackets)
|
|
|
|
|
2022-12-13 20:26:35 +00:00
|
|
|
case *format.H265:
|
|
|
|
return newFormatProcessorH265(forma, generateRTPPackets)
|
|
|
|
|
2022-12-15 23:50:47 +00:00
|
|
|
case *format.VP8:
|
|
|
|
return newFormatProcessorVP8(forma, generateRTPPackets)
|
|
|
|
|
|
|
|
case *format.VP9:
|
|
|
|
return newFormatProcessorVP9(forma, generateRTPPackets)
|
|
|
|
|
2022-12-13 19:54:17 +00:00
|
|
|
case *format.MPEG4Audio:
|
|
|
|
return newFormatProcessorMPEG4Audio(forma, generateRTPPackets)
|
|
|
|
|
|
|
|
default:
|
|
|
|
return newFormatProcessorGeneric(forma, generateRTPPackets)
|
|
|
|
}
|
|
|
|
}
|