chromium/chrome/browser/media/router/discovery/access_code/access_code_media_sink_util.cc

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

#include "chrome/browser/media/router/discovery/access_code/access_code_media_sink_util.h"

#include <map>

#include "base/command_line.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
#include "components/media_router/common/discovery/media_sink_internal.h"
#include "components/media_router/common/mojom/media_router.mojom.h"
#include "components/media_router/common/providers/cast/channel/cast_device_capability.h"
#include "net/base/host_port_pair.h"
#include "net/base/ip_address.h"
#include "net/base/port_util.h"
#include "net/base/url_util.h"

namespace media_router {

namespace {

CastDeviceCapability;
CastDeviceCapabilitySet;

constexpr char kSinkDictKey[] =;
constexpr char kSinkIdKey[] =;
constexpr char kDisplayNameKey[] =;
constexpr char kExtraDataDictKey[] =;
constexpr char kCapabilitiesKey[] =;
constexpr char kPortKey[] =;
constexpr char kIpAddressKey[] =;
constexpr char kModelName[] =;
constexpr char kDefaultAccessCodeModelName[] =;

CastDeviceCapabilitySet ConvertDeviceCapabilities(
    chrome_browser_media::proto::DeviceCapabilities proto) {}

std::optional<net::IPAddress> GetIPAddress(NetworkInfo network_info) {}
}  // namespace

std::pair<std::optional<MediaSinkInternal>, CreateCastMediaSinkResult>
CreateAccessCodeMediaSink(const DiscoveryDevice& discovery_device) {}

base::Value::Dict CreateValueDictFromMediaSinkInternal(
    const MediaSinkInternal& sink) {}

// This stored dict looks like:
//   "<cast1>:1234234": {
//     "sink": {
//       "sink_id": "<cast1>:1234234",
//       "display_name": "Karls Cast Device",
//     },
//     "extra_data": {
//       "capabilities": 4,
//       "port": 666,
//       "ip_address": ""192.0.2.146"",
//     },
//   }
std::optional<MediaSinkInternal> ParseValueDictIntoMediaSinkInternal(
    const base::Value::Dict& value_dict) {}

AccessCodeCastAddSinkResult AddSinkResultMetricsHelper(
    AddSinkResultCode value) {}

std::optional<net::IPEndPoint> GetIPEndPointFromValueDict(
    const base::Value::Dict& value_dict) {}

}  // namespace media_router