Commit a049d9fa authored by Philippe Normand's avatar Philippe Normand 🦀 Committed by GStreamer Merge Bot

cdgdec: decide_allocation fixes

Check the pool configuration result and potentially error out before chaining to
the parent class.

Fixes #80
parent e5244fc3
Pipeline #77703 passed with stages
in 33 minutes and 12 seconds
......@@ -194,20 +194,22 @@ impl VideoDecoderImpl for CdgDec {
element: &gst_video::VideoDecoder,
query: &mut gst::QueryRef,
) -> Result<(), gst::ErrorMessage> {
self.parent_decide_allocation(element, query)?;
if let gst::query::QueryView::Allocation(allocation) = query.view() {
let pools = allocation.get_allocation_pools();
if let Some((ref pool, _, _, _)) = pools.first() {
if let Some(pool) = pool {
let mut config = pool.get_config();
config.add_option(&gst_video::BUFFER_POOL_OPTION_VIDEO_META);
pool.set_config(config).unwrap();
if let Some(_) = allocation.find_allocation_meta::<gst_video::VideoMeta>() {
let pools = allocation.get_allocation_pools();
if let Some((ref pool, _, _, _)) = pools.first() {
if let Some(pool) = pool {
let mut config = pool.get_config();
config.add_option(&gst_video::BUFFER_POOL_OPTION_VIDEO_META);
pool.set_config(config).map_err(|e| {
gst::gst_error_msg!(gst::CoreError::Negotiation, [&e.message])
})?;
}
}
}
}
Ok(())
self.parent_decide_allocation(element, query)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment