chromium/components/media_router/common/media_source.cc

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

#include "components/media_router/common/media_source.h"

#include <array>
#include <cstdio>
#include <ostream>
#include <string>
#include <string_view>

#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "build/build_config.h"
#include "media/audio/audio_features.h"
#include "media/base/audio_codecs.h"
#include "media/base/media_switches.h"
#include "media/base/video_codecs.h"
#include "net/base/url_util.h"
#include "third_party/blink/public/platform/modules/remoteplayback/remote_playback_source.h"
#include "url/gurl.h"

namespace media_router {

namespace {

// Prefixes used to format and detect various protocols' media source URNs.
// See: https://www.ietf.org/rfc/rfc3406.txt
constexpr char kAnyTabMediaUrn[] =;
constexpr char kTabMediaUrnFormat[] =;
constexpr std::string_view kDesktopMediaUrnPrefix =;
// WARNING: If more desktop URN parameters are added in the future, the parsing
// code will have to be smarter!
constexpr std::string_view kDesktopMediaUrnAudioParam =;
constexpr std::string_view kUnchosenDesktopMediaUrn =;
constexpr std::string_view kUnchosenDesktopWithAudioMediaUrn =;

// List of non-http(s) schemes that are allowed in a Presentation URL.
constexpr std::array<const char* const, 5> kAllowedSchemes{};

bool IsSchemeAllowed(const GURL& url) {}

bool IsSystemAudioCaptureSupported() {}

}  // namespace

bool IsLegacyCastPresentationUrl(const GURL& url) {}

bool IsValidPresentationUrl(const GURL& url) {}

bool IsValidStandardPresentationSource(const std::string& media_source) {}

bool IsAutoJoinPresentationId(const std::string& presentation_id) {}

MediaSource::MediaSource(const MediaSource::Id& source_id) :{}

MediaSource::MediaSource(const GURL& presentation_url)
    :{}

MediaSource::~MediaSource() = default;

// static
MediaSource MediaSource::ForAnyTab() {}

// static
MediaSource MediaSource::ForTab(int tab_id) {}

// static
MediaSource MediaSource::ForPresentationUrl(const GURL& presentation_url) {}

// static
MediaSource MediaSource::ForRemotePlayback(int tab_id,
                                           media::VideoCodec video_codec,
                                           media::AudioCodec audio_codec) {}

// static
MediaSource MediaSource::ForDesktop(const std::string& desktop_media_id,
                                    bool with_audio) {}

// static
MediaSource MediaSource::ForUnchosenDesktop() {}

bool MediaSource::IsTabMirroringSource() const {}

bool MediaSource::IsDesktopMirroringSource() const {}

bool MediaSource::IsCastPresentationUrl() const {}

bool MediaSource::IsRemotePlaybackSource() const {}

std::optional<int> MediaSource::TabId() const {}

std::optional<int> MediaSource::TabIdFromRemotePlaybackSource() const {}

std::optional<std::string> MediaSource::DesktopStreamId() const {}

bool MediaSource::IsDesktopSourceWithAudio() const {}

bool MediaSource::IsDialSource() const {}

std::string MediaSource::AppNameFromDialSource() const {}

std::string MediaSource::TruncateForLogging(size_t max_length) const {}

void MediaSource::AppendTabIdToRemotePlaybackUrlQuery(int tab_id) {}

}  // namespace media_router