use std::sync::atomic::{AtomicU32, Ordering};
#[derive(Debug)]
pub struct Stream {
pub stream_id: u32,
pub is_publishing: bool,
pub is_playing: bool,
pub name: String,
pub paused: bool,
pub receive_audio: bool,
pub receive_video: bool,
}
impl Stream {
pub fn new(stream_id: u32) -> Self {
Self {
stream_id,
is_publishing: false,
is_playing: false,
name: String::new(),
paused: false,
receive_audio: true,
receive_video: true,
}
}
}
pub fn publish_begin(stream: &mut Stream, _stream_key: &str) {
stream.is_publishing = true;
}
pub fn play_begin(stream: &mut Stream) {
stream.is_playing = true;
}