diff options
author | Colin Cross <ccross@android.com> | 2021-08-26 21:29:35 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-08-26 21:29:35 +0000 |
commit | 8c1d6562996fd78350510c66e282dcb50caa1655 (patch) | |
tree | 08f815bfcdaed1c2137de2d6966e42a8870dedb0 /cast/streaming/constants.h | |
parent | 8beec73fbbcaaab6785c3f9cc5a9661afcbc7fa7 (diff) | |
parent | 6b563cff6fca9ffdd14a12d33795fef8e2562a26 (diff) | |
download | openscreen-8c1d6562996fd78350510c66e282dcb50caa1655.tar.gz |
Upgrade openscreen to f54d92523c9f2c8c5afb99e05fed70e4b8772b1c am: 6b563cff6fandroid-s-v2-preview-2android-s-v2-preview-1android-s-v2-beta-2android-s-v2-preview-1
Original change: https://android-review.googlesource.com/c/platform/external/openscreen/+/1810936
Change-Id: I4af446c4bf4a92bc6fe1c6da2ac036a530aee809
Diffstat (limited to 'cast/streaming/constants.h')
-rw-r--r-- | cast/streaming/constants.h | 49 |
1 files changed, 45 insertions, 4 deletions
diff --git a/cast/streaming/constants.h b/cast/streaming/constants.h index 1075a817..03026620 100644 --- a/cast/streaming/constants.h +++ b/cast/streaming/constants.h @@ -17,6 +17,12 @@ namespace openscreen { namespace cast { +// Mirroring App identifier. +constexpr char kMirroringAppId[] = "0F5096E8"; + +// Mirroring App identifier for audio-only mirroring. +constexpr char kMirroringAudioOnlyAppId[] = "85CDB22F"; + // Default target playout delay. The playout delay is the window of time between // capture from the source until presentation at the receiver. constexpr std::chrono::milliseconds kDefaultTargetPlayoutDelay(400); @@ -58,6 +64,27 @@ constexpr int kMinVideoWidth = 320; // The default frame rate for capture options is 30FPS. constexpr int kDefaultFrameRate = 30; +// The mirroring spec suggests 300kbps as the absolute minimum bitrate. +constexpr int kDefaultVideoMinBitRate = 300 * 1000; + +// Default video max bitrate is based on 1080P @ 30FPS, which can be played back +// at good quality around 10mbps. +constexpr int kDefaultVideoMaxBitRate = 10 * 1000 * 1000; + +// The mirroring control protocol specifies 32kbps as the absolute minimum +// for audio. Depending on the type of audio content (narrowband, fullband, +// etc.) Opus specifically can perform very well at this bitrate. +// See: https://research.google/pubs/pub41650/ +constexpr int kDefaultAudioMinBitRate = 32 * 1000; + +// Opus generally sees little improvement above 192kbps, but some older codecs +// that we may consider supporting improve at up to 256kbps. +constexpr int kDefaultAudioMaxBitRate = 256 * 1000; + +// While generally audio should be captured at the maximum sample rate, 16kHz is +// the recommended absolute minimum. +constexpr int kDefaultAudioMinSampleRate = 16000; + // The default audio sample rate is 48kHz, slightly higher than standard // consumer audio. constexpr int kDefaultAudioSampleRate = 48000; @@ -65,12 +92,26 @@ constexpr int kDefaultAudioSampleRate = 48000; // The default audio number of channels is set to stereo. constexpr int kDefaultAudioChannels = 2; +// Default maximum delay for both audio and video. Used if the sender fails +// to provide any constraints. +constexpr std::chrono::milliseconds kDefaultMaxDelayMs(1500); + +// TODO(issuetracker.google.com/184189100): As part of updating remoting +// OFFER/ANSWER and capabilities exchange, remoting version should be updated +// to 3. +constexpr int kSupportedRemotingVersion = 2; + // Codecs known and understood by cast senders and receivers. Note: receivers // are required to implement the following codecs to be Cast V2 compliant: H264, -// VP8, AAC, Opus. Senders have to implement at least one codec for audio and -// video to start a session. -enum class AudioCodec { kAac, kOpus }; -enum class VideoCodec { kH264, kVp8, kHevc, kVp9 }; +// VP8, AAC, Opus. Senders have to implement at least one codec from this +// list for audio or video to start a session. +// |kNotSpecified| is used in remoting to indicate that the stream is being +// remoted and is not specified as part of the OFFER message (indicated as +// "REMOTE_AUDIO" or "REMOTE_VIDEO"). +enum class AudioCodec { kAac, kOpus, kNotSpecified }; +enum class VideoCodec { kH264, kVp8, kHevc, kNotSpecified, kVp9, kAv1 }; + +enum class CastMode : uint8_t { kMirroring, kRemoting }; } // namespace cast } // namespace openscreen |