onvifmetadataoverlay, cea608overlay: Fix pangocairo::FontMap::new()

It doesn't return an Option anymore.
This commit is contained in:
Vivia Nikolaidou 2022-10-14 18:11:36 +03:00
parent f11b0fa5eb
commit 0ab965335f
2 changed files with 2 additions and 23 deletions

View file

@ -293,18 +293,7 @@ impl OnvifMetadataOverlay {
}
if state.layout.is_none() {
let fontmap = match pangocairo::FontMap::new() {
Some(fontmap) => Ok(fontmap),
None => {
gst::element_imp_error!(
self,
gst::LibraryError::Failed,
["Failed to create pangocairo font map"]
);
Err(gst::FlowError::Error)
}
}
.unwrap();
let fontmap = pangocairo::FontMap::new();
let context = match fontmap.create_context() {
Some(context) => Ok(context),
None => {

View file

@ -98,17 +98,7 @@ impl Cea608Overlay {
// TODO: switch to the API presented in this post once it's been exposed
fn recalculate_layout(&self, state: &mut State) -> Result<gst::FlowSuccess, gst::FlowError> {
let video_info = state.video_info.as_ref().unwrap();
let fontmap = match pangocairo::FontMap::new() {
Some(fontmap) => Ok(fontmap),
None => {
gst::element_imp_error!(
self,
gst::LibraryError::Failed,
["Failed to create pangocairo font map"]
);
Err(gst::FlowError::Error)
}
}?;
let fontmap = pangocairo::FontMap::new();
let context = match fontmap.create_context() {
Some(context) => Ok(context),
None => {