"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const RTCRtcpParameters_1 = __importDefault(require("./RTCRtcpParameters"));
const RTCRtpCodecParameters_1 = __importDefault(require("./RTCRtpCodecParameters"));
const RTCRtpHeaderExtension_1 = __importDefault(require("./RTCRtpHeaderExtension"));
class RTCRtpParameters {
    constructor(init) {
        this.codecs = [];
        this.headerExtensions = [];
        for (const codec of init.codecs) {
            this.codecs.push(new RTCRtpCodecParameters_1.default(codec));
        }
        for (const ext of init.headerExtensions) {
            this.headerExtensions.push(new RTCRtpHeaderExtension_1.default(ext));
        }
        this.rtcp = new RTCRtcpParameters_1.default(init.rtcp);
    }
    toJSON() {
        return {
            codecs: this.codecs.map(c => c.toJSON()),
            headerExtensions: this.headerExtensions.map(he => he.toJSON()),
            rtcp: this.rtcp.toJSON()
        };
    }
}
exports.default = RTCRtpParameters;
//# sourceMappingURL=RTCRtpParameters.js.map