use crate::ViewerContext;
pub fn video_timestamp_component_to_video_time(
ctx: &ViewerContext<'_>,
video_timestamp: re_sdk_types::components::VideoTimestamp,
timescale: Option<re_video::Timescale>,
) -> re_video::Time {
if let Some(timescale) = timescale {
re_video::Time::from_nanos(video_timestamp.as_nanos(), timescale)
} else {
let fps = ctx.time_ctrl.fps().unwrap_or(1.0);
re_video::Time((video_timestamp.0.0 as f64 * fps as f64) as i64)
}
}
pub fn video_stream_time_from_query(query: &re_chunk_store::LatestAtQuery) -> re_video::Time {
re_video::Time::new(query.at().as_i64())
}