chromium/remoting/protocol/content_description.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "remoting/protocol/content_description.h"

#include <memory>
#include <utility>

#include "base/base64.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/strings/string_number_conversions.h"
#include "remoting/base/constants.h"
#include "remoting/base/name_value_map.h"
#include "remoting/protocol/authenticator.h"
#include "third_party/libjingle_xmpp/xmllite/xmlelement.h"

QName;
XmlElement;

namespace remoting::protocol {

const char ContentDescription::kChromotingContentName[] =;

namespace {

const char kDefaultNs[] =;

// Following constants are used to format session description in XML.
const char kDescriptionTag[] =;
const char kStandardIceTag[] =;
const char kControlTag[] =;
const char kEventTag[] =;
const char kVideoTag[] =;
const char kAudioTag[] =;

const char kTransportAttr[] =;
const char kVersionAttr[] =;
const char kCodecAttr[] =;

const NameMapElement<ChannelConfig::TransportType> kTransports[] =;

const NameMapElement<ChannelConfig::Codec> kCodecs[] =;

// Format a channel configuration tag for chromotocol session description,
// e.g. for video channel:
//    <video transport="stream" version="1" codec="vp8" />
XmlElement* FormatChannelConfig(const ChannelConfig& config,
                                const std::string& tag_name) {}

// Returns false if the element is invalid.
bool ParseChannelConfig(const XmlElement* element,
                        bool codec_required,
                        ChannelConfig* config) {}

}  // namespace

ContentDescription::ContentDescription(
    std::unique_ptr<CandidateSessionConfig> config,
    std::unique_ptr<jingle_xmpp::XmlElement> authenticator_message)
    :{}

ContentDescription::~ContentDescription() = default;

// ToXml() creates content description for chromoting session. The
// description looks as follows:
//   <description xmlns="google:remoting">
//     <standard-ice/>
//     <control transport="stream" version="1" />
//     <event transport="datagram" version="1" />
//     <video transport="stream" codec="vp8" version="1" />
//     <audio transport="stream" codec="opus" version="1" />
//     <authentication>
//      Message created by Authenticator implementation.
//     </authentication>
//   </description>
//
XmlElement* ContentDescription::ToXml() const {}

// static
// Adds the channel configs corresponding to |tag_name|, found in |element|, to
// |configs|.
bool ContentDescription::ParseChannelConfigs(
    const XmlElement* const element,
    const char tag_name[],
    bool codec_required,
    bool optional,
    std::list<ChannelConfig>* const configs) {}

// static
std::unique_ptr<ContentDescription> ContentDescription::ParseXml(
    const XmlElement* element,
    bool webrtc_transport) {}

}  // namespace remoting::protocol