Print frame timestamp/timecode in debug output

This commit is contained in:
Sebastian Dröge 2019-07-15 19:42:54 +03:00
parent 75eb959c80
commit 4ebcd78acc
2 changed files with 25 additions and 4 deletions

View file

@ -15,6 +15,7 @@ use std::{i32, u32};
use connect_ndi;
use stop_ndi;
use ndi::*;
use ndisys;
use HASHMAP_RECEIVERS;
@ -358,8 +359,18 @@ impl BaseSrcImpl for NdiAudioSrc {
gst_log!(
self.cat,
obj: element,
"NDI audio frame received: {:?}",
audio_frame
"NDI audio frame received: {:?} with timecode {} and timestamp {}",
audio_frame,
if audio_frame.timecode() == ndisys::NDIlib_send_timecode_synthesize {
gst::CLOCK_TIME_NONE
} else {
gst::ClockTime::from(audio_frame.timecode() as u64 * 100)
},
if audio_frame.timestamp() == ndisys::NDIlib_recv_timestamp_undefined {
gst::CLOCK_TIME_NONE
} else {
gst::ClockTime::from(audio_frame.timestamp() as u64 * 100)
},
);
let info = gst_audio::AudioInfo::new(

View file

@ -375,8 +375,18 @@ impl BaseSrcImpl for NdiVideoSrc {
gst_log!(
self.cat,
obj: element,
"NDI video frame received: {:?}",
video_frame
"NDI video frame received: {:?} with timecode {} and timestamp {}",
video_frame,
if video_frame.timecode() == ndisys::NDIlib_send_timecode_synthesize {
gst::CLOCK_TIME_NONE
} else {
gst::ClockTime::from(video_frame.timecode() as u64 * 100)
},
if video_frame.timestamp() == ndisys::NDIlib_recv_timestamp_undefined {
gst::CLOCK_TIME_NONE
} else {
gst::ClockTime::from(video_frame.timestamp() as u64 * 100)
},
);
// YV12 and I420 are swapped in the NDI SDK compared to GStreamer