//
// Created by Laky64 on 02/10/24.
//

#pragma once
#include <wrtc/utils/json.hpp>
#include <wrtc/models/media_content.hpp>

namespace wrtc {
    class ResponsePayload {
        static std::vector<webrtc::RtpExtension> parseRtpExtensions(const json& data);

        static std::vector<PayloadType> parsePayloadTypes(const json& data);

    public:
        struct Media {
            std::vector<PayloadType> audioPayloadTypes, videoPayloadTypes;
            std::vector<webrtc::RtpExtension> audioRtpExtensions, videoRtpExtensions;
        };

        PeerIceParameters remoteIceParameters;
        std::unique_ptr<webrtc::SSLFingerprint> fingerprint;
        std::vector<webrtc::Candidate> candidates;
        Media media;

        bool isRtmp = false;
        bool isStream = false;

        explicit ResponsePayload(const std::string& payload);
    };

} // wrtc
