mirror of
https://github.com/aler9/rtsp-simple-server
synced 2025-10-08 09:00:43 +08:00
switch to gortsplib v2 (#1301)
Fixes #1103 gortsplib/v2 supports multiple formats inside a single track (media). This allows to apply the resizing algorithm to single formats inside medias. For instance, if a media contains a a proprietary format and an H264 format, and the latter has oversized packets, they can now be resized.
This commit is contained in:
22
internal/core/formatprocessor.go
Normal file
22
internal/core/formatprocessor.go
Normal file
@@ -0,0 +1,22 @@
|
||||
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)
|
||||
|
||||
case *format.MPEG4Audio:
|
||||
return newFormatProcessorMPEG4Audio(forma, generateRTPPackets)
|
||||
|
||||
default:
|
||||
return newFormatProcessorGeneric(forma, generateRTPPackets)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user