mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-19 00:26:29 +00:00
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:
parent
b23a514657
commit
34c928e9fe
1 changed files with 9 additions and 2 deletions
|
@ -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 mut ret = gst::Buffer::with_size(data.len()).unwrap();
|
||||||
let buf_mut = ret.get_mut().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.copy_from_slice(0, data).unwrap();
|
||||||
buf_mut.set_pts(pts);
|
buf_mut.set_pts(pts);
|
||||||
buf_mut.set_duration(duration);
|
buf_mut.set_duration(duration);
|
||||||
|
@ -145,7 +152,7 @@ impl TtToCea708 {
|
||||||
.mul_div_round(fps_d * gst::ClockTime::SECOND.nseconds(), fps_n)
|
.mul_div_round(fps_d * gst::ClockTime::SECOND.nseconds(), fps_n)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.nseconds();
|
.nseconds();
|
||||||
mut_list.add(cc_data_buffer(&cea708.packet, pts, duration));
|
mut_list.add(cc_data_buffer(self, &cea708.packet, pts, duration));
|
||||||
}
|
}
|
||||||
bufferlist
|
bufferlist
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue