chromium/third_party/openscreen/src/cast/common/public/receiver_info.h

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

#ifndef CAST_COMMON_PUBLIC_RECEIVER_INFO_H_
#define CAST_COMMON_PUBLIC_RECEIVER_INFO_H_

#include <memory>
#include <string>
#include <utility>

#include "discovery/dnssd/public/dns_sd_instance.h"
#include "discovery/dnssd/public/dns_sd_instance_endpoint.h"
#include "platform/base/ip_address.h"

namespace openscreen::cast {

// Constants to identify a CastV2 instance with DNS-SD.
constexpr char kCastV2ServiceId[] =;
constexpr char kCastV2DomainId[] =;

// Constants to be used as keys when storing data inside of a DNS-SD TXT record.
constexpr char kUniqueIdKey[] =;
constexpr char kVersionKey[] =;
constexpr char kCapabilitiesKey[] =;
constexpr char kStatusKey[] =;
constexpr char kFriendlyNameKey[] =;
constexpr char kModelNameKey[] =;

// This represents the ‘st’ flag in the CastV2 TXT record.
enum ReceiverStatus {};

constexpr uint8_t kCurrentCastVersion =;

// Bits in the ‘ca’ bitfield, per the CastV2 spec.
constexpr uint64_t kHasVideoOutput =;
constexpr uint64_t kHasVideoInput =;
constexpr uint64_t kHasAudioOutput =;
constexpr uint64_t kHasAudioIntput =;
constexpr uint64_t kIsDevModeEnabled =;

constexpr uint64_t kNoCapabilities =;

// This is the top-level receiver info class for CastV2. It describes a specific
// service instance.
struct ReceiverInfo {};

inline bool operator==(const ReceiverInfo& lhs, const ReceiverInfo& rhs) {}

inline bool operator!=(const ReceiverInfo& lhs, const ReceiverInfo& rhs) {}

// Functions responsible for converting between CastV2 and DNS-SD
// representations of a service instance.
discovery::DnsSdInstance ReceiverInfoToDnsSdInstance(
    const ReceiverInfo& service);

ErrorOr<ReceiverInfo> DnsSdInstanceEndpointToReceiverInfo(
    const discovery::DnsSdInstanceEndpoint& endpoint);

}  // namespace openscreen::cast

#endif  // CAST_COMMON_PUBLIC_RECEIVER_INFO_H_