mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-26 13:31:00 +00:00
fixup: klv depay: debug log indentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1580>
This commit is contained in:
parent
e7d0e0702a
commit
c2f67bd3c9
1 changed files with 45 additions and 18 deletions
|
@ -161,9 +161,12 @@ impl RtpBaseDepay2Impl for RtpKlvDepay {
|
||||||
if !state.accumulator.is_empty()
|
if !state.accumulator.is_empty()
|
||||||
&& (packet.discont() || state.acc_ts != Some(packet.ext_timestamp()))
|
&& (packet.discont() || state.acc_ts != Some(packet.ext_timestamp()))
|
||||||
{
|
{
|
||||||
gst::debug!(CAT, imp: self,
|
gst::debug!(
|
||||||
"Discontinuity, discarding {} bytes in accumulator",
|
CAT,
|
||||||
state.accumulator.len());
|
imp: self,
|
||||||
|
"Discontinuity, discarding {} bytes in accumulator",
|
||||||
|
state.accumulator.len(),
|
||||||
|
);
|
||||||
|
|
||||||
state.clear_accumulator();
|
state.clear_accumulator();
|
||||||
}
|
}
|
||||||
|
@ -193,8 +196,11 @@ impl RtpBaseDepay2Impl for RtpKlvDepay {
|
||||||
}
|
}
|
||||||
|
|
||||||
if start && looks_like == LooksLike::Undetermined {
|
if start && looks_like == LooksLike::Undetermined {
|
||||||
gst::warning!(CAT, imp: self,
|
gst::warning!(
|
||||||
"New start, but data doesn't look like the start of a KLV unit?! Discarding");
|
CAT,
|
||||||
|
imp: self,
|
||||||
|
"New start, but data doesn't look like the start of a KLV unit?! Discarding",
|
||||||
|
);
|
||||||
state.clear_accumulator();
|
state.clear_accumulator();
|
||||||
self.obj().drop_packet(packet);
|
self.obj().drop_packet(packet);
|
||||||
return Ok(gst::FlowSuccess::Ok);
|
return Ok(gst::FlowSuccess::Ok);
|
||||||
|
@ -214,9 +220,12 @@ impl RtpBaseDepay2Impl for RtpKlvDepay {
|
||||||
|
|
||||||
if looks_like == LooksLike::Start {
|
if looks_like == LooksLike::Start {
|
||||||
if !state.accumulator.is_empty() {
|
if !state.accumulator.is_empty() {
|
||||||
gst::debug!(CAT, imp: self,
|
gst::debug!(
|
||||||
|
CAT,
|
||||||
|
imp: self,
|
||||||
"New start, but still {} bytes in accumulator, discarding",
|
"New start, but still {} bytes in accumulator, discarding",
|
||||||
state.accumulator.len());
|
state.accumulator.len(),
|
||||||
|
);
|
||||||
state.clear_accumulator();
|
state.clear_accumulator();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,8 +234,10 @@ impl RtpBaseDepay2Impl for RtpKlvDepay {
|
||||||
state.acc_ts = Some(packet.ext_timestamp());
|
state.acc_ts = Some(packet.ext_timestamp());
|
||||||
|
|
||||||
// if it looks like a start we know we don't have enough bytes yet
|
// if it looks like a start we know we don't have enough bytes yet
|
||||||
gst::debug!(CAT, imp: self,
|
gst::debug!(
|
||||||
"Start. Have {} bytes, but want {} bytes, waiting for more data",
|
CAT,
|
||||||
|
imp: self,
|
||||||
|
"Start. Have {} bytes, but want {} bytes, waiting for more data",
|
||||||
state.accumulator.len(),
|
state.accumulator.len(),
|
||||||
klv_utils::peek_klv(payload).unwrap(),
|
klv_utils::peek_klv(payload).unwrap(),
|
||||||
);
|
);
|
||||||
|
@ -239,8 +250,11 @@ impl RtpBaseDepay2Impl for RtpKlvDepay {
|
||||||
assert_eq!(looks_like, LooksLike::Undetermined);
|
assert_eq!(looks_like, LooksLike::Undetermined);
|
||||||
|
|
||||||
if state.accumulator.is_empty() {
|
if state.accumulator.is_empty() {
|
||||||
gst::debug!(CAT, imp: self,
|
gst::debug!(
|
||||||
"Continuation fragment, but no data in accumulator. Need to wait for start of next unit, discarding.");
|
CAT,
|
||||||
|
imp: self,
|
||||||
|
"Continuation fragment, but no data in accumulator. Need to wait for start of next unit, discarding.",
|
||||||
|
);
|
||||||
self.obj().drop_packet(packet);
|
self.obj().drop_packet(packet);
|
||||||
return Ok(gst::FlowSuccess::Ok);
|
return Ok(gst::FlowSuccess::Ok);
|
||||||
}
|
}
|
||||||
|
@ -248,16 +262,21 @@ impl RtpBaseDepay2Impl for RtpKlvDepay {
|
||||||
state.accumulator.extend_from_slice(payload);
|
state.accumulator.extend_from_slice(payload);
|
||||||
|
|
||||||
let Ok(klv_unit_size) = klv_utils::peek_klv(&state.accumulator) else {
|
let Ok(klv_unit_size) = klv_utils::peek_klv(&state.accumulator) else {
|
||||||
gst::warning!(CAT, imp: self,
|
gst::warning!(
|
||||||
"Accumulator does not contain KLV unit start?! Clearing.");
|
CAT,
|
||||||
|
imp: self,
|
||||||
|
"Accumulator does not contain KLV unit start?! Clearing.",
|
||||||
|
);
|
||||||
|
|
||||||
state.clear_accumulator();
|
state.clear_accumulator();
|
||||||
self.obj().drop_packet(packet);
|
self.obj().drop_packet(packet);
|
||||||
return Ok(gst::FlowSuccess::Ok);
|
return Ok(gst::FlowSuccess::Ok);
|
||||||
};
|
};
|
||||||
|
|
||||||
gst::log!(CAT, imp: self,
|
gst::log!(
|
||||||
"Continuation. Have {} bytes, want {} bytes",
|
CAT,
|
||||||
|
imp: self,
|
||||||
|
"Continuation. Have {} bytes, want {} bytes",
|
||||||
state.accumulator.len(),
|
state.accumulator.len(),
|
||||||
klv_unit_size,
|
klv_unit_size,
|
||||||
);
|
);
|
||||||
|
@ -269,7 +288,11 @@ impl RtpBaseDepay2Impl for RtpKlvDepay {
|
||||||
gst::warning!(CAT, imp: self, "More bytes than expected in accumulator!");
|
gst::warning!(CAT, imp: self, "More bytes than expected in accumulator!");
|
||||||
} else {
|
} else {
|
||||||
// For now we'll honour the marker bit unconditionally and don't second-guess it
|
// For now we'll honour the marker bit unconditionally and don't second-guess it
|
||||||
gst::warning!(CAT, imp: self, "Fewer bytes than expected in accumulator, but marker bit set!");
|
gst::warning!(
|
||||||
|
CAT,
|
||||||
|
imp: self,
|
||||||
|
"Fewer bytes than expected in accumulator, but marker bit set!",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,8 +301,12 @@ impl RtpBaseDepay2Impl for RtpKlvDepay {
|
||||||
Vec::<u8>::with_capacity(klv_unit_size),
|
Vec::<u8>::with_capacity(klv_unit_size),
|
||||||
);
|
);
|
||||||
|
|
||||||
gst::debug!(CAT, imp: self,
|
gst::debug!(
|
||||||
"Finished KLV unit, pushing out {} bytes", accumulator.len());
|
CAT,
|
||||||
|
imp: self,
|
||||||
|
"Finished KLV unit, pushing out {} bytes",
|
||||||
|
accumulator.len(),
|
||||||
|
);
|
||||||
|
|
||||||
let outbuf = gst::Buffer::from_mut_slice(accumulator);
|
let outbuf = gst::Buffer::from_mut_slice(accumulator);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue