aboutsummaryrefslogtreecommitdiff
path: root/cast/streaming/remoting_capabilities.h
blob: a2f7b1737a97c07cd4f62f69067e7eaac00cca05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CAST_STREAMING_REMOTING_CAPABILITIES_H_
#define CAST_STREAMING_REMOTING_CAPABILITIES_H_

#include <string>
#include <vector>

namespace openscreen {
namespace cast {

// Audio capabilities are how receivers indicate support for remoting codecs--
// as remoting does not include the actual codec in the OFFER message.
enum class AudioCapability {
  // The "baseline set" is used in Chrome to check support for a wide
  // variety of audio codecs in media/remoting/renderer_controller.cc, including
  // but not limited to MP3, PCM, Ogg Vorbis, and FLAC.
  kBaselineSet,
  kAac,
  kOpus,
};

// Similar to audio capabilities, video capabilities are how the receiver
// indicates support for certain video codecs, as well as support for streaming
// 4k content. It is assumed by the sender that the receiver can support 4k
// on all supported codecs.
enum class VideoCapability {
  // |kSupports4k| indicates that the receiver wants and can support 4k remoting
  // content--both decoding/rendering and either a native 4k display or
  // downscaling to the display's native resolution.
  // TODO(issuetracker.google.com/184429130): |kSupports4k| is not super helpful
  // for enabling 4k support, as receivers may not support 4k for all types of
  // content.
  kSupports4k,
  kH264,
  kVp8,
  kVp9,
  kHevc,
  kAv1
};

// This class is similar to the RemotingSinkMetadata in Chrome, however
// it is focused around our needs and is not mojom-based. This contains
// a rough set of capabilities of the receiver to give the sender an idea of
// what features are suppported for remoting.
// TODO(issuetracker.google.com/184189100): this object should be expanded to
// allow more specific constraint tracking.
struct RemotingCapabilities {
  // Receiver audio-specific capabilities.
  std::vector<AudioCapability> audio;

  // Receiver video-specific capabilities.
  std::vector<VideoCapability> video;
};

}  // namespace cast
}  // namespace openscreen

#endif  // CAST_STREAMING_REMOTING_CAPABILITIES_H_