Increase broadcast size to something more realist for large streams

This commit is contained in:
QuantumEntangledAndy committed 2023-10-26 11:35:27 +07:00
1 parent 45151203e2
commit a634639778
2 files changed
+8 -4

No files matched your search

+4 -2
View File
@@ -318,8 +318,10 @@ impl StreamInstance {
impl StreamData {
async fn new(name: StreamKind, instance: NeoInstance, strict: bool) -> Result<Self> {
const BUFFER_DURATION: Duration = Duration::from_secs(15);
let (vid, _) = broadcast::<StampedData>(100);
let (aud, _) = broadcast::<StampedData>(100);
// At 30fps for 15s with audio is is about 900 frames
// Therefore we set this buffer to a rather large 2000
let (vid, _) = broadcast::<StampedData>(2000);
let (aud, _) = broadcast::<StampedData>(2000);
let (vid_history, _) = watch::<VecDeque<StampedData>>(VecDeque::new());
let vid_history = Arc::new(vid_history);
let (aud_history, _) = watch::<VecDeque<StampedData>>(VecDeque::new());
+4 -2
View File
@@ -337,8 +337,10 @@ async fn stream_run(
// This is the data that gets sent to gstreamer thread
// It represents the combination of the camera stream and the appsrc seek messages
let (aud_data_tx, aud_data_rx) = broadcast(100);
let (vid_data_tx, vid_data_rx) = broadcast(100);
// At 30fps for 15s with audio you need about 900 frames
// Therefore the buffer is rather large at 2000
let (aud_data_tx, aud_data_rx) = broadcast(2000);
let (vid_data_tx, vid_data_rx) = broadcast(2000);
// This thread takes the video data from the cam and passed it into the stream
let mut vidstream = BroadcastStream::new(vidstream.resubscribe());