diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2020-11-22 20:21:45 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2020-11-23 11:28:35 +0300 |
commit | f81d7b61b5923eea4247548c1778d1c71d94ed92 (patch) | |
tree | 16ba3459d302dff6435db34f5effbafe94568d20 /video/closedcaption/src/cea608overlay/imp.rs | |
parent | 767ed3afaeab3a88255e6718c4ed008539438c41 (diff) |
video: Update to 2018 edition
Diffstat (limited to 'video/closedcaption/src/cea608overlay/imp.rs')
-rw-r--r-- | video/closedcaption/src/cea608overlay/imp.rs | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/video/closedcaption/src/cea608overlay/imp.rs b/video/closedcaption/src/cea608overlay/imp.rs index e55c16c8c..61f6a9899 100644 --- a/video/closedcaption/src/cea608overlay/imp.rs +++ b/video/closedcaption/src/cea608overlay/imp.rs @@ -19,23 +19,24 @@ use glib::subclass; use glib::subclass::prelude::*; use gst::prelude::*; use gst::subclass::prelude::*; +use gst::{gst_element_error, gst_error, gst_log, gst_trace}; use gst_video::prelude::*; +use once_cell::sync::Lazy; + use std::sync::Mutex; use pango::prelude::*; use crate::caption_frame::{CaptionFrame, Status}; -lazy_static! { - static ref CAT: gst::DebugCategory = { - gst::DebugCategory::new( - "cea608overlay", - gst::DebugColorFlags::empty(), - Some("CEA 608 overlay element"), - ) - }; -} +static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { + gst::DebugCategory::new( + "cea608overlay", + gst::DebugColorFlags::empty(), + Some("CEA 608 overlay element"), + ) +}); struct State { video_info: Option<gst_video::VideoInfo>, @@ -209,7 +210,7 @@ impl Cea608Overlay { // anymore mutably. unsafe { assert_eq!( - cairo_sys::cairo_surface_get_reference_count(surface.to_raw_none()), + cairo::ffi::cairo_surface_get_reference_count(surface.to_raw_none()), 1 ); let buffer = glib::translate::from_glib_none(buffer_ptr); @@ -391,7 +392,7 @@ impl ObjectSubclass for Cea608Overlay { type Instance = gst::subclass::ElementInstanceStruct<Self>; type Class = subclass::simple::ClassStruct<Self>; - glib_object_subclass!(); + glib::glib_object_subclass!(); fn with_class(klass: &Self::Class) -> Self { let templ = klass.get_pad_template("sink").unwrap(); |