Group and merge imports in all manual code

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1182>
This commit is contained in:
Sebastian Dröge 2023-01-03 20:58:25 +02:00
parent 45c145ad50
commit 567ce0a3bf
329 changed files with 1466 additions and 1929 deletions

View file

@ -10,15 +10,12 @@
// This is the format we request: // This is the format we request:
// Audio / Signed 16bit / 1 channel / arbitrary sample rate // Audio / Signed 16bit / 1 channel / arbitrary sample rate
use gst::element_error;
use gst::prelude::*;
use byte_slice_cast::*;
use std::i16; use std::i16;
use anyhow::Error; use anyhow::Error;
use byte_slice_cast::*;
use derive_more::{Display, Error}; use derive_more::{Display, Error};
use gst::{element_error, prelude::*};
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;

View file

@ -10,10 +10,9 @@
// The application provides data of the following format: // The application provides data of the following format:
// Video / BGRx (4 bytes) / 2 fps // Video / BGRx (4 bytes) / 2 fps
use gst::prelude::*;
use anyhow::Error; use anyhow::Error;
use derive_more::{Display, Error}; use derive_more::{Display, Error};
use gst::prelude::*;
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;

View file

@ -1,29 +1,27 @@
// This example demonstrates how to implement a custom compositor based on cairo. // This example demonstrates how to implement a custom compositor based on cairo.
#![allow(clippy::non_send_fields_in_send_ty)] #![allow(clippy::non_send_fields_in_send_ty)]
use anyhow::{Context, Error};
use gst::prelude::*; use gst::prelude::*;
use gst_base::prelude::*; use gst_base::prelude::*;
use anyhow::{Context, Error};
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;
// Our custom compositor element is defined in this module. // Our custom compositor element is defined in this module.
mod cairo_compositor { mod cairo_compositor {
use super::*;
use gst_base::subclass::prelude::*; use gst_base::subclass::prelude::*;
use gst_video::prelude::*; use gst_video::{prelude::*, subclass::prelude::*};
use gst_video::subclass::prelude::*;
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
use super::*;
// In the imp submodule we include the actual implementation of the compositor. // In the imp submodule we include the actual implementation of the compositor.
mod imp { mod imp {
use super::*;
use std::sync::Mutex; use std::sync::Mutex;
use super::*;
// Settings of the compositor. // Settings of the compositor.
#[derive(Clone)] #[derive(Clone)]
struct Settings { struct Settings {
@ -413,9 +411,10 @@ mod cairo_compositor {
// This doesn't implement any additional logic but only provides properties for configuring the // This doesn't implement any additional logic but only provides properties for configuring the
// appearance of the stream corresponding to this pad and the storage of the property values. // appearance of the stream corresponding to this pad and the storage of the property values.
mod imp_pad { mod imp_pad {
use super::*;
use std::sync::Mutex; use std::sync::Mutex;
use super::*;
// Settings of our pad. // Settings of our pad.
#[derive(Clone)] #[derive(Clone)]
pub(super) struct Settings { pub(super) struct Settings {

View file

@ -4,16 +4,15 @@
// an appsrc and retrieves them again from an appsink. // an appsrc and retrieves them again from an appsink.
#![allow(clippy::non_send_fields_in_send_ty)] #![allow(clippy::non_send_fields_in_send_ty)]
use gst::element_error; use gst::{element_error, prelude::*};
use gst::prelude::*;
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;
mod custom_meta { mod custom_meta {
use std::{fmt, mem};
use gst::prelude::*; use gst::prelude::*;
use std::fmt;
use std::mem;
// Public Rust type for the custom meta. // Public Rust type for the custom meta.
#[repr(transparent)] #[repr(transparent)]
@ -70,10 +69,10 @@ mod custom_meta {
// Actual unsafe implementation of the meta. // Actual unsafe implementation of the meta.
mod imp { mod imp {
use std::{mem, ptr};
use glib::translate::*; use glib::translate::*;
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
use std::mem;
use std::ptr;
pub(super) struct CustomMetaParams { pub(super) struct CustomMetaParams {
pub label: String, pub label: String,

View file

@ -7,15 +7,20 @@
// directly to the on the DXGI swapchain's backbuffer via Windows API in // directly to the on the DXGI swapchain's backbuffer via Windows API in
// strictly zero-copy manner // strictly zero-copy manner
use gst::glib; use std::{
use gst::prelude::*; collections::VecDeque,
use std::collections::VecDeque; sync::{Arc, Mutex},
use std::sync::{Arc, Mutex}; time::SystemTime,
use std::time::SystemTime; };
use gst::{glib, prelude::*};
use windows::{ use windows::{
core::*, core::*,
Win32::Graphics::{ Win32::Graphics::{
Direct2D::Common::*, Direct2D::*, Direct3D11::*, DirectWrite::*, Dxgi::Common::*, Dxgi::*, Direct2D::{Common::*, *},
Direct3D11::*,
DirectWrite::*,
Dxgi::{Common::*, *},
}, },
}; };

View file

@ -5,10 +5,10 @@
// //
// It's possible to dump the logs at any time in an application, // It's possible to dump the logs at any time in an application,
// not just on exit like is done here. // not just on exit like is done here.
use gst::prelude::*;
use std::process; use std::process;
use gst::prelude::*;
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;

View file

@ -29,15 +29,14 @@
// Especially Windows APIs tend to be quite picky about samplerate and sample-format. // Especially Windows APIs tend to be quite picky about samplerate and sample-format.
// The same applies to videostreams. // The same applies to videostreams.
use gst::element_error; use std::{
use gst::element_warning; env,
use gst::prelude::*; sync::{Arc, Mutex},
};
use std::env;
use std::sync::{Arc, Mutex};
use anyhow::Error; use anyhow::Error;
use derive_more::{Display, Error}; use derive_more::{Display, Error};
use gst::{element_error, element_warning, prelude::*};
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;

View file

@ -8,15 +8,11 @@
// Discovered information could for example contain the stream's duration or whether it is // Discovered information could for example contain the stream's duration or whether it is
// seekable (filesystem) or not (some http servers). // seekable (filesystem) or not (some http servers).
use gst_pbutils::prelude::*; use std::env;
use gst_pbutils::DiscovererInfo;
use gst_pbutils::DiscovererStreamInfo;
use anyhow::Error; use anyhow::Error;
use derive_more::{Display, Error}; use derive_more::{Display, Error};
use gst_pbutils::{prelude::*, DiscovererInfo, DiscovererStreamInfo};
use std::env;
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;

View file

@ -12,16 +12,15 @@
// {uridecodebin} -| {encodebin}-{filesink} // {uridecodebin} -| {encodebin}-{filesink}
// \-{queue}-{videoconvert}-{videoscale}----/ // \-{queue}-{videoconvert}-{videoscale}----/
use gst::element_error; use std::{
use gst::element_warning; env,
sync::{Arc, Mutex},
use gst_pbutils::prelude::*; };
use std::env;
use std::sync::{Arc, Mutex};
use anyhow::Error; use anyhow::Error;
use derive_more::{Display, Error}; use derive_more::{Display, Error};
use gst::{element_error, element_warning};
use gst_pbutils::prelude::*;
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;

View file

@ -14,20 +14,18 @@
// how the file descriptor of FdMemory can be accessed in a pipeline. // how the file descriptor of FdMemory can be accessed in a pipeline.
// Note that instead of manual mapping the file descriptor it is also possible // Note that instead of manual mapping the file descriptor it is also possible
// to use map_writable, which will also map the file descriptor. // to use map_writable, which will also map the file descriptor.
use futures::StreamExt;
use gst::{element_error, prelude::*};
use anyhow::Error;
use derive_more::{Display, Error};
use memmap2::MmapMut;
use uds::UnixStreamExt;
use std::{ use std::{
os::unix::{net::UnixStream, prelude::AsRawFd}, os::unix::{net::UnixStream, prelude::AsRawFd},
sync::{Arc, Mutex}, sync::{Arc, Mutex},
}; };
use anyhow::Error;
use derive_more::{Display, Error};
use futures::StreamExt;
use gst::{element_error, prelude::*};
use memmap2::MmapMut;
use uds::UnixStreamExt;
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;

View file

@ -3,13 +3,11 @@
// or for an EOS message. When a message notifying about either of both // or for an EOS message. When a message notifying about either of both
// is received, the future is resolved. // is received, the future is resolved.
use gst::prelude::*;
use futures::executor::LocalPool;
use futures::prelude::*;
use std::env; use std::env;
use futures::{executor::LocalPool, prelude::*};
use gst::prelude::*;
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;

View file

@ -35,11 +35,10 @@
// those with lowers (higher number). Thus, Layers with higher priority are "in the front". // those with lowers (higher number). Thus, Layers with higher priority are "in the front".
// - The timeline is the enclosing element, grouping all layers and providing a timeframe. // - The timeline is the enclosing element, grouping all layers and providing a timeframe.
use gst::prelude::*; use std::env;
use ges::prelude::*; use ges::prelude::*;
use gst::prelude::*;
use std::env;
#[allow(unused_imports)] #[allow(unused_imports)]
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]

View file

@ -28,16 +28,18 @@ void main () {
"#; "#;
mod mirror { mod mirror {
use super::{gl, FRAGMENT_SHADER};
use gst_base::subclass::BaseTransformMode;
use gst_gl::prelude::*;
use gst_gl::subclass::prelude::*;
use gst_gl::subclass::GLFilterMode;
use gst_gl::*;
use once_cell::sync::Lazy;
use std::sync::Mutex; use std::sync::Mutex;
use gst_base::subclass::BaseTransformMode;
use gst_gl::{
prelude::*,
subclass::{prelude::*, GLFilterMode},
*,
};
use once_cell::sync::Lazy;
use super::{gl, FRAGMENT_SHADER};
pub static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { pub static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"rsglmirrorfilter", "rsglmirrorfilter",

View file

@ -1,8 +1,7 @@
use gst::prelude::*; use std::env;
use futures::prelude::*; use futures::prelude::*;
use gst::prelude::*;
use std::env;
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;

View file

@ -10,14 +10,12 @@
// (|) // (|)
// {videotestsrc} - {glsinkbin} // {videotestsrc} - {glsinkbin}
use gst::prelude::*; use std::cell::RefCell;
use gio::prelude::*; use gio::prelude::*;
use gst::prelude::*;
use gtk::prelude::*; use gtk::prelude::*;
use std::cell::RefCell;
fn create_ui(app: &gtk::Application) { fn create_ui(app: &gtk::Application) {
let pipeline = gst::Pipeline::default(); let pipeline = gst::Pipeline::default();
let src = gst::ElementFactory::make("videotestsrc").build().unwrap(); let src = gst::ElementFactory::make("videotestsrc").build().unwrap();

View file

@ -17,18 +17,12 @@
// {videotestsrc} - {xvimagesink(on linux)} // {videotestsrc} - {xvimagesink(on linux)}
// {videotestsrc} - {glimagesink(on mac)} // {videotestsrc} - {glimagesink(on mac)}
use gst_video::prelude::*; use std::{cell::RefCell, os::raw::c_void, process};
use gio::prelude::*; use gio::prelude::*;
use gst_video::prelude::*;
use gtk::prelude::*; use gtk::prelude::*;
use std::os::raw::c_void;
use std::cell::RefCell;
use std::process;
#[cfg(all(target_os = "linux", feature = "gtkvideooverlay-x11"))] #[cfg(all(target_os = "linux", feature = "gtkvideooverlay-x11"))]
fn create_video_sink() -> gst::Element { fn create_video_sink() -> gst::Element {
// When we are on linux with the Xorg display server, we use the // When we are on linux with the Xorg display server, we use the

View file

@ -3,10 +3,9 @@
// as launch syntax. // as launch syntax.
// When the parsing succeeded, the pipeline is run until the stream ends or an error happens. // When the parsing succeeded, the pipeline is run until the stream ends or an error happens.
use gst::prelude::*; use std::{env, process};
use std::env; use gst::prelude::*;
use std::process;
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;

View file

@ -7,10 +7,10 @@
// things from the main loop (timeouts, UI events, socket events, ...) instead // things from the main loop (timeouts, UI events, socket events, ...) instead
// of just handling messages from GStreamer's bus. // of just handling messages from GStreamer's bus.
use gst::prelude::*;
use std::env; use std::env;
use gst::prelude::*;
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;

View file

@ -8,15 +8,15 @@
// The capsfilter element allows us to dictate the video resolution we want for the // The capsfilter element allows us to dictate the video resolution we want for the
// videotestsrc and the overlaycomposition element. // videotestsrc and the overlaycomposition element.
use gst::prelude::*; use std::{
ops,
use pango::prelude::*; sync::{Arc, Mutex},
};
use std::ops;
use std::sync::{Arc, Mutex};
use anyhow::Error; use anyhow::Error;
use derive_more::{Display, Error}; use derive_more::{Display, Error};
use gst::prelude::*;
use pango::prelude::*;
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;

View file

@ -8,11 +8,10 @@
// {audiotestsrc} - {fakesink} // {audiotestsrc} - {fakesink}
#![allow(clippy::question_mark)] #![allow(clippy::question_mark)]
use gst::prelude::*; use std::i16;
use byte_slice_cast::*; use byte_slice_cast::*;
use gst::prelude::*;
use std::i16;
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;

View file

@ -11,15 +11,15 @@
// The capsfilter element allows us to dictate the video resolution we want for the // The capsfilter element allows us to dictate the video resolution we want for the
// videotestsrc and the cairooverlay element. // videotestsrc and the cairooverlay element.
use gst::prelude::*; use std::{
ops,
use pango::prelude::*; sync::{Arc, Mutex},
};
use std::ops;
use std::sync::{Arc, Mutex};
use anyhow::Error; use anyhow::Error;
use derive_more::{Display, Error}; use derive_more::{Display, Error};
use gst::prelude::*;
use pango::prelude::*;
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;

View file

@ -9,10 +9,10 @@
// Much of the playbin's behavior can be controlled by so-called flags, as well // Much of the playbin's behavior can be controlled by so-called flags, as well
// as the playbin's properties and signals. // as the playbin's properties and signals.
use gst::prelude::*;
use std::env; use std::env;
use gst::prelude::*;
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;

View file

@ -5,12 +5,13 @@
// audio / subtitle streams or changing the volume) are all supported by simple // audio / subtitle streams or changing the volume) are all supported by simple
// one-line function calls on the GstPlayer. // one-line function calls on the GstPlayer.
use gst::prelude::*; use std::{
env,
use std::env; sync::{Arc, Mutex},
use std::sync::{Arc, Mutex}; };
use anyhow::Error; use anyhow::Error;
use gst::prelude::*;
#[allow(unused_imports)] #[allow(unused_imports)]
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]

View file

@ -12,10 +12,10 @@
// For convenience, the API has a set of pre-defined queries, but also // For convenience, the API has a set of pre-defined queries, but also
// allows custom queries (which can be defined and used by your own elements). // allows custom queries (which can be defined and used by your own elements).
use gst::prelude::*;
use std::env; use std::env;
use gst::prelude::*;
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;

View file

@ -1,8 +1,7 @@
use gst::element_error;
use gst::prelude::*;
use std::env; use std::env;
use gst::{element_error, prelude::*};
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;

View file

@ -1,5 +1,4 @@
use gst::element_error; use gst::{element_error, prelude::*};
use gst::prelude::*;
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;

View file

@ -4,14 +4,12 @@
// send to the server. For this, the launch syntax pipeline, that is passed // send to the server. For this, the launch syntax pipeline, that is passed
// to this example's cli is spawned and the client's media is streamed into it. // to this example's cli is spawned and the client's media is streamed into it.
use std::env; use std::{env, ptr};
use std::ptr;
use glib::translate::*;
use gst_rtsp_server::prelude::*;
use anyhow::Error; use anyhow::Error;
use derive_more::{Display, Error}; use derive_more::{Display, Error};
use glib::translate::*;
use gst_rtsp_server::prelude::*;
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;

View file

@ -8,10 +8,9 @@
// the client machinery and printing some status. // the client machinery and printing some status.
#![allow(clippy::non_send_fields_in_send_ty)] #![allow(clippy::non_send_fields_in_send_ty)]
use gst_rtsp_server::prelude::*;
use anyhow::Error; use anyhow::Error;
use derive_more::{Display, Error}; use derive_more::{Display, Error};
use gst_rtsp_server::prelude::*;
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;
@ -81,10 +80,10 @@ fn main_loop() -> Result<(), Error> {
// Our custom media factory that creates a media input manually // Our custom media factory that creates a media input manually
mod media_factory { mod media_factory {
use super::*;
use gst_rtsp_server::subclass::prelude::*; use gst_rtsp_server::subclass::prelude::*;
use super::*;
// In the imp submodule we include the actual implementation // In the imp submodule we include the actual implementation
mod imp { mod imp {
use super::*; use super::*;
@ -211,10 +210,10 @@ mod media {
// Our custom RTSP server subclass that reports when clients are connecting and uses // Our custom RTSP server subclass that reports when clients are connecting and uses
// our custom RTSP client subclass for each client // our custom RTSP client subclass for each client
mod server { mod server {
use super::*;
use gst_rtsp_server::subclass::prelude::*; use gst_rtsp_server::subclass::prelude::*;
use super::*;
// In the imp submodule we include the actual implementation // In the imp submodule we include the actual implementation
mod imp { mod imp {
use super::*; use super::*;

View file

@ -5,10 +5,9 @@
use std::env; use std::env;
use gst_rtsp_server::prelude::*;
use anyhow::Error; use anyhow::Error;
use derive_more::{Display, Error}; use derive_more::{Display, Error};
use gst_rtsp_server::prelude::*;
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;

View file

@ -7,20 +7,17 @@
// coefficients are provided via Rust API on the filter as a Vec<f32>. // coefficients are provided via Rust API on the filter as a Vec<f32>.
#![allow(clippy::non_send_fields_in_send_ty)] #![allow(clippy::non_send_fields_in_send_ty)]
use gst::prelude::*;
use anyhow::Error; use anyhow::Error;
use derive_more::{Display, Error}; use derive_more::{Display, Error};
use gst::prelude::*;
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;
// Our custom FIR filter element is defined in this module // Our custom FIR filter element is defined in this module
mod fir_filter { mod fir_filter {
use gst_base::subclass::prelude::*;
use byte_slice_cast::*; use byte_slice_cast::*;
use gst_base::subclass::prelude::*;
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
// The debug category we use below for our filter // The debug category we use below for our filter
@ -34,9 +31,9 @@ mod fir_filter {
// In the imp submodule we include the actual implementation // In the imp submodule we include the actual implementation
mod imp { mod imp {
use std::{collections::VecDeque, sync::Mutex};
use super::*; use super::*;
use std::collections::VecDeque;
use std::sync::Mutex;
// This is the private data of our filter // This is the private data of our filter
#[derive(Default)] #[derive(Default)]

View file

@ -18,11 +18,9 @@
// (More modes of operation are possible, see: gst::TagMergeMode) // (More modes of operation are possible, see: gst::TagMergeMode)
// This merge-mode can also be supplied to any method that adds new tags. // This merge-mode can also be supplied to any method that adds new tags.
use gst::prelude::*; use anyhow::{anyhow, Error};
use anyhow::anyhow;
use anyhow::Error;
use derive_more::{Display, Error}; use derive_more::{Display, Error};
use gst::prelude::*;
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;

View file

@ -7,11 +7,9 @@
// with the correct stride from GStreamer to the image crate as GStreamer does not necessarily // with the correct stride from GStreamer to the image crate as GStreamer does not necessarily
// produce tightly packed pixels, and in case of RGBx never. // produce tightly packed pixels, and in case of RGBx never.
use gst::element_error;
use gst::prelude::*;
use anyhow::Error; use anyhow::Error;
use derive_more::{Display, Error}; use derive_more::{Display, Error};
use gst::{element_error, prelude::*};
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;

View file

@ -9,10 +9,10 @@
// {filesrc} - {decodebin} - {queue} - {fakesink} // {filesrc} - {decodebin} - {queue} - {fakesink}
// \- ... // \- ...
use gst::prelude::*;
use std::env; use std::env;
use gst::prelude::*;
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;

View file

@ -17,13 +17,11 @@
// {src} - {typefind} - {demuxer} -| {multiqueue} - {matroskamux} - {filesink} // {src} - {typefind} - {demuxer} -| {multiqueue} - {matroskamux} - {filesink}
// \-[video]-/ // \-[video]-/
use gst::element_error;
use gst::prelude::*;
use std::env; use std::env;
use anyhow::Error; use anyhow::Error;
use derive_more::{Display, Error}; use derive_more::{Display, Error};
use gst::{element_error, prelude::*};
#[path = "../examples-common.rs"] #[path = "../examples-common.rs"]
mod examples_common; mod examples_common;

View file

@ -17,10 +17,10 @@ pub fn run<T, F: FnOnce() -> T + Send + 'static>(main: F) -> T
where where
T: Send + 'static, T: Send + 'static,
{ {
use cocoa::appkit::NSApplication;
use std::thread; use std::thread;
use cocoa::appkit::NSApplication;
unsafe { unsafe {
let app = cocoa::appkit::NSApp(); let app = cocoa::appkit::NSApp();
let t = thread::spawn(|| { let t = thread::spawn(|| {

View file

@ -4,17 +4,12 @@
// {videotestsrc} - { glsinkbin } // {videotestsrc} - { glsinkbin }
use gst::element_error; use std::{ffi::CStr, mem, ptr, sync};
use gst_gl::prelude::*;
use std::ffi::CStr;
use std::mem;
use std::ptr;
use std::sync;
use anyhow::Error; use anyhow::Error;
use derive_more::{Display, Error}; use derive_more::{Display, Error};
use gst::element_error;
use gst_gl::prelude::*;
#[derive(Debug, Display, Error)] #[derive(Debug, Display, Error)]
#[display(fmt = "Received error from {}: {} (debug: {:?})", src, error, debug)] #[display(fmt = "Received error from {}: {} (debug: {:?})", src, error, debug)]
@ -343,10 +338,9 @@ impl App {
let shared_context: gst_gl::GLContext; let shared_context: gst_gl::GLContext;
if cfg!(target_os = "linux") { if cfg!(target_os = "linux") {
use glutin::platform::unix::RawHandle;
#[cfg(any(feature = "gst-gl-x11", feature = "gst-gl-wayland"))] #[cfg(any(feature = "gst-gl-x11", feature = "gst-gl-wayland"))]
use glutin::platform::unix::WindowExtUnix; use glutin::platform::unix::WindowExtUnix;
use glutin::platform::ContextTraitExt; use glutin::platform::{unix::RawHandle, ContextTraitExt};
let api = App::map_gl_api(windowed_context.get_api()); let api = App::map_gl_api(windowed_context.get_api());

View file

@ -1,7 +1,6 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use gst::CapsFeatures; use gst::CapsFeatures;
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
pub static CAPS_FEATURES_MEMORY_DMABUF: Lazy<CapsFeatures> = pub static CAPS_FEATURES_MEMORY_DMABUF: Lazy<CapsFeatures> =

View file

@ -4,7 +4,6 @@ use std::{
}; };
use glib::{translate::*, Cast}; use glib::{translate::*, Cast};
use gst::{Memory, MemoryRef}; use gst::{Memory, MemoryRef};
#[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg(any(feature = "v1_16", feature = "dox"))]

View file

@ -1,7 +1,6 @@
use std::{fmt, os::unix::prelude::RawFd}; use std::{fmt, os::unix::prelude::RawFd};
use glib::{translate::*, Cast}; use glib::{translate::*, Cast};
use gst::{Memory, MemoryRef}; use gst::{Memory, MemoryRef};
use crate::{FdAllocator, FdMemoryFlags}; use crate::{FdAllocator, FdMemoryFlags};

View file

@ -1,7 +1,6 @@
use std::fmt; use std::fmt;
use glib::translate::*; use glib::translate::*;
use gst::{Memory, MemoryRef}; use gst::{Memory, MemoryRef};
gst::memory_object_wrapper!( gst::memory_object_wrapper!(

View file

@ -1,23 +1,21 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use crate::AppSink; use std::{
use glib::ffi::gpointer; mem, panic,
use glib::prelude::*; pin::Pin,
use glib::translate::*; ptr,
use std::mem; sync::{
use std::panic; atomic::{AtomicBool, Ordering},
use std::ptr; Arc, Mutex,
use std::sync::atomic::{AtomicBool, Ordering};
use {
futures_core::Stream,
std::{
pin::Pin,
sync::{Arc, Mutex},
task::{Context, Poll, Waker},
}, },
task::{Context, Poll, Waker},
}; };
use futures_core::Stream;
use glib::{ffi::gpointer, prelude::*, translate::*};
use crate::AppSink;
#[allow(clippy::type_complexity)] #[allow(clippy::type_complexity)]
pub struct AppSinkCallbacks { pub struct AppSinkCallbacks {
eos: Option<Box<dyn FnMut(&AppSink) + Send + 'static>>, eos: Option<Box<dyn FnMut(&AppSink) + Send + 'static>>,
@ -1205,10 +1203,11 @@ impl Stream for AppSinkStream {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*;
use futures_util::StreamExt; use futures_util::StreamExt;
use gst::prelude::*; use gst::prelude::*;
use super::*;
#[test] #[test]
fn test_app_sink_stream() { fn test_app_sink_stream() {
gst::init().unwrap(); gst::init().unwrap();

View file

@ -1,18 +1,24 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use std::{
mem, panic,
pin::Pin,
ptr,
sync::{
atomic::{AtomicBool, Ordering},
Arc, Mutex,
},
task::{Context, Poll, Waker},
};
use futures_sink::Sink; use futures_sink::Sink;
use glib::ffi::{gboolean, gpointer}; use glib::{
use glib::prelude::*; ffi::{gboolean, gpointer},
use glib::translate::*; prelude::*,
translate::*,
};
use crate::AppSrc; use crate::AppSrc;
use std::mem;
use std::panic;
use std::pin::Pin;
use std::ptr;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::{Arc, Mutex};
use std::task::{Context, Poll, Waker};
#[allow(clippy::type_complexity)] #[allow(clippy::type_complexity)]
pub struct AppSrcCallbacks { pub struct AppSrcCallbacks {
@ -678,10 +684,12 @@ impl Sink<gst::Sample> for AppSrcSink {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use std::sync::atomic::{AtomicUsize, Ordering};
use futures_util::{sink::SinkExt, stream::StreamExt}; use futures_util::{sink::SinkExt, stream::StreamExt};
use gst::prelude::*; use gst::prelude::*;
use std::sync::atomic::{AtomicUsize, Ordering};
use super::*;
#[test] #[test]
fn test_app_src_sink() { fn test_app_src_sink() {

View file

@ -1,15 +1,14 @@
use crate::auto::AudioAggregator;
use crate::auto::AudioAggregatorPad;
#[cfg(any(feature = "v1_18", feature = "dox"))]
use glib::object::Cast;
use glib::object::IsA;
#[cfg(any(feature = "v1_18", feature = "dox"))]
use glib::signal::{connect_raw, SignalHandlerId};
use glib::translate::*;
#[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg(any(feature = "v1_18", feature = "dox"))]
use std::mem::transmute; use std::mem::transmute;
#[cfg(any(feature = "v1_18", feature = "dox"))]
use glib::object::Cast;
#[cfg(any(feature = "v1_18", feature = "dox"))]
use glib::signal::{connect_raw, SignalHandlerId};
use glib::{object::IsA, translate::*};
use crate::auto::{AudioAggregator, AudioAggregatorPad};
pub trait AudioAggregatorExtManual: 'static { pub trait AudioAggregatorExtManual: 'static {
#[doc(alias = "gst_audio_aggregator_set_sink_caps")] #[doc(alias = "gst_audio_aggregator_set_sink_caps")]
fn set_sink_caps(&self, pad: &impl IsA<AudioAggregatorPad>, caps: &gst::CapsRef); fn set_sink_caps(&self, pad: &impl IsA<AudioAggregatorPad>, caps: &gst::CapsRef);

View file

@ -1,11 +1,14 @@
use crate::auto::AudioAggregatorConvertPad;
use glib::object::IsA;
use glib::signal::{connect_raw, SignalHandlerId};
use glib::translate::*;
use glib::Cast;
use std::mem::transmute; use std::mem::transmute;
use glib::{
object::IsA,
signal::{connect_raw, SignalHandlerId},
translate::*,
Cast,
};
use crate::auto::AudioAggregatorConvertPad;
pub trait AudioAggregatorConvertPadExtManual: 'static { pub trait AudioAggregatorConvertPadExtManual: 'static {
#[doc(alias = "converter-config")] #[doc(alias = "converter-config")]
fn converter_config(&self) -> Option<crate::AudioConverterConfig>; fn converter_config(&self) -> Option<crate::AudioConverterConfig>;

View file

@ -1,6 +1,6 @@
use glib::{object::IsA, translate::*};
use crate::auto::AudioAggregatorPad; use crate::auto::AudioAggregatorPad;
use glib::object::IsA;
use glib::translate::*;
pub trait AudioAggregatorPadExtManual: 'static { pub trait AudioAggregatorPadExtManual: 'static {
fn audio_info(&self) -> Option<crate::AudioInfo>; fn audio_info(&self) -> Option<crate::AudioInfo>;

View file

@ -1,13 +1,8 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use glib::translate::{from_glib, Borrowed, FromGlibPtrNone, ToGlibPtr}; use std::{fmt, marker::PhantomData, mem, ops, ptr, slice};
use std::fmt; use glib::translate::{from_glib, Borrowed, FromGlibPtrNone, ToGlibPtr};
use std::marker::PhantomData;
use std::mem;
use std::ops;
use std::ptr;
use std::slice;
pub enum Readable {} pub enum Readable {}
pub enum Writable {} pub enum Writable {}

View file

@ -1,11 +1,11 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use crate::AudioChannelPosition;
use std::mem; use std::mem;
use glib::translate::{from_glib, IntoGlib}; use glib::translate::{from_glib, IntoGlib};
use crate::AudioChannelPosition;
impl AudioChannelPosition { impl AudioChannelPosition {
pub fn to_mask(self) -> u64 { pub fn to_mask(self) -> u64 {
let pos = self.into_glib(); let pos = self.into_glib();

View file

@ -1,9 +1,9 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use glib::prelude::*;
use std::ops; use std::ops;
use glib::prelude::*;
#[derive(Debug, Clone, PartialEq, Eq)] #[derive(Debug, Clone, PartialEq, Eq)]
pub struct AudioConverterConfig(gst::Structure); pub struct AudioConverterConfig(gst::Structure);

View file

@ -1,11 +1,10 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use crate::AudioDecoder; use std::{mem, ptr};
use crate::AudioInfo;
use glib::prelude::*; use glib::{prelude::*, translate::*};
use glib::translate::*;
use std::mem; use crate::{AudioDecoder, AudioInfo};
use std::ptr;
extern "C" { extern "C" {
fn _gst_audio_decoder_error( fn _gst_audio_decoder_error(

View file

@ -1,10 +1,10 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use std::{mem, ptr};
use glib::{prelude::*, translate::*};
use crate::AudioEncoder; use crate::AudioEncoder;
use glib::prelude::*;
use glib::translate::*;
use std::mem;
use std::ptr;
pub trait AudioEncoderExtManual: 'static { pub trait AudioEncoderExtManual: 'static {
#[doc(alias = "gst_audio_encoder_finish_frame")] #[doc(alias = "gst_audio_encoder_finish_frame")]

View file

@ -1,10 +1,8 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use std::ffi::CStr; use std::{ffi::CStr, str};
use std::str;
use glib::translate::{from_glib, IntoGlib}; use glib::translate::{from_glib, IntoGlib};
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
#[cfg(feature = "v1_18")] #[cfg(feature = "v1_18")]

View file

@ -1,13 +1,11 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use std::cmp::Ordering; use std::{cmp::Ordering, ffi::CStr, fmt, marker::PhantomData, str};
use std::ffi::CStr;
use std::fmt;
use std::marker::PhantomData;
use std::str;
use glib::translate::{from_glib, from_glib_none, FromGlib, IntoGlib, ToGlibPtr, ToGlibPtrMut}; use glib::{
use glib::StaticType; translate::{from_glib, from_glib_none, FromGlib, IntoGlib, ToGlibPtr, ToGlibPtrMut},
StaticType,
};
#[derive(PartialEq, Eq, Copy, Clone, Debug, Hash)] #[derive(PartialEq, Eq, Copy, Clone, Debug, Hash)]
pub enum AudioEndianness { pub enum AudioEndianness {

View file

@ -1,15 +1,12 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use std::{fmt, marker::PhantomData, mem, ptr};
use glib::translate::{ use glib::translate::{
from_glib, from_glib_full, from_glib_none, IntoGlib, ToGlibPtr, ToGlibPtrMut, from_glib, from_glib_full, from_glib_none, IntoGlib, ToGlibPtr, ToGlibPtrMut,
}; };
use gst::prelude::*; use gst::prelude::*;
use std::fmt;
use std::marker::PhantomData;
use std::mem;
use std::ptr;
#[doc(alias = "GstAudioInfo")] #[doc(alias = "GstAudioInfo")]
pub struct AudioInfo(ffi::GstAudioInfo, [crate::AudioChannelPosition; 64]); pub struct AudioInfo(ffi::GstAudioInfo, [crate::AudioChannelPosition; 64]);

View file

@ -1,13 +1,11 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use crate::ffi::GstAudioRingBufferSpec; use std::fmt;
use glib::translate::*; use glib::translate::*;
use gst::Caps; use gst::Caps;
use crate::AudioInfo; use crate::{ffi::GstAudioRingBufferSpec, AudioInfo, AudioRingBufferFormatType};
use crate::AudioRingBufferFormatType;
use std::fmt;
#[repr(transparent)] #[repr(transparent)]
pub struct AudioRingBufferSpec(pub(crate) GstAudioRingBufferSpec); pub struct AudioRingBufferSpec(pub(crate) GstAudioRingBufferSpec);

View file

@ -1,9 +1,10 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use crate::AudioStreamAlign; use std::mem;
use glib::translate::*; use glib::translate::*;
use std::mem;
use crate::AudioStreamAlign;
impl AudioStreamAlign { impl AudioStreamAlign {
#[doc(alias = "gst_audio_stream_align_process")] #[doc(alias = "gst_audio_stream_align_process")]

View file

@ -1,7 +1,8 @@
use crate::{AudioFormat, AudioLayout}; use std::ops::{Bound::*, RangeBounds};
use gst::Caps; use gst::Caps;
use std::ops::Bound::*;
use std::ops::RangeBounds; use crate::{AudioFormat, AudioLayout};
pub struct AudioCapsBuilder<T> { pub struct AudioCapsBuilder<T> {
builder: gst::caps::Builder<T>, builder: gst::caps::Builder<T>,

View file

@ -1,7 +1,9 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use glib::translate::{from_glib, ToGlibPtr}; use glib::{
use glib::{FlagsClass, StaticType, ToValue}; translate::{from_glib, ToGlibPtr},
FlagsClass, StaticType, ToValue,
};
use gst::bitflags_serde_impl; use gst::bitflags_serde_impl;
bitflags_serde_impl!(crate::AudioFlags); bitflags_serde_impl!(crate::AudioFlags);

View file

@ -1,9 +1,9 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use glib::translate::{from_glib_full, IntoGlibPtr, ToGlibPtr};
use std::i32; use std::i32;
use glib::translate::{from_glib_full, IntoGlibPtr, ToGlibPtr};
#[doc(alias = "gst_audio_buffer_clip")] #[doc(alias = "gst_audio_buffer_clip")]
pub fn audio_buffer_clip( pub fn audio_buffer_clip(
buffer: gst::Buffer, buffer: gst::Buffer,

View file

@ -81,14 +81,13 @@ pub mod prelude {
#[doc(hidden)] #[doc(hidden)]
pub use gst_base::prelude::*; pub use gst_base::prelude::*;
pub use super::audio_decoder::AudioDecoderExtManual; pub use super::{audio_decoder::AudioDecoderExtManual, audio_encoder::AudioEncoderExtManual};
pub use super::audio_encoder::AudioEncoderExtManual; pub use crate::{
pub use crate::audio_aggregator::AudioAggregatorExtManual; audio_aggregator::AudioAggregatorExtManual,
pub use crate::audio_aggregator_convert_pad::AudioAggregatorConvertPadExtManual; audio_aggregator_convert_pad::AudioAggregatorConvertPadExtManual,
pub use crate::audio_aggregator_pad::AudioAggregatorPadExtManual; audio_aggregator_pad::AudioAggregatorPadExtManual, audio_format::AudioFormatIteratorExt,
pub use crate::audio_format::AudioFormatIteratorExt; auto::traits::*,
};
pub use crate::auto::traits::*;
} }
pub mod subclass; pub mod subclass;

View file

@ -1,14 +1,11 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use glib::translate::*;
use gst_base::prelude::*;
use gst_base::subclass::prelude::*;
use std::ptr; use std::ptr;
use crate::AudioAggregator; use glib::translate::*;
use crate::AudioAggregatorPad; use gst_base::{prelude::*, subclass::prelude::*};
use crate::{AudioAggregator, AudioAggregatorPad};
pub trait AudioAggregatorImpl: AudioAggregatorImplExt + AggregatorImpl { pub trait AudioAggregatorImpl: AudioAggregatorImplExt + AggregatorImpl {
fn create_output_buffer(&self, num_frames: u32) -> Option<gst::Buffer> { fn create_output_buffer(&self, num_frames: u32) -> Option<gst::Buffer> {

View file

@ -1,12 +1,10 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use glib::translate::*;
use gst_base::prelude::*;
use gst_base::subclass::prelude::*;
use std::ptr; use std::ptr;
use glib::translate::*;
use gst_base::{prelude::*, subclass::prelude::*};
use crate::AudioAggregatorPad; use crate::AudioAggregatorPad;
pub trait AudioAggregatorPadImpl: AudioAggregatorPadImplExt + AggregatorPadImpl { pub trait AudioAggregatorPadImpl: AudioAggregatorPadImplExt + AggregatorPadImpl {

View file

@ -1,15 +1,11 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use glib::translate::*; use std::{mem, ptr};
use glib::translate::*;
use gst::subclass::prelude::*; use gst::subclass::prelude::*;
use std::mem; use crate::{prelude::*, AudioDecoder};
use std::ptr;
use crate::prelude::*;
use crate::AudioDecoder;
pub trait AudioDecoderImpl: AudioDecoderImplExt + ElementImpl { pub trait AudioDecoderImpl: AudioDecoderImplExt + ElementImpl {
fn open(&self) -> Result<(), gst::ErrorMessage> { fn open(&self) -> Result<(), gst::ErrorMessage> {

View file

@ -1,15 +1,11 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use glib::translate::*;
use gst::subclass::prelude::*;
use std::ptr; use std::ptr;
use crate::prelude::*; use glib::translate::*;
use gst::subclass::prelude::*;
use crate::AudioEncoder; use crate::{prelude::*, AudioEncoder, AudioInfo};
use crate::AudioInfo;
pub trait AudioEncoderImpl: AudioEncoderImplExt + ElementImpl { pub trait AudioEncoderImpl: AudioEncoderImplExt + ElementImpl {
fn open(&self) -> Result<(), gst::ErrorMessage> { fn open(&self) -> Result<(), gst::ErrorMessage> {

View file

@ -1,12 +1,9 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use glib::translate::*; use glib::translate::*;
use gst_base::{prelude::*, subclass::prelude::*};
use gst_base::prelude::*; use crate::{AudioFilter, AudioInfo};
use gst_base::subclass::prelude::*;
use crate::AudioFilter;
use crate::AudioInfo;
pub trait AudioFilterImpl: AudioFilterImplExt + BaseTransformImpl { pub trait AudioFilterImpl: AudioFilterImplExt + BaseTransformImpl {
fn allowed_caps() -> &'static gst::Caps; fn allowed_caps() -> &'static gst::Caps;

View file

@ -1,14 +1,11 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use glib::prelude::*; use glib::{prelude::*, translate::*};
use glib::translate::*;
use super::prelude::*;
use gst::LoggableError; use gst::LoggableError;
use gst_base::subclass::prelude::*; use gst_base::subclass::prelude::*;
use crate::AudioRingBufferSpec; use super::prelude::*;
use crate::AudioSink; use crate::{AudioRingBufferSpec, AudioSink};
pub trait AudioSinkImpl: AudioSinkImplExt + AudioBaseSinkImpl { pub trait AudioSinkImpl: AudioSinkImplExt + AudioBaseSinkImpl {
fn close(&self) -> Result<(), LoggableError> { fn close(&self) -> Result<(), LoggableError> {

View file

@ -2,15 +2,12 @@
use std::mem; use std::mem;
use glib::prelude::*; use glib::{prelude::*, translate::*};
use glib::translate::*;
use super::prelude::*;
use gst::LoggableError; use gst::LoggableError;
use gst_base::subclass::prelude::*; use gst_base::subclass::prelude::*;
use crate::AudioRingBufferSpec; use super::prelude::*;
use crate::AudioSrc; use crate::{AudioRingBufferSpec, AudioSrc};
pub trait AudioSrcImpl: AudioSrcImplExt + AudioBaseSrcImpl { pub trait AudioSrcImpl: AudioSrcImplExt + AudioBaseSrcImpl {
fn close(&self) -> Result<(), LoggableError> { fn close(&self) -> Result<(), LoggableError> {

View file

@ -17,14 +17,16 @@ pub mod prelude {
#[doc(hidden)] #[doc(hidden)]
pub use gst_base::subclass::prelude::*; pub use gst_base::subclass::prelude::*;
pub use super::audio_aggregator::{AudioAggregatorImpl, AudioAggregatorImplExt}; pub use super::{
pub use super::audio_aggregator_convert_pad::AudioAggregatorConvertPadImpl; audio_aggregator::{AudioAggregatorImpl, AudioAggregatorImplExt},
pub use super::audio_aggregator_pad::{AudioAggregatorPadImpl, AudioAggregatorPadImplExt}; audio_aggregator_convert_pad::AudioAggregatorConvertPadImpl,
pub use super::audio_base_sink::AudioBaseSinkImpl; audio_aggregator_pad::{AudioAggregatorPadImpl, AudioAggregatorPadImplExt},
pub use super::audio_base_src::AudioBaseSrcImpl; audio_base_sink::AudioBaseSinkImpl,
pub use super::audio_decoder::{AudioDecoderImpl, AudioDecoderImplExt}; audio_base_src::AudioBaseSrcImpl,
pub use super::audio_encoder::{AudioEncoderImpl, AudioEncoderImplExt}; audio_decoder::{AudioDecoderImpl, AudioDecoderImplExt},
pub use super::audio_filter::{AudioFilterImpl, AudioFilterImplExt}; audio_encoder::{AudioEncoderImpl, AudioEncoderImplExt},
pub use super::audio_sink::{AudioSinkImpl, AudioSinkImplExt}; audio_filter::{AudioFilterImpl, AudioFilterImplExt},
pub use super::audio_src::{AudioSrcImpl, AudioSrcImplExt}; audio_sink::{AudioSinkImpl, AudioSinkImplExt},
audio_src::{AudioSrcImpl, AudioSrcImplExt},
};
} }

View file

@ -1,10 +1,10 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use crate::Adapter; use std::{io, mem, ops};
use glib::translate::*; use glib::translate::*;
use std::io;
use std::mem; use crate::Adapter;
use std::ops;
impl Adapter { impl Adapter {
#[doc(alias = "gst_adapter_copy")] #[doc(alias = "gst_adapter_copy")]

View file

@ -1,20 +1,20 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use crate::Aggregator;
use glib::prelude::*;
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
use glib::signal::{connect_raw, SignalHandlerId};
use glib::translate::*;
use gst::format::FormattedValue;
#[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
use std::boxed::Box as Box_; use std::boxed::Box as Box_;
use std::mem;
#[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
use std::mem::transmute; use std::mem::transmute;
use std::ptr; use std::{mem, ptr};
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
use glib::signal::{connect_raw, SignalHandlerId};
use glib::{prelude::*, translate::*};
use gst::format::FormattedValue;
use crate::Aggregator;
pub trait AggregatorExtManual: 'static { pub trait AggregatorExtManual: 'static {
#[doc(alias = "get_allocator")] #[doc(alias = "get_allocator")]

View file

@ -1,8 +1,8 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use glib::{prelude::*, translate::*};
use crate::AggregatorPad; use crate::AggregatorPad;
use glib::prelude::*;
use glib::translate::*;
pub trait AggregatorPadExtManual: 'static { pub trait AggregatorPadExtManual: 'static {
#[doc(alias = "get_segment")] #[doc(alias = "get_segment")]

View file

@ -1,12 +1,12 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use crate::BaseParse;
use crate::BaseParseFrame;
use glib::prelude::*;
use glib::translate::*;
use gst::format::{FormattedValue, SpecificFormattedValueFullRange};
use std::mem; use std::mem;
use glib::{prelude::*, translate::*};
use gst::format::{FormattedValue, SpecificFormattedValueFullRange};
use crate::{BaseParse, BaseParseFrame};
pub trait BaseParseExtManual: 'static { pub trait BaseParseExtManual: 'static {
#[doc(alias = "get_sink_pad")] #[doc(alias = "get_sink_pad")]
fn sink_pad(&self) -> &gst::Pad; fn sink_pad(&self) -> &gst::Pad;

View file

@ -1,12 +1,10 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use glib::translate::*; use std::{fmt, marker::PhantomData, ptr};
use std::fmt;
use std::marker::PhantomData;
use std::ptr;
use crate::BaseParse; use glib::translate::*;
use crate::BaseParseFrameFlags;
use crate::{BaseParse, BaseParseFrameFlags};
pub struct BaseParseFrame<'a>( pub struct BaseParseFrame<'a>(
ptr::NonNull<ffi::GstBaseParseFrame>, ptr::NonNull<ffi::GstBaseParseFrame>,

View file

@ -1,10 +1,11 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use crate::BaseSink;
use glib::prelude::*;
use glib::translate::*;
use std::mem; use std::mem;
use glib::{prelude::*, translate::*};
use crate::BaseSink;
pub trait BaseSinkExtManual: 'static { pub trait BaseSinkExtManual: 'static {
#[doc(alias = "get_segment")] #[doc(alias = "get_segment")]
fn segment(&self) -> gst::Segment; fn segment(&self) -> gst::Segment;

View file

@ -1,9 +1,8 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use glib::prelude::*; use std::{mem, ptr};
use glib::translate::*;
use std::mem; use glib::{prelude::*, translate::*};
use std::ptr;
use crate::BaseSrc; use crate::BaseSrc;

View file

@ -1,10 +1,10 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use std::{mem, ptr};
use glib::{prelude::*, translate::*};
use crate::BaseTransform; use crate::BaseTransform;
use glib::prelude::*;
use glib::translate::*;
use std::mem;
use std::ptr;
pub trait BaseTransformExtManual: 'static { pub trait BaseTransformExtManual: 'static {
#[doc(alias = "get_allocator")] #[doc(alias = "get_allocator")]

View file

@ -1,7 +1,6 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use glib::prelude::*; use glib::{prelude::*, translate::*};
use glib::translate::*;
glib::wrapper! { glib::wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]

View file

@ -1,9 +1,9 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use glib::prelude::*;
use glib::translate::*;
use std::mem; use std::mem;
use glib::{prelude::*, translate::*};
#[doc(alias = "gst_type_find_helper_for_data")] #[doc(alias = "gst_type_find_helper_for_data")]
pub fn type_find_helper_for_data( pub fn type_find_helper_for_data(
obj: Option<&impl IsA<gst::Object>>, obj: Option<&impl IsA<gst::Object>>,

View file

@ -33,8 +33,7 @@ macro_rules! skip_assert_initialized {
#[allow(clippy::use_self)] #[allow(clippy::use_self)]
#[allow(unused_imports)] #[allow(unused_imports)]
mod auto; mod auto;
pub use crate::auto::functions::*; pub use crate::auto::{functions::*, *};
pub use crate::auto::*;
pub mod functions; pub mod functions;
pub use crate::functions::*; pub use crate::functions::*;
@ -63,13 +62,11 @@ pub mod prelude {
#[doc(hidden)] #[doc(hidden)]
pub use gst::prelude::*; pub use gst::prelude::*;
pub use crate::aggregator::AggregatorExtManual; pub use crate::{
pub use crate::aggregator_pad::AggregatorPadExtManual; aggregator::AggregatorExtManual, aggregator_pad::AggregatorPadExtManual, auto::traits::*,
pub use crate::auto::traits::*; base_parse::BaseParseExtManual, base_sink::BaseSinkExtManual, base_src::BaseSrcExtManual,
pub use crate::base_parse::BaseParseExtManual; base_transform::BaseTransformExtManual,
pub use crate::base_sink::BaseSinkExtManual; };
pub use crate::base_src::BaseSrcExtManual;
pub use crate::base_transform::BaseTransformExtManual;
} }
mod utils; mod utils;

View file

@ -1,14 +1,11 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use glib::prelude::*;
use glib::translate::*;
use gst::subclass::prelude::*;
use std::ptr; use std::ptr;
use crate::Aggregator; use glib::{prelude::*, translate::*};
use crate::AggregatorPad; use gst::subclass::prelude::*;
use crate::{Aggregator, AggregatorPad};
pub trait AggregatorImpl: AggregatorImplExt + ElementImpl { pub trait AggregatorImpl: AggregatorImplExt + ElementImpl {
fn flush(&self) -> Result<gst::FlowSuccess, gst::FlowError> { fn flush(&self) -> Result<gst::FlowSuccess, gst::FlowError> {

View file

@ -1,12 +1,9 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use glib::prelude::*; use glib::{prelude::*, translate::*};
use glib::translate::*;
use gst::subclass::prelude::*; use gst::subclass::prelude::*;
use crate::Aggregator; use crate::{Aggregator, AggregatorPad};
use crate::AggregatorPad;
pub trait AggregatorPadImpl: AggregatorPadImplExt + PadImpl { pub trait AggregatorPadImpl: AggregatorPadImplExt + PadImpl {
fn flush(&self, aggregator: &Aggregator) -> Result<gst::FlowSuccess, gst::FlowError> { fn flush(&self, aggregator: &Aggregator) -> Result<gst::FlowSuccess, gst::FlowError> {

View file

@ -2,13 +2,10 @@
use std::mem; use std::mem;
use crate::prelude::*;
use glib::translate::*; use glib::translate::*;
use gst::subclass::prelude::*; use gst::subclass::prelude::*;
use crate::BaseParse; use crate::{prelude::*, BaseParse, BaseParseFrame};
use crate::BaseParseFrame;
pub trait BaseParseImpl: BaseParseImplExt + ElementImpl { pub trait BaseParseImpl: BaseParseImplExt + ElementImpl {
fn start(&self) -> Result<(), gst::ErrorMessage> { fn start(&self) -> Result<(), gst::ErrorMessage> {

View file

@ -1,12 +1,10 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use glib::prelude::*;
use glib::translate::*;
use gst::subclass::prelude::*;
use std::ptr; use std::ptr;
use glib::{prelude::*, translate::*};
use gst::subclass::prelude::*;
use crate::BaseSink; use crate::BaseSink;
pub trait BaseSinkImpl: BaseSinkImplExt + ElementImpl { pub trait BaseSinkImpl: BaseSinkImplExt + ElementImpl {

View file

@ -1,18 +1,12 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use glib::prelude::*; use std::{mem, ptr};
use glib::translate::*;
use gst::prelude::*;
use gst::subclass::prelude::*;
use std::mem;
use std::ptr;
use atomic_refcell::AtomicRefCell; use atomic_refcell::AtomicRefCell;
use glib::{prelude::*, translate::*};
use gst::{prelude::*, subclass::prelude::*};
use crate::prelude::BaseSrcExtManual; use crate::{prelude::BaseSrcExtManual, BaseSrc};
use crate::BaseSrc;
#[derive(Default)] #[derive(Default)]
pub(super) struct InstanceData { pub(super) struct InstanceData {

View file

@ -1,15 +1,11 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use crate::prelude::*; use std::{mem, ptr};
use glib::translate::*; use glib::translate::*;
use gst::subclass::prelude::*; use gst::subclass::prelude::*;
use std::mem; use crate::{prelude::*, BaseTransform};
use std::ptr;
use crate::BaseTransform;
#[derive(Copy, Clone, Debug, PartialEq, Eq)] #[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum BaseTransformMode { pub enum BaseTransformMode {

View file

@ -19,11 +19,13 @@ pub mod prelude {
#[doc(hidden)] #[doc(hidden)]
pub use gst::subclass::prelude::*; pub use gst::subclass::prelude::*;
pub use super::aggregator::{AggregatorImpl, AggregatorImplExt}; pub use super::{
pub use super::aggregator_pad::{AggregatorPadImpl, AggregatorPadImplExt}; aggregator::{AggregatorImpl, AggregatorImplExt},
pub use super::base_parse::{BaseParseImpl, BaseParseImplExt}; aggregator_pad::{AggregatorPadImpl, AggregatorPadImplExt},
pub use super::base_sink::{BaseSinkImpl, BaseSinkImplExt}; base_parse::{BaseParseImpl, BaseParseImplExt},
pub use super::base_src::{BaseSrcImpl, BaseSrcImplExt}; base_sink::{BaseSinkImpl, BaseSinkImplExt},
pub use super::base_transform::{BaseTransformImpl, BaseTransformImplExt}; base_src::{BaseSrcImpl, BaseSrcImplExt},
pub use super::push_src::{PushSrcImpl, PushSrcImplExt}; base_transform::{BaseTransformImpl, BaseTransformImplExt},
push_src::{PushSrcImpl, PushSrcImplExt},
};
} }

View file

@ -1,15 +1,12 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use glib::prelude::*;
use glib::subclass::prelude::*;
use glib::translate::*;
use gst::prelude::*;
use std::ptr; use std::ptr;
use glib::{prelude::*, subclass::prelude::*, translate::*};
use gst::prelude::*;
use super::base_src::{BaseSrcImpl, CreateSuccess}; use super::base_src::{BaseSrcImpl, CreateSuccess};
use crate::prelude::BaseSrcExtManual; use crate::{prelude::BaseSrcExtManual, PushSrc};
use crate::PushSrc;
pub trait PushSrcImpl: PushSrcImplExt + BaseSrcImpl { pub trait PushSrcImpl: PushSrcImplExt + BaseSrcImpl {
fn fill(&self, buffer: &mut gst::BufferRef) -> Result<gst::FlowSuccess, gst::FlowError> { fn fill(&self, buffer: &mut gst::BufferRef) -> Result<gst::FlowSuccess, gst::FlowError> {

View file

@ -1,13 +1,11 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use crate::TestClock; use std::{marker::PhantomData, mem, ops, path, ptr};
use glib::translate::*; use glib::translate::*;
use gst::prelude::*; use gst::prelude::*;
use std::marker::PhantomData;
use std::mem; use crate::TestClock;
use std::ops;
use std::path;
use std::ptr;
#[derive(Debug)] #[derive(Debug)]
#[doc(alias = "GstHarness")] #[doc(alias = "GstHarness")]

View file

@ -1,9 +1,11 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use crate::TestClock;
use glib::translate::*;
use std::ptr; use std::ptr;
use glib::translate::*;
use crate::TestClock;
impl TestClock { impl TestClock {
#[doc(alias = "gst_test_clock_has_id")] #[doc(alias = "gst_test_clock_has_id")]
pub fn has_id(&self, id: &gst::ClockId) -> bool { pub fn has_id(&self, id: &gst::ClockId) -> bool {

View file

@ -1,7 +1,9 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use glib::translate::{from_glib, ToGlibPtr}; use glib::{
use glib::{FlagsClass, StaticType, ToValue}; translate::{from_glib, ToGlibPtr},
FlagsClass, StaticType, ToValue,
};
use gst::bitflags_serde_impl; use gst::bitflags_serde_impl;
bitflags_serde_impl!(crate::MarkerFlags, "v1_20"); bitflags_serde_impl!(crate::MarkerFlags, "v1_20");

View file

@ -5,17 +5,16 @@
#![allow(clippy::non_send_fields_in_send_ty)] #![allow(clippy::non_send_fields_in_send_ty)]
#![doc = include_str!("../README.md")] #![doc = include_str!("../README.md")]
use std::sync::Once;
pub use ffi; pub use ffi;
pub use gio; pub use gio;
pub use glib; pub use glib;
use glib::translate::from_glib;
pub use gst; pub use gst;
pub use gst_base; pub use gst_base;
pub use gst_pbutils; pub use gst_pbutils;
use std::sync::Once;
use glib::translate::from_glib;
static GES_INIT: Once = Once::new(); static GES_INIT: Once = Once::new();
#[doc(alias = "ges_init")] #[doc(alias = "ges_init")]

View file

@ -6,12 +6,12 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
use crate::GLDisplayEGL; use glib::{ffi::gpointer, translate::*};
use glib::ffi::gpointer;
use glib::translate::*;
use gst_gl::GLDisplayType; use gst_gl::GLDisplayType;
use libc::uintptr_t; use libc::uintptr_t;
use crate::GLDisplayEGL;
impl GLDisplayEGL { impl GLDisplayEGL {
pub unsafe fn with_egl_display( pub unsafe fn with_egl_display(
display: uintptr_t, display: uintptr_t,

View file

@ -1,7 +1,6 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use gst::CapsFeatures; use gst::CapsFeatures;
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
pub static CAPS_FEATURES_MEMORY_GL_MEMORY: Lazy<CapsFeatures> = pub static CAPS_FEATURES_MEMORY_GL_MEMORY: Lazy<CapsFeatures> =

View file

@ -1,11 +1,12 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use crate::GLDisplay;
use glib::prelude::*;
use glib::translate::*;
use gst::ContextRef;
use std::ptr; use std::ptr;
use glib::{prelude::*, translate::*};
use gst::ContextRef;
use crate::GLDisplay;
pub trait ContextGLExt { pub trait ContextGLExt {
#[doc(alias = "get_gl_display")] #[doc(alias = "get_gl_display")]
#[doc(alias = "gst_context_get_gl_display")] #[doc(alias = "gst_context_get_gl_display")]

View file

@ -1,7 +1,9 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use glib::translate::{from_glib, ToGlibPtr}; use glib::{
use glib::{FlagsClass, StaticType, ToValue}; translate::{from_glib, ToGlibPtr},
FlagsClass, StaticType, ToValue,
};
use gst::bitflags_serde_impl; use gst::bitflags_serde_impl;
bitflags_serde_impl!(crate::GLAPI); bitflags_serde_impl!(crate::GLAPI);

View file

@ -1,9 +1,9 @@
use crate::GLContext;
use crate::GLDisplay;
use glib::object::IsA;
use glib::translate::*;
use std::ptr; use std::ptr;
use glib::{object::IsA, translate::*};
use crate::{GLContext, GLDisplay};
#[doc(alias = "gst_gl_handle_context_query")] #[doc(alias = "gst_gl_handle_context_query")]
pub fn gl_handle_context_query( pub fn gl_handle_context_query(
element: &impl IsA<gst::Element>, element: &impl IsA<gst::Element>,

View file

@ -1,12 +1,8 @@
use glib::prelude::*;
use glib::translate::*;
use gst::Memory;
use crate::GLAllocationParams;
use crate::GLBaseMemoryAllocator;
use ffi::GstGLBaseMemory; use ffi::GstGLBaseMemory;
use gst::MemoryRef; use glib::{prelude::*, translate::*};
use gst::{Memory, MemoryRef};
use crate::{GLAllocationParams, GLBaseMemoryAllocator};
gst::memory_object_wrapper!( gst::memory_object_wrapper!(
GLBaseMemory, GLBaseMemory,

View file

@ -1,13 +1,10 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use crate::GLContext; use glib::{prelude::*, translate::*};
use crate::GLDisplay;
use crate::GLPlatform;
use crate::GLAPI;
use glib::prelude::*;
use glib::translate::*;
use libc::uintptr_t; use libc::uintptr_t;
use crate::{GLContext, GLDisplay, GLPlatform, GLAPI};
impl GLContext { impl GLContext {
pub unsafe fn new_wrapped<T: IsA<GLDisplay>>( pub unsafe fn new_wrapped<T: IsA<GLDisplay>>(
display: &T, display: &T,

View file

@ -1,13 +1,8 @@
use glib::translate::*;
use crate::GLBaseMemory;
use crate::GLBaseMemoryRef;
use crate::GLFormat;
use crate::GLTextureTarget;
use ffi::GstGLMemory; use ffi::GstGLMemory;
use gst::{result_from_gboolean, LoggableError, CAT_RUST}; use glib::translate::*;
use gst::{Memory, MemoryRef}; use gst::{result_from_gboolean, LoggableError, Memory, MemoryRef, CAT_RUST};
use crate::{GLBaseMemory, GLBaseMemoryRef, GLFormat, GLTextureTarget};
gst::memory_object_wrapper!( gst::memory_object_wrapper!(
GLMemory, GLMemory,

View file

@ -1,9 +1,8 @@
use ffi::GstGLMemoryPBO; use ffi::GstGLMemoryPBO;
use glib::translate::*; use glib::translate::*;
use gst::{Memory, MemoryRef};
use crate::{GLBaseMemory, GLBaseMemoryRef, GLMemory, GLMemoryRef}; use crate::{GLBaseMemory, GLBaseMemoryRef, GLMemory, GLMemoryRef};
use gst::{Memory, MemoryRef};
gst::memory_object_wrapper!( gst::memory_object_wrapper!(
GLMemoryPBO, GLMemoryPBO,

View file

@ -1,10 +1,10 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use std::mem;
use glib::translate::{from_glib, ToGlibPtr}; use glib::translate::{from_glib, ToGlibPtr};
use gst_video::video_frame::Readable; use gst_video::video_frame::Readable;
use std::mem;
pub trait VideoFrameGLExt { pub trait VideoFrameGLExt {
fn from_buffer_readable_gl( fn from_buffer_readable_gl(
buffer: gst::Buffer, buffer: gst::Buffer,

Some files were not shown because too many files have changed in this diff Show more