refactor: move PlayFlags defaults into Playbin3 and clean up unused prelude imports
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
use crate::{playback::Playbin3, priv_prelude::*};
|
||||
use gstreamer::State;
|
||||
use crate::priv_prelude::*;
|
||||
|
||||
wrap_gst!(Pipeline);
|
||||
parent_child!(Element, Pipeline);
|
||||
|
||||
@@ -16,7 +16,6 @@ impl AppSink {
|
||||
}
|
||||
|
||||
pub fn new(name: impl AsRef<str>) -> Result<Self> {
|
||||
use gstreamer::prelude::*;
|
||||
let inner = gstreamer::ElementFactory::make("appsink")
|
||||
.name(name.as_ref())
|
||||
.build()
|
||||
@@ -133,7 +132,7 @@ fn test_appsink() {
|
||||
.build(),
|
||||
);
|
||||
|
||||
let mut video_sink = video_convert
|
||||
let video_sink = video_convert
|
||||
.link(&appsink)
|
||||
.expect("Link videoconvert to appsink");
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ impl Sink for AutoVideoSink {}
|
||||
|
||||
impl AutoVideoSink {
|
||||
pub fn new(name: impl AsRef<str>) -> Result<Self> {
|
||||
use gstreamer::prelude::*;
|
||||
let element = gstreamer::ElementFactory::make("autovideosink")
|
||||
.name(name.as_ref())
|
||||
.build()
|
||||
|
||||
@@ -36,19 +36,6 @@ bitflags::bitflags! {
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for PlayFlags {
|
||||
/// Flags "GstPlayFlags" Default: 0x00000717, "soft-colorbalance+deinterlace+buffering+soft-volume+text+audio+video"
|
||||
fn default() -> Self {
|
||||
Self::SOFT_COLORBALANCE
|
||||
| Self::DEINTERLACE
|
||||
| Self::BUFFERING
|
||||
| Self::SOFT_VOLUME
|
||||
| Self::TEXT
|
||||
| Self::AUDIO
|
||||
| Self::VIDEO
|
||||
}
|
||||
}
|
||||
|
||||
const _: () = {
|
||||
use glib::types::StaticType;
|
||||
impl glib::types::StaticType for PlayFlags {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
use crate::priv_prelude::*;
|
||||
use playback::PlayFlags;
|
||||
|
||||
wrap_gst!(Playbin3, gstreamer::Element);
|
||||
parent_child!(Element, Playbin3);
|
||||
@@ -80,3 +81,15 @@ impl Playbin3 {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl Playbin3 {
|
||||
pub fn default_flags() -> PlayFlags {
|
||||
PlayFlags::SOFT_COLORBALANCE
|
||||
| PlayFlags::DEINTERLACE
|
||||
| PlayFlags::BUFFERING
|
||||
| PlayFlags::SOFT_VOLUME
|
||||
| PlayFlags::TEXT
|
||||
| PlayFlags::AUDIO
|
||||
| PlayFlags::VIDEO
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ impl Source for VideoConvert {}
|
||||
|
||||
impl VideoConvert {
|
||||
pub fn new(name: impl AsRef<str>) -> Result<Self> {
|
||||
use gstreamer::prelude::*;
|
||||
let element = gstreamer::ElementFactory::make("videoconvert")
|
||||
.name(name.as_ref())
|
||||
.build()
|
||||
|
||||
Reference in New Issue
Block a user