mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-01-09 18:55:27 +00:00
gtk4: Only provide a buffer pool to upstream if it requested one
This commit is contained in:
parent
c83f48f0a1
commit
711313c4c5
1 changed files with 8 additions and 6 deletions
|
@ -350,10 +350,8 @@ impl BaseSinkImpl for PaintableSink {
|
||||||
.map_err(|_| gst::loggable_error!(CAT, "Failed to get VideoInfo from caps"))?;
|
.map_err(|_| gst::loggable_error!(CAT, "Failed to get VideoInfo from caps"))?;
|
||||||
|
|
||||||
let size = info.size() as u32;
|
let size = info.size() as u32;
|
||||||
|
let buffer_pool = if need_pool {
|
||||||
let buffer_pool = gst_gl::GLBufferPool::new(&gst_context);
|
let buffer_pool = gst_gl::GLBufferPool::new(&gst_context);
|
||||||
|
|
||||||
if need_pool {
|
|
||||||
gst::debug!(CAT, imp: self, "Creating new Pool");
|
gst::debug!(CAT, imp: self, "Creating new Pool");
|
||||||
|
|
||||||
let mut config = buffer_pool.config();
|
let mut config = buffer_pool.config();
|
||||||
|
@ -366,10 +364,14 @@ impl BaseSinkImpl for PaintableSink {
|
||||||
format!("Failed to set config in the GL BufferPool.: {}", err)
|
format!("Failed to set config in the GL BufferPool.: {}", err)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
Some(buffer_pool)
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
};
|
||||||
|
|
||||||
// we need at least 2 buffer because we hold on to the last one
|
// we need at least 2 buffer because we hold on to the last one
|
||||||
query.add_allocation_pool(Some(&buffer_pool), size, 2, 0);
|
query.add_allocation_pool(buffer_pool.as_ref(), size, 2, 0);
|
||||||
|
|
||||||
if gst_context.check_feature("GL_ARB_sync")
|
if gst_context.check_feature("GL_ARB_sync")
|
||||||
|| gst_context.check_feature("GL_EXT_EGL_sync")
|
|| gst_context.check_feature("GL_EXT_EGL_sync")
|
||||||
|
|
Loading…
Reference in a new issue