onvifaggregator: Add support for UNIX reference timestamp metadata

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/780>
This commit is contained in:
Sebastian Dröge 2022-06-02 10:30:34 +03:00 committed by Mathieu Duponchelle
parent 939f37dec5
commit dfa5b9d8bb

View file

@ -68,6 +68,7 @@ static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
});
static NTP_CAPS: Lazy<gst::Caps> = Lazy::new(|| gst::Caps::builder("timestamp/x-ntp").build());
static UNIX_CAPS: Lazy<gst::Caps> = Lazy::new(|| gst::Caps::builder("timestamp/x-unix").build());
#[glib::object_subclass]
impl ObjectSubclass for OnvifAggregator {
@ -285,6 +286,9 @@ impl OnvifAggregator {
if meta.reference().is_subset(&NTP_CAPS) {
return Some(meta.timestamp());
}
if meta.reference().is_subset(&UNIX_CAPS) {
return Some(meta.timestamp() + PRIME_EPOCH_OFFSET);
}
}
None