Skip to main content

gstrstracers/
lib.rs

1// Copyright (C) 2022 OneStream Live <guillaume.desmottes@onestream.live>
2//
3// This Source Code Form is subject to the terms of the Mozilla Public License, v2.0.
4// If a copy of the MPL was not distributed with this file, You can obtain one at
5// <https://mozilla.org/MPL/2.0/>.
6//
7// SPDX-License-Identifier: MPL-2.0
8#![allow(clippy::non_send_fields_in_send_ty, unused_doc_comments)]
9
10/**
11 * plugin-rstracers:
12 *
13 * Since: plugins-rs-0.9.0
14 */
15use gst::glib;
16
17mod buffer_lateness;
18#[cfg(feature = "v1_26")]
19mod memory_tracer;
20mod pad_push_timings;
21mod pcap_writer;
22#[cfg(unix)]
23mod pipeline_snapshot;
24mod queue_levels;
25
26fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
27    #[cfg(unix)]
28    pipeline_snapshot::register(plugin)?;
29    queue_levels::register(plugin)?;
30    buffer_lateness::register(plugin)?;
31    pad_push_timings::register(plugin)?;
32    pcap_writer::register(plugin)?;
33    #[cfg(feature = "v1_26")]
34    memory_tracer::register(plugin)?;
35    Ok(())
36}
37
38gst::plugin_define!(
39    rstracers,
40    env!("CARGO_PKG_DESCRIPTION"),
41    plugin_init,
42    concat!(env!("CARGO_PKG_VERSION"), "-", env!("COMMIT_ID")),
43    // FIXME: MPL-2.0 is only allowed since 1.18.3 (as unknown) and 1.20 (as known)
44    "MPL",
45    env!("CARGO_PKG_NAME"),
46    env!("CARGO_PKG_NAME"),
47    env!("CARGO_PKG_REPOSITORY"),
48    env!("BUILD_REL_DATE")
49);