tttocea708: log the bytes and times generated

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1942>
This commit is contained in:
Matthew Waters 2024-12-03 12:42:52 +11:00 committed by GStreamer Marge Bot
parent b23a514657
commit 34c928e9fe

View file

@ -83,10 +83,17 @@ static CAT: LazyLock<gst::DebugCategory> = 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
}