Give the stream API core-owned types
Command and Event no longer carry voelin-stream's types. voelin-core owns StreamInfo, ViewerInfo, StreamSetup, StreamKind, ViewerState, EndReason and LeaveReason (stream_types.rs) with u16 client ids, a viewer's SRTP profile as its name and its codec as voelin_media::Codec; stream.rs converts at the boundary. Command::SetSrtpProfiles takes profile names, which the stream task parses. EncodedFrame, LayerSpec, LayerId and LayerSet move into voelin-media (stream::EncodedFrame, layer); voelin-stream depends on it and re-exports them, so the engine, the stream sessions and voelinctl share one type. The crate is now a plain dependency of voelin-core (feature media keeps the module and WHIP), and its str0m feature is gone with str0m always there. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b0f95a384f
commit
da372dfe10
28 files changed
+798
-342
No files matched your search
@@ -95,7 +95,6 @@ impl FromStr for Codec {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "str0m")]
|
||||
impl From<Codec> for str0m::format::Codec {
|
||||
fn from(c: Codec) -> Self {
|
||||
match c {
|
||||
@@ -108,7 +107,6 @@ impl From<Codec> for str0m::format::Codec {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "str0m")]
|
||||
impl TryFrom<str0m::format::Codec> for Codec {
|
||||
type Error = Error;
|
||||
|
||||
@@ -226,7 +224,9 @@ pub struct EncodedChunk<'a> {
|
||||
pub pts_90khz: u64,
|
||||
}
|
||||
|
||||
/// One encoded frame, ready for `voelin_stream::Peer::write`.
|
||||
/// One frame as an encoder makes it. A stream takes it as a
|
||||
/// [`stream::EncodedFrame`](crate::stream::EncodedFrame), which adds the kind
|
||||
/// of media, the RTP time and the layer.
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct EncodedFrame {
|
||||
pub data: Vec<u8>,
|
||||
@@ -1039,7 +1039,6 @@ mod tests {
|
||||
assert_eq!(Codec::Av1.to_string(), "AV1");
|
||||
}
|
||||
|
||||
#[cfg(feature = "str0m")]
|
||||
#[test]
|
||||
fn str0m_mapping() {
|
||||
for c in Codec::ALL {
|
||||
|
||||
Reference in new issue
Block a user