// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>// SPDX-License-Identifier: MITpackage fmtpimport ()func profileLevelIDMatches(, string) bool { , := hex.DecodeString()if != nil || len() < 2 {returnfalse } , := hex.DecodeString()if != nil || len() < 2 {returnfalse }return [0] == [0] && [1] == [1]}type h264FMTP struct { parameters map[string]string}func ( *h264FMTP) () string {return"video/h264"}// Match returns true if h and b are compatible fmtp descriptions// Based on RFC6184 Section 8.2.2://// The parameters identifying a media format configuration for H.264// are profile-level-id and packetization-mode. These media format// configuration parameters (except for the level part of profile-// level-id) MUST be used symmetrically; that is, the answerer MUST// either maintain all configuration parameters or remove the media// format (payload type) completely if one or more of the parameter// values are not supported.// Informative note: The requirement for symmetric use does not// apply for the level part of profile-level-id and does not apply// for the other stream properties and capability parameters.func ( *h264FMTP) ( FMTP) bool { , := .(*h264FMTP)if ! {returnfalse }// test packetization-mode , := .parameters["packetization-mode"]if ! {returnfalse } , := .parameters["packetization-mode"]if ! {returnfalse }if != {returnfalse }// test profile-level-id , := .parameters["profile-level-id"]if ! {returnfalse } , := .parameters["profile-level-id"]if ! {returnfalse }if !profileLevelIDMatches(, ) {returnfalse }returntrue}func ( *h264FMTP) ( string) (string, bool) { , := .parameters[]return , }
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.