Regenerate with gir filename/utf8 fixes

This commit is contained in:
Sebastian Dröge 2017-12-03 14:51:16 +02:00
parent 7c75d3d8e2
commit 6015e74f0e
3 changed files with 12 additions and 9 deletions

View file

@ -13,6 +13,7 @@ use ffi;
use glib;
use glib::object::IsA;
use glib::translate::*;
use std;
use std::mem;
use std::ptr;
@ -24,17 +25,17 @@ pub fn debug_bin_to_dot_data<P: IsA<Bin>>(bin: &P, details: DebugGraphDetails) -
}
}
pub fn debug_bin_to_dot_file<P: IsA<Bin>>(bin: &P, details: DebugGraphDetails, file_name: &str) {
pub fn debug_bin_to_dot_file<P: IsA<Bin>, Q: AsRef<std::path::Path>>(bin: &P, details: DebugGraphDetails, file_name: Q) {
skip_assert_initialized!();
unsafe {
ffi::gst_debug_bin_to_dot_file(bin.to_glib_none().0, details.to_glib(), file_name.to_glib_none().0);
ffi::gst_debug_bin_to_dot_file(bin.to_glib_none().0, details.to_glib(), file_name.as_ref().to_glib_none().0);
}
}
pub fn debug_bin_to_dot_file_with_ts<P: IsA<Bin>>(bin: &P, details: DebugGraphDetails, file_name: &str) {
pub fn debug_bin_to_dot_file_with_ts<P: IsA<Bin>, Q: AsRef<std::path::Path>>(bin: &P, details: DebugGraphDetails, file_name: Q) {
skip_assert_initialized!();
unsafe {
ffi::gst_debug_bin_to_dot_file_with_ts(bin.to_glib_none().0, details.to_glib(), file_name.to_glib_none().0);
ffi::gst_debug_bin_to_dot_file_with_ts(bin.to_glib_none().0, details.to_glib(), file_name.as_ref().to_glib_none().0);
}
}

View file

@ -8,6 +8,7 @@ use ffi;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use std;
use std::mem;
use std::ptr;
@ -40,7 +41,7 @@ impl Plugin {
}
}
pub fn get_filename(&self) -> Option<String> {
pub fn get_filename(&self) -> Option<std::path::PathBuf> {
unsafe {
from_glib_none(ffi::gst_plugin_get_filename(self.to_glib_none().0))
}
@ -114,11 +115,11 @@ impl Plugin {
}
}
pub fn load_file(filename: &str) -> Result<Plugin, Error> {
pub fn load_file<P: AsRef<std::path::Path>>(filename: P) -> Result<Plugin, Error> {
assert_initialized_main_thread!();
unsafe {
let mut error = ptr::null_mut();
let ret = ffi::gst_plugin_load_file(filename.to_glib_none().0, &mut error);
let ret = ffi::gst_plugin_load_file(filename.as_ref().to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
}
}

View file

@ -12,6 +12,7 @@ use glib::signal::connect;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use std;
use std::boxed::Box as Box_;
use std::mem;
use std::mem::transmute;
@ -112,9 +113,9 @@ impl Registry {
}
}
pub fn scan_path(&self, path: &str) -> Result<(), glib::error::BoolError> {
pub fn scan_path<P: AsRef<std::path::Path>>(&self, path: P) -> Result<(), glib::error::BoolError> {
unsafe {
glib::error::BoolError::from_glib(ffi::gst_registry_scan_path(self.to_glib_none().0, path.to_glib_none().0), "Failed to scan path")
glib::error::BoolError::from_glib(ffi::gst_registry_scan_path(self.to_glib_none().0, path.as_ref().to_glib_none().0), "Failed to scan path")
}
}