Skip to content

Commit 2abd209

Browse files
sr1990algesten
andauthored
Add H266/VVC RTP packetizer and depacketizer (algesten#971)
* Add H266/VVC RTP packetizer and depacketizer (RFC 9328). * Add RtcConfig::enable_h266(), make H.266 opt-in, expand tests. * Document H266 codec support * Fix H266 comment line widths --------- Co-authored-by: Martin Algesten <martin@algesten.se>
1 parent ddcb5a5 commit 2abd209

20 files changed

Lines changed: 5354 additions & 10 deletions

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Unreleased
22

3+
* Add H266/VVC RTP packetizer and depacketizer #971
34
* Negotiate SCTP max message size for data channels #852
45
* Expose the negotiated DTLS protocol version #979
56
* Make MTU size configurable #967

src/config.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,15 @@ impl RtcConfig {
269269
self
270270
}
271271

272+
/// Enable H266 (VVC) video codec.
273+
///
274+
/// Disabled by default: no major browser (Chrome, Safari, Firefox)
275+
/// currently supports H.266/VVC, so it is opt-in.
276+
pub fn enable_h266(mut self, enabled: bool) -> Self {
277+
self.codec_config.enable_h266(enabled);
278+
self
279+
}
280+
272281
/// Enable VP9 video codec.
273282
///
274283
/// Enabled by default.

src/format/codec.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ pub enum Codec {
3535
// TODO show this when we support h265.
3636
#[doc(hidden)]
3737
H265,
38+
/// H266/VVC.
39+
H266,
3840
Vp8,
3941
Vp9,
4042
// TODO show this when we support Av1.
@@ -64,7 +66,7 @@ impl Codec {
6466
/// Tells if codec is video.
6567
pub fn is_video(&self) -> bool {
6668
use Codec::*;
67-
matches!(self, H265 | H264 | Vp8 | Vp9 | Av1)
69+
matches!(self, H266 | H265 | H264 | Vp8 | Vp9 | Av1)
6870
}
6971

7072
/// Audio/Video.
@@ -86,6 +88,7 @@ impl<'a> From<&'a str> for Codec {
8688
"pcma" => Codec::PCMA,
8789
"h264" => Codec::H264,
8890
"h265" => Codec::H265,
91+
"h266" => Codec::H266,
8992
"vp8" => Codec::Vp8,
9093
"vp9" => Codec::Vp9,
9194
"av1" => Codec::Av1,
@@ -103,6 +106,7 @@ impl fmt::Display for Codec {
103106
Codec::PCMA => write!(f, "PCMA"),
104107
Codec::H264 => write!(f, "H264"),
105108
Codec::H265 => write!(f, "H265"),
109+
Codec::H266 => write!(f, "H266"),
106110
Codec::Vp8 => write!(f, "VP8"),
107111
Codec::Vp9 => write!(f, "VP9"),
108112
Codec::Av1 => write!(f, "AV1"),

0 commit comments

Comments
 (0)