gstreamer: Fix glib::GStr API changes

This commit is contained in:
Sebastian Dröge 2022-12-25 00:25:18 +02:00
parent cdc7aa4846
commit 146b4fc08e

View file

@ -645,7 +645,7 @@ macro_rules! log_with_level(
let mut storage = [0u8; 256]; let mut storage = [0u8; 256];
let function_name = if function_name_len < 256 { let function_name = if function_name_len < 256 {
storage[0..function_name_len].copy_from_slice(function_name.as_bytes()); storage[0..function_name_len].copy_from_slice(function_name.as_bytes());
::std::borrow::Cow::Borrowed(unsafe { $crate::glib::GStr::from_bytes_with_nul_unchecked(&storage[..function_name_len+1]) }) ::std::borrow::Cow::Borrowed(unsafe { $crate::glib::GStr::from_utf8_with_nul_unchecked(&storage[..function_name_len+1]) })
} else { } else {
::std::borrow::Cow::Owned($crate::glib::GString::from(function_name)) ::std::borrow::Cow::Owned($crate::glib::GString::from(function_name))
}; };
@ -661,7 +661,7 @@ macro_rules! log_with_level(
$cat.clone(), $cat.clone(),
Some(obj), Some(obj),
$level, $level,
unsafe { $crate::glib::GStr::from_bytes_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) }, unsafe { $crate::glib::GStr::from_utf8_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) },
function_name.as_ref(), function_name.as_ref(),
line!(), line!(),
$crate::glib::gstr!($msg), $crate::glib::gstr!($msg),
@ -671,7 +671,7 @@ macro_rules! log_with_level(
$cat.clone(), $cat.clone(),
Some(obj), Some(obj),
$level, $level,
unsafe { $crate::glib::GStr::from_bytes_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) }, unsafe { $crate::glib::GStr::from_utf8_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) },
function_name.as_ref(), function_name.as_ref(),
line!(), line!(),
args, args,
@ -694,7 +694,7 @@ macro_rules! log_with_level(
let mut storage = [0u8; 256]; let mut storage = [0u8; 256];
let function_name = if function_name_len < 256 { let function_name = if function_name_len < 256 {
storage[0..function_name_len].copy_from_slice(function_name.as_bytes()); storage[0..function_name_len].copy_from_slice(function_name.as_bytes());
::std::borrow::Cow::Borrowed(unsafe { $crate::glib::GStr::from_bytes_with_nul_unchecked(&storage[..function_name_len+1]) }) ::std::borrow::Cow::Borrowed(unsafe { $crate::glib::GStr::from_utf8_with_nul_unchecked(&storage[..function_name_len+1]) })
} else { } else {
::std::borrow::Cow::Owned($crate::glib::GString::from(function_name)) ::std::borrow::Cow::Owned($crate::glib::GString::from(function_name))
}; };
@ -704,7 +704,7 @@ macro_rules! log_with_level(
$cat.clone(), $cat.clone(),
Some(obj), Some(obj),
$level, $level,
unsafe { $crate::glib::GStr::from_bytes_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) }, unsafe { $crate::glib::GStr::from_utf8_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) },
function_name.as_ref(), function_name.as_ref(),
line!(), line!(),
format_args!($($args)*), format_args!($($args)*),
@ -726,7 +726,7 @@ macro_rules! log_with_level(
let mut storage = [0u8; 256]; let mut storage = [0u8; 256];
let function_name = if function_name_len < 256 { let function_name = if function_name_len < 256 {
storage[0..function_name_len].copy_from_slice(function_name.as_bytes()); storage[0..function_name_len].copy_from_slice(function_name.as_bytes());
::std::borrow::Cow::Borrowed(unsafe { $crate::glib::GStr::from_bytes_with_nul_unchecked(&storage[..function_name_len+1]) }) ::std::borrow::Cow::Borrowed(unsafe { $crate::glib::GStr::from_utf8_with_nul_unchecked(&storage[..function_name_len+1]) })
} else { } else {
::std::borrow::Cow::Owned($crate::glib::GString::from(function_name)) ::std::borrow::Cow::Owned($crate::glib::GString::from(function_name))
}; };
@ -743,7 +743,7 @@ macro_rules! log_with_level(
$cat.clone(), $cat.clone(),
Some(obj), Some(obj),
$level, $level,
unsafe { $crate::glib::GStr::from_bytes_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) }, unsafe { $crate::glib::GStr::from_utf8_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) },
function_name.as_ref(), function_name.as_ref(),
line!(), line!(),
$crate::glib::gstr!($msg), $crate::glib::gstr!($msg),
@ -753,7 +753,7 @@ macro_rules! log_with_level(
$cat.clone(), $cat.clone(),
Some(obj), Some(obj),
$level, $level,
unsafe { $crate::glib::GStr::from_bytes_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) }, unsafe { $crate::glib::GStr::from_utf8_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) },
function_name.as_ref(), function_name.as_ref(),
line!(), line!(),
args, args,
@ -776,7 +776,7 @@ macro_rules! log_with_level(
let mut storage = [0u8; 256]; let mut storage = [0u8; 256];
let function_name = if function_name_len < 256 { let function_name = if function_name_len < 256 {
storage[0..function_name_len].copy_from_slice(function_name.as_bytes()); storage[0..function_name_len].copy_from_slice(function_name.as_bytes());
::std::borrow::Cow::Borrowed(unsafe { $crate::glib::GStr::from_bytes_with_nul_unchecked(&storage[..function_name_len+1]) }) ::std::borrow::Cow::Borrowed(unsafe { $crate::glib::GStr::from_utf8_with_nul_unchecked(&storage[..function_name_len+1]) })
} else { } else {
::std::borrow::Cow::Owned($crate::glib::GString::from(function_name)) ::std::borrow::Cow::Owned($crate::glib::GString::from(function_name))
}; };
@ -787,7 +787,7 @@ macro_rules! log_with_level(
$cat.clone(), $cat.clone(),
Some(obj), Some(obj),
$level, $level,
unsafe { $crate::glib::GStr::from_bytes_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) }, unsafe { $crate::glib::GStr::from_utf8_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) },
function_name.as_ref(), function_name.as_ref(),
line!(), line!(),
format_args!($($args)*), format_args!($($args)*),
@ -807,7 +807,7 @@ macro_rules! log_with_level(
let mut storage = [0u8; 256]; let mut storage = [0u8; 256];
let function_name = if function_name_len < 256 { let function_name = if function_name_len < 256 {
storage[0..function_name_len].copy_from_slice(function_name.as_bytes()); storage[0..function_name_len].copy_from_slice(function_name.as_bytes());
::std::borrow::Cow::Borrowed(unsafe { $crate::glib::GStr::from_bytes_with_nul_unchecked(&storage[..function_name_len+1]) }) ::std::borrow::Cow::Borrowed(unsafe { $crate::glib::GStr::from_utf8_with_nul_unchecked(&storage[..function_name_len+1]) })
} else { } else {
::std::borrow::Cow::Owned($crate::glib::GString::from(function_name)) ::std::borrow::Cow::Owned($crate::glib::GString::from(function_name))
}; };
@ -821,7 +821,7 @@ macro_rules! log_with_level(
$cat.clone(), $cat.clone(),
Some($crate::glib::gstr!($id)), Some($crate::glib::gstr!($id)),
$level, $level,
unsafe { $crate::glib::GStr::from_bytes_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) }, unsafe { $crate::glib::GStr::from_utf8_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) },
function_name.as_ref(), function_name.as_ref(),
line!(), line!(),
$crate::glib::gstr!($msg), $crate::glib::gstr!($msg),
@ -831,7 +831,7 @@ macro_rules! log_with_level(
$cat.clone(), $cat.clone(),
Some($crate::glib::gstr!($id)), Some($crate::glib::gstr!($id)),
$level, $level,
unsafe { $crate::glib::GStr::from_bytes_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) }, unsafe { $crate::glib::GStr::from_utf8_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) },
function_name.as_ref(), function_name.as_ref(),
line!(), line!(),
args, args,
@ -852,7 +852,7 @@ macro_rules! log_with_level(
let mut storage = [0u8; 256]; let mut storage = [0u8; 256];
let function_name = if function_name_len < 256 { let function_name = if function_name_len < 256 {
storage[0..function_name_len].copy_from_slice(function_name.as_bytes()); storage[0..function_name_len].copy_from_slice(function_name.as_bytes());
::std::borrow::Cow::Borrowed(unsafe { $crate::glib::GStr::from_bytes_with_nul_unchecked(&storage[..function_name_len+1]) }) ::std::borrow::Cow::Borrowed(unsafe { $crate::glib::GStr::from_utf8_with_nul_unchecked(&storage[..function_name_len+1]) })
} else { } else {
::std::borrow::Cow::Owned($crate::glib::GString::from(function_name)) ::std::borrow::Cow::Owned($crate::glib::GString::from(function_name))
}; };
@ -861,7 +861,7 @@ macro_rules! log_with_level(
$cat.clone(), $cat.clone(),
Some($crate::glib::gstr!($id)), Some($crate::glib::gstr!($id)),
$level, $level,
unsafe { $crate::glib::GStr::from_bytes_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) }, unsafe { $crate::glib::GStr::from_utf8_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) },
function_name.as_ref(), function_name.as_ref(),
line!(), line!(),
format_args!($($args)*), format_args!($($args)*),
@ -881,7 +881,7 @@ macro_rules! log_with_level(
let mut storage = [0u8; 256]; let mut storage = [0u8; 256];
let function_name = if function_name_len < 256 { let function_name = if function_name_len < 256 {
storage[0..function_name_len].copy_from_slice(function_name.as_bytes()); storage[0..function_name_len].copy_from_slice(function_name.as_bytes());
::std::borrow::Cow::Borrowed(unsafe { $crate::glib::GStr::from_bytes_with_nul_unchecked(&storage[..function_name_len+1]) }) ::std::borrow::Cow::Borrowed(unsafe { $crate::glib::GStr::from_utf8_with_nul_unchecked(&storage[..function_name_len+1]) })
} else { } else {
::std::borrow::Cow::Owned($crate::glib::GString::from(function_name)) ::std::borrow::Cow::Owned($crate::glib::GString::from(function_name))
}; };
@ -895,7 +895,7 @@ macro_rules! log_with_level(
$cat.clone(), $cat.clone(),
Some($id), Some($id),
$level, $level,
unsafe { $crate::glib::GStr::from_bytes_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) }, unsafe { $crate::glib::GStr::from_utf8_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) },
function_name.as_ref(), function_name.as_ref(),
line!(), line!(),
$crate::glib::gstr!($msg), $crate::glib::gstr!($msg),
@ -905,7 +905,7 @@ macro_rules! log_with_level(
$cat.clone(), $cat.clone(),
Some($id), Some($id),
$level, $level,
unsafe { $crate::glib::GStr::from_bytes_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) }, unsafe { $crate::glib::GStr::from_utf8_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) },
function_name.as_ref(), function_name.as_ref(),
line!(), line!(),
args, args,
@ -926,7 +926,7 @@ macro_rules! log_with_level(
let mut storage = [0u8; 256]; let mut storage = [0u8; 256];
let function_name = if function_name_len < 256 { let function_name = if function_name_len < 256 {
storage[0..function_name_len].copy_from_slice(function_name.as_bytes()); storage[0..function_name_len].copy_from_slice(function_name.as_bytes());
::std::borrow::Cow::Borrowed(unsafe { $crate::glib::GStr::from_bytes_with_nul_unchecked(&storage[..function_name_len+1]) }) ::std::borrow::Cow::Borrowed(unsafe { $crate::glib::GStr::from_utf8_with_nul_unchecked(&storage[..function_name_len+1]) })
} else { } else {
::std::borrow::Cow::Owned($crate::glib::GString::from(function_name)) ::std::borrow::Cow::Owned($crate::glib::GString::from(function_name))
}; };
@ -935,7 +935,7 @@ macro_rules! log_with_level(
$cat.clone(), $cat.clone(),
Some($id), Some($id),
$level, $level,
unsafe { $crate::glib::GStr::from_bytes_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) }, unsafe { $crate::glib::GStr::from_utf8_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) },
function_name.as_ref(), function_name.as_ref(),
line!(), line!(),
format_args!($($args)*), format_args!($($args)*),
@ -955,7 +955,7 @@ macro_rules! log_with_level(
let mut storage = [0u8; 256]; let mut storage = [0u8; 256];
let function_name = if function_name_len < 256 { let function_name = if function_name_len < 256 {
storage[0..function_name_len].copy_from_slice(function_name.as_bytes()); storage[0..function_name_len].copy_from_slice(function_name.as_bytes());
::std::borrow::Cow::Borrowed(unsafe { $crate::glib::GStr::from_bytes_with_nul_unchecked(&storage[..function_name_len+1]) }) ::std::borrow::Cow::Borrowed(unsafe { $crate::glib::GStr::from_utf8_with_nul_unchecked(&storage[..function_name_len+1]) })
} else { } else {
::std::borrow::Cow::Owned($crate::glib::GString::from(function_name)) ::std::borrow::Cow::Owned($crate::glib::GString::from(function_name))
}; };
@ -969,7 +969,7 @@ macro_rules! log_with_level(
$cat.clone(), $cat.clone(),
None as Option<&$crate::glib::Object>, None as Option<&$crate::glib::Object>,
$level, $level,
unsafe { $crate::glib::GStr::from_bytes_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) }, unsafe { $crate::glib::GStr::from_utf8_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) },
function_name.as_ref(), function_name.as_ref(),
line!(), line!(),
$crate::glib::gstr!($msg), $crate::glib::gstr!($msg),
@ -979,7 +979,7 @@ macro_rules! log_with_level(
$cat.clone(), $cat.clone(),
None as Option<&$crate::glib::Object>, None as Option<&$crate::glib::Object>,
$level, $level,
unsafe { $crate::glib::GStr::from_bytes_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) }, unsafe { $crate::glib::GStr::from_utf8_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) },
function_name.as_ref(), function_name.as_ref(),
line!(), line!(),
args, args,
@ -1000,7 +1000,7 @@ macro_rules! log_with_level(
let mut storage = [0u8; 256]; let mut storage = [0u8; 256];
let function_name = if function_name_len < 256 { let function_name = if function_name_len < 256 {
storage[0..function_name_len].copy_from_slice(function_name.as_bytes()); storage[0..function_name_len].copy_from_slice(function_name.as_bytes());
::std::borrow::Cow::Borrowed(unsafe { $crate::glib::GStr::from_bytes_with_nul_unchecked(&storage[..function_name_len+1]) }) ::std::borrow::Cow::Borrowed(unsafe { $crate::glib::GStr::from_utf8_with_nul_unchecked(&storage[..function_name_len+1]) })
} else { } else {
::std::borrow::Cow::Owned($crate::glib::GString::from(function_name)) ::std::borrow::Cow::Owned($crate::glib::GString::from(function_name))
}; };
@ -1009,7 +1009,7 @@ macro_rules! log_with_level(
$cat.clone(), $cat.clone(),
None as Option<&$crate::glib::Object>, None as Option<&$crate::glib::Object>,
$level, $level,
unsafe { $crate::glib::GStr::from_bytes_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) }, unsafe { $crate::glib::GStr::from_utf8_with_nul_unchecked(concat!(file!(), "\0").as_bytes()) },
function_name.as_ref(), function_name.as_ref(),
line!(), line!(),
format_args!($($args)*), format_args!($($args)*),