Skip to main content

gsthlssink3/
lib.rs

1// Copyright (C) 2021 Rafael Caricio <rafael@caricio.com>
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-hlssink3:
12 *
13 * Since: plugins-rs-0.8.0
14 */
15use gst::glib;
16
17mod hlsbasesink;
18pub mod hlscmafsink;
19pub mod hlssink3;
20mod playlist;
21
22glib::wrapper! {
23    pub struct HlsBaseSinkGioOutputStream(ObjectSubclass<hlsbasesink::HlsBaseSinkGioOutputStream>) @extends gio::OutputStream;
24}
25
26unsafe impl Send for HlsBaseSinkGioOutputStream {}
27unsafe impl Sync for HlsBaseSinkGioOutputStream {}
28
29glib::wrapper! {
30    pub struct HlsBaseSink(ObjectSubclass<hlsbasesink::HlsBaseSink>) @extends gst::Bin, gst::Element, gst::Object;
31}
32
33pub fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
34    #[cfg(feature = "doc")]
35    {
36        use gst::prelude::*;
37        HlsBaseSink::static_type().mark_as_plugin_api(gst::PluginAPIFlags::empty());
38        hlsbasesink::HlsProgramDateTimeReference::static_type()
39            .mark_as_plugin_api(gst::PluginAPIFlags::empty());
40    }
41
42    hlssink3::register(plugin)?;
43    hlscmafsink::register(plugin)?;
44
45    Ok(())
46}
47
48gst::plugin_define!(
49    hlssink3,
50    env!("CARGO_PKG_DESCRIPTION"),
51    plugin_init,
52    concat!(env!("CARGO_PKG_VERSION"), "-", env!("COMMIT_ID")),
53    // FIXME: MPL-2.0 is only allowed since 1.18.3 (as unknown) and 1.20 (as known)
54    "MPL",
55    env!("CARGO_PKG_NAME"),
56    env!("CARGO_PKG_NAME"),
57    env!("CARGO_PKG_REPOSITORY"),
58    env!("BUILD_REL_DATE")
59);