// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
// SPDX-License-Identifier: MIT

package fmtp

import (
	
)

func profileLevelIDMatches(,  string) bool {
	,  := hex.DecodeString()
	if  != nil || len() < 2 {
		return false
	}
	,  := hex.DecodeString()
	if  != nil || len() < 2 {
		return false
	}

	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 ! {
		return false
	}

	// test packetization-mode
	,  := .parameters["packetization-mode"]
	if ! {
		return false
	}
	,  := .parameters["packetization-mode"]
	if ! {
		return false
	}

	if  !=  {
		return false
	}

	// test profile-level-id
	,  := .parameters["profile-level-id"]
	if ! {
		return false
	}

	,  := .parameters["profile-level-id"]
	if ! {
		return false
	}

	if !profileLevelIDMatches(, ) {
		return false
	}

	return true
}

func ( *h264FMTP) ( string) (string, bool) {
	,  := .parameters[]

	return , 
}