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

package interceptor

import (
	

	
	
)

type unmarshaledDataKeyType int

const (
	rtpHeaderKey unmarshaledDataKeyType = iota
	rtcpPacketsKey
)

var errInvalidType = errors.New("found value of invalid type in attributes map")

// Attributes are a generic key/value store used by interceptors.
type Attributes map[interface{}]interface{}

// Get returns the attribute associated with key.
func ( Attributes) ( interface{}) interface{} {
	return []
}

// Set sets the attribute associated with key to the given value.
func ( Attributes) ( interface{},  interface{}) {
	[] = 
}

// GetRTPHeader gets the RTP header if present. If it is not present, it will be
// unmarshalled from the raw byte slice and stored in the attributes.
func ( Attributes) ( []byte) (*rtp.Header, error) {
	if ,  := [rtpHeaderKey];  {
		if ,  := .(*rtp.Header);  {
			return , nil
		}

		return nil, errInvalidType
	}
	 := &rtp.Header{}
	if ,  := .Unmarshal();  != nil {
		return nil, 
	}
	[rtpHeaderKey] = 

	return , nil
}

// GetRTCPPackets gets the RTCP packets if present. If the packet slice is not
// present, it will be unmarshalled from the raw byte slice and stored in the
// attributes.
func ( Attributes) ( []byte) ([]rtcp.Packet, error) {
	if ,  := [rtcpPacketsKey];  {
		if ,  := .([]rtcp.Packet);  {
			return , nil
		}

		return nil, errInvalidType
	}
	,  := rtcp.Unmarshal()
	if  != nil {
		return nil, 
	}
	[rtcpPacketsKey] = 

	return , nil
}