mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-05-06 18:38:44 +00:00
42385c81be
It attempts to produce a (nearly) gapless live stream by synchronizing its output to the running time and forwarding the next input buffer if its start is (nearly) flush with the end of the last output buffer. If the input buffer is missing or too far in the future, it duplicates the last output buffer with adjusted timestamps. If it is operating on a raw audio stream, it will fill duplicate buffers with silence. If an input buffer arrives too late, it is thrown away. If the last input buffer was accepted too long ago (according to `late-threshold`), a late input buffer is accepted anyway, but immediately considered a duplicate. Due to the silence-filling, this has no effect on audio, but video gets a "slideshow" effect instead of freezing completely. The "many-repeats" property will be notified when this element has recently duplicated a lot of buffers or recovered from such a state. Co-authored-by: Vivia Nikolaidou <vivia@ahiru.eu> Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/708>
29 lines
749 B
Rust
29 lines
749 B
Rust
// Copyright (C) 2022 LTN Global Communications, Inc.
|
|
// Contact: Jan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com>
|
|
//
|
|
// This Source Code Form is subject to the terms of the Mozilla Public License, v2.0.
|
|
// If a copy of the MPL was not distributed with this file, You can obtain one at
|
|
// <https://mozilla.org/MPL/2.0/>.
|
|
//
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
use gst::{glib, prelude::*};
|
|
|
|
mod imp;
|
|
|
|
glib::wrapper! {
|
|
pub struct LiveSync(ObjectSubclass<imp::LiveSync>)
|
|
@extends gst::Element, gst::Object;
|
|
}
|
|
|
|
pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
|
|
gst::Element::register(
|
|
Some(plugin),
|
|
"livesync",
|
|
gst::Rank::None,
|
|
LiveSync::static_type(),
|
|
)?;
|
|
|
|
Ok(())
|
|
}
|