1 // Copyright (C) 2019 Sebastian Dröge <sebastian@centricular.com>
2 //
3 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
5 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
6 // option. This file may not be copied, modified, or distributed
7 // except according to those terms.
8 
9 use gst::glib;
10 use gst::prelude::*;
11 
12 mod imp;
13 
14 glib::wrapper! {
15     pub struct Rav1Enc(ObjectSubclass<imp::Rav1Enc>) @extends gst_video::VideoEncoder, gst::Element, gst::Object;
16 }
17 
18 // GStreamer elements need to be thread-safe. For the private implementation this is automatically
19 // enforced but for the public wrapper type we need to specify this manually.
20 unsafe impl Send for Rav1Enc {}
21 unsafe impl Sync for Rav1Enc {}
22 
register(plugin: &gst::Plugin) -> Result<(), glib::BoolError>23 pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
24     gst::Element::register(
25         Some(plugin),
26         "rav1enc",
27         gst::Rank::Primary,
28         Rav1Enc::static_type(),
29     )
30 }
31