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
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:
35
rtpreceiver_go.go
Normal file
35
rtpreceiver_go.go
Normal file
@@ -0,0 +1,35 @@
|
||||
// SPDX-FileCopyrightText: 2026 The Pion community <https://pion.ly>
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
//go:build !js
|
||||
|
||||
package webrtc
|
||||
|
||||
import "github.com/pion/interceptor"
|
||||
|
||||
// SetRTPParameters applies provided RTPParameters the RTPReceiver's tracks.
|
||||
//
|
||||
// This method is part of the ORTC API. It is not
|
||||
// meant to be used together with the basic WebRTC API.
|
||||
//
|
||||
// The amount of provided codecs must match the number of tracks on the receiver.
|
||||
func (r *RTPReceiver) SetRTPParameters(params RTPParameters) {
|
||||
headerExtensions := make([]interceptor.RTPHeaderExtension, 0, len(params.HeaderExtensions))
|
||||
for _, h := range params.HeaderExtensions {
|
||||
headerExtensions = append(headerExtensions, interceptor.RTPHeaderExtension{ID: h.ID, URI: h.URI})
|
||||
}
|
||||
|
||||
r.mu.Lock()
|
||||
defer r.mu.Unlock()
|
||||
|
||||
for ndx, codec := range params.Codecs {
|
||||
currentTrack := r.tracks[ndx].track
|
||||
|
||||
r.tracks[ndx].streamInfo.RTPHeaderExtensions = headerExtensions
|
||||
|
||||
currentTrack.mu.Lock()
|
||||
currentTrack.codec = codec
|
||||
currentTrack.params = params
|
||||
currentTrack.mu.Unlock()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user