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
@@ -1132,7 +1132,7 @@ impl App {
|
||||
.iter()
|
||||
.filter(|v| v.state == ViewerState::Requested)
|
||||
.map(|v| StudioViewer {
|
||||
client: i32::from(v.client.0),
|
||||
client: i32::from(v.client),
|
||||
name: self.studio_viewer_name(v).into(),
|
||||
state: "requested".into(),
|
||||
})
|
||||
@@ -1149,7 +1149,7 @@ impl App {
|
||||
let session = self.studio.stream.as_ref().map(|s| s.session);
|
||||
session
|
||||
.and_then(|id| self.sessions.get(&id))
|
||||
.map_or_else(|| format!("client {}", viewer.client.0), |v| v.nickname(viewer.client.0))
|
||||
.map_or_else(|| format!("client {}", viewer.client), |v| v.nickname(viewer.client))
|
||||
}
|
||||
|
||||
/// Keep the overlay sources as the switches say (`force`: also when
|
||||
@@ -2024,10 +2024,10 @@ impl App {
|
||||
pub(crate) fn studio_respond_viewer(&mut self, client: u16, accept: bool) {
|
||||
let Some(out) = &mut self.studio.stream else { return };
|
||||
if self.demo_ui {
|
||||
for v in out.viewers.iter_mut().filter(|v| v.client.0 == client) {
|
||||
for v in out.viewers.iter_mut().filter(|v| v.client == client) {
|
||||
v.state = ViewerState::Connected;
|
||||
}
|
||||
out.viewers.retain(|v| accept || v.client.0 != client);
|
||||
out.viewers.retain(|v| accept || v.client != client);
|
||||
self.studio_refresh_status();
|
||||
return;
|
||||
}
|
||||
@@ -2219,7 +2219,7 @@ impl App {
|
||||
/// with sample viewers.
|
||||
fn studio_demo_live(&mut self) {
|
||||
let viewer = |id: u16, state: ViewerState, estimate: u64| ViewerInfo {
|
||||
client: tsclientlib::ClientId(id),
|
||||
client: id,
|
||||
state,
|
||||
message: String::new(),
|
||||
layer: Some(0),
|
||||
@@ -2251,7 +2251,7 @@ impl App {
|
||||
if live && let Some(own) = view.state.own_client {
|
||||
view.streams.push(StreamInfo {
|
||||
id: "demo-studio".into(),
|
||||
streamer: tsclientlib::ClientId(own),
|
||||
streamer: own,
|
||||
name,
|
||||
kind: StreamKind::Screen,
|
||||
bitrate: 8000,
|
||||
|
||||
Reference in new issue
Block a user