fix(video): try to optimize memory leaks
This commit is contained in:
@@ -40,6 +40,11 @@ impl AppSink {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_drop(self, drop: bool) -> Self {
|
||||
self.inner.set_property("drop", drop);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_caps(self, caps: Caps) -> Self {
|
||||
self.inner.set_property("caps", caps.inner);
|
||||
self
|
||||
|
||||
@@ -25,6 +25,24 @@ impl Playbin3 {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_buffer_duration(self, duration: impl Into<Option<core::time::Duration>>) -> Self {
|
||||
let duration = match duration.into() {
|
||||
Some(dur) => dur.as_secs() as i64,
|
||||
None => -1,
|
||||
};
|
||||
self.inner.set_property("buffer-duration", duration);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_buffer_size(self, size: impl Into<Option<u32>>) -> Self {
|
||||
let size = match size.into() {
|
||||
Some(size) => size as i32,
|
||||
None => -1,
|
||||
};
|
||||
self.inner.set_property("buffer-size", size);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_video_sink(self, video_sink: &impl ChildOf<Element>) -> Self {
|
||||
self.inner
|
||||
.set_property("video-sink", &video_sink.upcast_ref().inner);
|
||||
|
||||
Reference in New Issue
Block a user