onvif: Use CustomMeta::is_registered function

Use CustomMeta::is_registered() to avoid registering twice
OnvifXMLFrameMeta type.
It will be useful later when adding relation meta elements.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1464>
This commit is contained in:
Benjamin Gaignard 2024-02-12 14:50:05 +01:00 committed by GStreamer Marge Bot
parent 4abc5c7a48
commit eddf443a8b

View file

@ -120,7 +120,9 @@ fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
onvifmetadataoverlay::register(plugin)?; onvifmetadataoverlay::register(plugin)?;
onvifmetadataparse::register(plugin)?; onvifmetadataparse::register(plugin)?;
gst::meta::CustomMeta::register("OnvifXMLFrameMeta", &[]); if !gst::meta::CustomMeta::is_registered("OnvifXMLFrameMeta") {
gst::meta::CustomMeta::register("OnvifXMLFrameMeta", &[]);
}
Ok(()) Ok(())
} }