video updates
This commit is contained in:
parent
da22370468
commit
0940004c70
@ -7,6 +7,7 @@ use gst::prelude::*;
|
||||
use lesavka_common::lesavka::VideoPacket;
|
||||
use tokio_stream::wrappers::ReceiverStream;
|
||||
use tonic::Status;
|
||||
use tracing::{debug, enabled, Level};
|
||||
|
||||
pub async fn spawn_camera(
|
||||
dev: &str,
|
||||
@ -64,6 +65,22 @@ pub async fn spawn_camera(
|
||||
|
||||
let map = buffer.map_readable().map_err(|_| gst::FlowError::Error)?;
|
||||
|
||||
if enabled!(Level::DEBUG) {
|
||||
if let Some(slice) = map.as_slice().get(0..5) {
|
||||
match slice[4] & 0b1_1111 {
|
||||
// 0x07 = SPS, 0x05 = IDR (Annex-B “byte-stream”)
|
||||
0x07 | 0x05 => {
|
||||
debug!(
|
||||
"🎞️ monitor {id}: got NAL {:02X}, {} bytes",
|
||||
slice[4],
|
||||
map.as_slice().len()
|
||||
);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let pkt = VideoPacket {
|
||||
id,
|
||||
pts: pts_us,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user