From 7ec17c0cc5c198e504dd6992b66435c2b47af328 Mon Sep 17 00:00:00 2001 From: QuantumEntangledAndy Date: Sun, 3 Oct 2021 14:50:13 +0700 Subject: [PATCH] Ensure camera accepts stream start command --- crates/core/src/bc_protocol/stream.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/core/src/bc_protocol/stream.rs b/crates/core/src/bc_protocol/stream.rs index 316c9e9..2bf3d5d 100644 --- a/crates/core/src/bc_protocol/stream.rs +++ b/crates/core/src/bc_protocol/stream.rs @@ -120,6 +120,18 @@ impl BcCamera { sub_video.send(start_video)?; + let msg = sub_video.rx.recv_timeout(RX_TIMEOUT)?; + if let BcMeta { + response_code: 200, .. + } = msg.meta + { + } else { + return Err(Error::UnintelligibleReply { + reply: msg, + why: "The camera did not accept the stream start command.", + }); + } + let mut media_sub = BinarySubscriber::from_bc_sub(&sub_video); let result;