aboutsummaryrefslogtreecommitdiff
path: root/cast/streaming/constants.h
diff options
context:
space:
mode:
authorJordan Bayles <jophba@chromium.org>2020-09-21 09:02:24 -0700
committerCommit Bot <commit-bot@chromium.org>2020-09-21 17:39:18 +0000
commit867358ee772e2c547c4d589e5594dc09a2c68beb (patch)
treec2ee5d1e0068fff390111e159763c6ae7579448d /cast/streaming/constants.h
parent7159d1a56e7d1f4aeee4be1ba85bbb766ac71c79 (diff)
downloadopenscreen-867358ee772e2c547c4d589e5594dc09a2c68beb.tar.gz
[Cast Streaming] Implement sender session class
This patch adds a new SenderSession class along with unit testing for this class. Embedders can create an instance of this class in order to start a streaming session with an already known receiver. The embedder is expected to have a valid TLS connection already established with the receiver. Bug: b/162542753 Change-Id: Ia91df728d947e1fa20ed0b360f595f75d41bf11c Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2378540 Reviewed-by: Jordan Bayles <jophba@chromium.org> Reviewed-by: mark a. foltz <mfoltz@chromium.org> Reviewed-by: Yuri Wiitala <miu@chromium.org> Commit-Queue: Jordan Bayles <jophba@chromium.org>
Diffstat (limited to 'cast/streaming/constants.h')
-rw-r--r--cast/streaming/constants.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/cast/streaming/constants.h b/cast/streaming/constants.h
index 4a8d526e..7b32d4d8 100644
--- a/cast/streaming/constants.h
+++ b/cast/streaming/constants.h
@@ -49,7 +49,28 @@ constexpr int kRequiredNetworkPacketSize = 256;
// The spec declares RTP timestamps must always have a timebase of 90000 ticks
// per second for video.
-using kVideoTimebase = std::ratio<1, 90000>;
+constexpr int kRtpVideoTimebase = 90000;
+
+// Minimum resolution is 320x240.
+constexpr int kMinVideoHeight = 240;
+constexpr int kMinVideoWidth = 320;
+
+// The default frame rate for capture options is 30FPS.
+constexpr int kDefaultFrameRate = 30;
+
+// The default audio sample rate is 48kHz, slightly higher than standard
+// consumer audio.
+constexpr int kDefaultAudioSampleRate = 480000;
+
+// The default audio number of channels is set to stereo.
+constexpr int kDefaultAudioChannels = 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 };
} // namespace cast
} // namespace openscreen