2020-11-15 13:50:12 +00:00
|
|
|
// Copyright (C) 2019 Philippe Normand <philn@igalia.com>
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
2022-01-15 19:18:47 +00:00
|
|
|
//
|
2022-03-14 08:22:53 +00:00
|
|
|
// SPDX-License-Identifier: MIT OR Apache-2.0
|
2020-11-15 13:50:12 +00:00
|
|
|
|
2021-06-03 18:20:54 +00:00
|
|
|
use gst::glib;
|
|
|
|
use gst::prelude::*;
|
2020-11-15 13:50:12 +00:00
|
|
|
|
|
|
|
mod imp;
|
|
|
|
|
2020-12-17 22:44:49 +00:00
|
|
|
glib::wrapper! {
|
2020-11-15 13:50:12 +00:00
|
|
|
pub struct Dav1dDec(ObjectSubclass<imp::Dav1dDec>) @extends gst_video::VideoDecoder, gst::Element, gst::Object;
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
|
2022-11-30 18:35:39 +00:00
|
|
|
let rank = if gst::version() >= (1, 21, 2, 1) {
|
|
|
|
// AOM av1dec rank was demoted in 1.22 dev cycle
|
|
|
|
// https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3287
|
2023-11-02 12:10:59 +00:00
|
|
|
gst::Rank::PRIMARY
|
2022-11-30 18:35:39 +00:00
|
|
|
} else {
|
2023-11-02 12:10:59 +00:00
|
|
|
gst::Rank::PRIMARY + 1
|
2022-11-30 18:35:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
gst::Element::register(Some(plugin), "dav1ddec", rank, Dav1dDec::static_type())
|
2020-11-15 13:50:12 +00:00
|
|
|
}
|