From 34c928e9fe6cdc294ec794dacde52e05e21f2688 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Tue, 3 Dec 2024 12:42:52 +1100 Subject: [PATCH] tttocea708: log the bytes and times generated Part-of: --- video/closedcaption/src/tttocea708/imp.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/video/closedcaption/src/tttocea708/imp.rs b/video/closedcaption/src/tttocea708/imp.rs index 6cea94ce..d0aae515 100644 --- a/video/closedcaption/src/tttocea708/imp.rs +++ b/video/closedcaption/src/tttocea708/imp.rs @@ -83,10 +83,17 @@ static CAT: LazyLock = LazyLock::new(|| { ) }); -fn cc_data_buffer(data: &[u8], pts: gst::ClockTime, duration: gst::ClockTime) -> gst::Buffer { +fn cc_data_buffer( + imp: &TtToCea708, + data: &[u8], + pts: gst::ClockTime, + duration: gst::ClockTime, +) -> gst::Buffer { let mut ret = gst::Buffer::with_size(data.len()).unwrap(); let buf_mut = ret.get_mut().unwrap(); + gst::log!(CAT, imp = imp, "{pts} -> {}: {data:x?}", pts + duration); + buf_mut.copy_from_slice(0, data).unwrap(); buf_mut.set_pts(pts); buf_mut.set_duration(duration); @@ -145,7 +152,7 @@ impl TtToCea708 { .mul_div_round(fps_d * gst::ClockTime::SECOND.nseconds(), fps_n) .unwrap() .nseconds(); - mut_list.add(cc_data_buffer(&cea708.packet, pts, duration)); + mut_list.add(cc_data_buffer(self, &cea708.packet, pts, duration)); } bufferlist }