xref: /aosp_15_r20/external/openscreen/cast/streaming/remoting_capabilities.h (revision 3f982cf4871df8771c9d4abe6e9a6f8d829b2736)
1 // Copyright 2021 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef CAST_STREAMING_REMOTING_CAPABILITIES_H_
6 #define CAST_STREAMING_REMOTING_CAPABILITIES_H_
7 
8 #include <string>
9 #include <vector>
10 
11 namespace openscreen {
12 namespace cast {
13 
14 // Audio capabilities are how receivers indicate support for remoting codecs--
15 // as remoting does not include the actual codec in the OFFER message.
16 enum class AudioCapability {
17   // The "baseline set" is used in Chrome to check support for a wide
18   // variety of audio codecs in media/remoting/renderer_controller.cc, including
19   // but not limited to MP3, PCM, Ogg Vorbis, and FLAC.
20   kBaselineSet,
21   kAac,
22   kOpus,
23 };
24 
25 // Similar to audio capabilities, video capabilities are how the receiver
26 // indicates support for certain video codecs, as well as support for streaming
27 // 4k content. It is assumed by the sender that the receiver can support 4k
28 // on all supported codecs.
29 enum class VideoCapability {
30   // |kSupports4k| indicates that the receiver wants and can support 4k remoting
31   // content--both decoding/rendering and either a native 4k display or
32   // downscaling to the display's native resolution.
33   // TODO(issuetracker.google.com/184429130): |kSupports4k| is not super helpful
34   // for enabling 4k support, as receivers may not support 4k for all types of
35   // content.
36   kSupports4k,
37   kH264,
38   kVp8,
39   kVp9,
40   kHevc,
41   kAv1
42 };
43 
44 // This class is similar to the RemotingSinkMetadata in Chrome, however
45 // it is focused around our needs and is not mojom-based. This contains
46 // a rough set of capabilities of the receiver to give the sender an idea of
47 // what features are suppported for remoting.
48 // TODO(issuetracker.google.com/184189100): this object should be expanded to
49 // allow more specific constraint tracking.
50 struct RemotingCapabilities {
51   // Receiver audio-specific capabilities.
52   std::vector<AudioCapability> audio;
53 
54   // Receiver video-specific capabilities.
55   std::vector<VideoCapability> video;
56 };
57 
58 }  // namespace cast
59 }  // namespace openscreen
60 
61 #endif  // CAST_STREAMING_REMOTING_CAPABILITIES_H_
62