mirror of
https://github.com/aler9/rtsp-simple-server
synced 2025-10-05 07:36:57 +08:00

* support reading AV1, VP9, H265, Opus, AC-3, G711, LPCM * support reading multiple video or audio tracks at once
35 lines
608 B
Go
35 lines
608 B
Go
package formatprocessor
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/bluenviron/gortsplib/v4/pkg/format"
|
|
mcav1 "github.com/bluenviron/mediacommon/v2/pkg/codecs/av1"
|
|
"github.com/bluenviron/mediamtx/internal/unit"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestAV1RemoveTUD(t *testing.T) {
|
|
forma := &format.AV1{}
|
|
|
|
p, err := New(1450, forma, true, nil)
|
|
require.NoError(t, err)
|
|
|
|
u := &unit.AV1{
|
|
Base: unit.Base{
|
|
PTS: 30000,
|
|
},
|
|
TU: [][]byte{
|
|
{byte(mcav1.OBUTypeTemporalDelimiter) << 3},
|
|
{5},
|
|
},
|
|
}
|
|
|
|
err = p.ProcessUnit(u)
|
|
require.NoError(t, err)
|
|
|
|
require.Equal(t, [][]byte{
|
|
{5},
|
|
}, u.TU)
|
|
}
|