mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-02-16 21:05:15 +00:00
Update for pango API changes
This commit is contained in:
parent
676b061af3
commit
e17688a2da
2 changed files with 4 additions and 25 deletions
|
@ -294,19 +294,8 @@ impl OnvifMetadataOverlay {
|
|||
|
||||
if state.layout.is_none() {
|
||||
let fontmap = pangocairo::FontMap::new();
|
||||
let context = match fontmap.create_context() {
|
||||
Some(context) => Ok(context),
|
||||
None => {
|
||||
gst::element_imp_error!(
|
||||
self,
|
||||
gst::LibraryError::Failed,
|
||||
["Failed to create font map context"]
|
||||
);
|
||||
Err(gst::FlowError::Error)
|
||||
}
|
||||
}
|
||||
.unwrap();
|
||||
context.set_language(&pango::Language::from_string("en_US"));
|
||||
let context = fontmap.create_context();
|
||||
context.set_language(Some(&pango::Language::from_string("en_US")));
|
||||
context.set_base_dir(pango::Direction::Ltr);
|
||||
let layout = pango::Layout::new(&context);
|
||||
layout.set_alignment(pango::Alignment::Left);
|
||||
|
|
|
@ -99,18 +99,8 @@ impl Cea608Overlay {
|
|||
fn recalculate_layout(&self, state: &mut State) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let video_info = state.video_info.as_ref().unwrap();
|
||||
let fontmap = pangocairo::FontMap::new();
|
||||
let context = match fontmap.create_context() {
|
||||
Some(context) => Ok(context),
|
||||
None => {
|
||||
gst::element_imp_error!(
|
||||
self,
|
||||
gst::LibraryError::Failed,
|
||||
["Failed to create font map context"]
|
||||
);
|
||||
Err(gst::FlowError::Error)
|
||||
}
|
||||
}?;
|
||||
context.set_language(&pango::Language::from_string("en_US"));
|
||||
let context = fontmap.create_context();
|
||||
context.set_language(Some(&pango::Language::from_string("en_US")));
|
||||
context.set_base_dir(pango::Direction::Ltr);
|
||||
let layout = pango::Layout::new(&context);
|
||||
layout.set_alignment(pango::Alignment::Left);
|
||||
|
|
Loading…
Reference in a new issue