mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-06-13 19:59:25 +00:00
This element outputs the same format expected by tttocea608 in json mode. It notably differs from cea608tott in that it only uses libcaption's low-level API, as it needs to maintain its own view of the current state of the screen, and make fine-grained decisions as to when to output data and how to timestamp it. It covers a large portion of the 608 spec, with the exception of a few features that probably haven't ever seen widespread usage, those are listed in a TODO list at the top. It has been tested with a reference file produced by CEA and covers all the features it demonstrates. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/480>
30 lines
991 B
Rust
30 lines
991 B
Rust
// Copyright (C) 2021 Mathieu Duponchelle <mathieu@centricular.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.
|
|
|
|
use glib::prelude::*;
|
|
|
|
mod imp;
|
|
|
|
glib::wrapper! {
|
|
pub struct Cea608ToJson(ObjectSubclass<imp::Cea608ToJson>) @extends gst::Element, gst::Object;
|
|
}
|
|
|
|
// GStreamer elements need to be thread-safe. For the private implementation this is automatically
|
|
// enforced but for the public wrapper type we need to specify this manually.
|
|
unsafe impl Send for Cea608ToJson {}
|
|
unsafe impl Sync for Cea608ToJson {}
|
|
|
|
pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
|
|
gst::Element::register(
|
|
Some(plugin),
|
|
"cea608tojson",
|
|
gst::Rank::None,
|
|
Cea608ToJson::static_type(),
|
|
)
|
|
}
|