snapshot of https://github.com/pion/webrtc.git (main, 2026-09-15; blobs > 131072B omitted)
Some checks failed
REUSE Compliance Check / lint (push) Failing after 0s
Browser E2E / Test (push) Failing after 3s
Test / test (1.24) (push) Failing after 0s
Test / test-i386 (1.25) (push) Failing after 0s
Test / test-i386 (1.24) (push) Failing after 0s
Test / test-windows (1.25) (push) Failing after 0s
Test / test-windows (1.24) (push) Failing after 0s
Test / test (1.25) (push) Failing after 0s
Examples Tests / Test (push) Failing after 3s
Test / test-macos (1.25) (push) Failing after 0s
Test / test-macos (1.24) (push) Failing after 0s
Go mod tidy / tidy (push) Failing after 0s
Test / test-wasm (push) Failing after 0s
CodeQL / analyze (push) Failing after 1s
Fuzz / fuzz (push) Failing after 0s

This commit is contained in:
upstream-mirror
2026-09-15 20:06:07 +05:00
commit 8acb1a3a29
394 changed files with 78746 additions and 0 deletions

View File

@@ -0,0 +1,78 @@
// SPDX-FileCopyrightText: 2026 The Pion community <https://pion.ly>
// SPDX-License-Identifier: MIT
//go:build !js
package webrtc
import (
"context"
"testing"
"time"
"github.com/pion/transport/v4/test"
"github.com/stretchr/testify/assert"
)
func Test_RTPTransceiverInit_SSRC(t *testing.T) {
lim := test.TimeOut(time.Second * 30) //nolint
defer lim.Stop()
report := test.CheckRoutines(t)
defer report()
track, err := NewTrackLocalStaticSample(RTPCodecCapability{MimeType: MimeTypeOpus}, "a", "b")
assert.NoError(t, err)
t.Run("SSRC of 0 is ignored", func(t *testing.T) {
offerer, answerer, err := newPair()
assert.NoError(t, err)
ctx, cancel := context.WithCancel(context.Background())
answerer.OnTrack(func(track *TrackRemote, _ *RTPReceiver) {
assert.NotEqual(t, 0, track.SSRC())
cancel()
})
_, err = offerer.AddTransceiverFromTrack(track, RTPTransceiverInit{
Direction: RTPTransceiverDirectionSendonly,
SendEncodings: []RTPEncodingParameters{
{
RTPCodingParameters: RTPCodingParameters{
SSRC: 0,
},
},
},
})
assert.NoError(t, err)
assert.NoError(t, signalPair(offerer, answerer))
sendVideoUntilDone(t, ctx.Done(), []*TrackLocalStaticSample{track})
closePairNow(t, offerer, answerer)
})
t.Run("SSRC of 5000", func(t *testing.T) {
offerer, answerer, err := newPair()
assert.NoError(t, err)
ctx, cancel := context.WithCancel(context.Background())
answerer.OnTrack(func(track *TrackRemote, _ *RTPReceiver) {
assert.NotEqual(t, 5000, track.SSRC())
cancel()
})
_, err = offerer.AddTransceiverFromTrack(track, RTPTransceiverInit{
Direction: RTPTransceiverDirectionSendonly,
SendEncodings: []RTPEncodingParameters{
{
RTPCodingParameters: RTPCodingParameters{
SSRC: 5000,
},
},
},
})
assert.NoError(t, err)
assert.NoError(t, signalPair(offerer, answerer))
sendVideoUntilDone(t, ctx.Done(), []*TrackLocalStaticSample{track})
closePairNow(t, offerer, answerer)
})
}