Update for glib::Quark API changes

This commit is contained in:
Sebastian Dröge 2022-01-11 12:49:42 +02:00
parent ac9b1e881c
commit 6d63180bfc
7 changed files with 12 additions and 12 deletions

View file

@ -290,7 +290,7 @@ impl AppSink {
pub fn set_callbacks(&self, callbacks: AppSinkCallbacks) {
use once_cell::sync::Lazy;
static SET_ONCE_QUARK: Lazy<glib::Quark> =
Lazy::new(|| glib::Quark::from_string("gstreamer-rs-app-sink-callbacks"));
Lazy::new(|| glib::Quark::from_str("gstreamer-rs-app-sink-callbacks"));
unsafe {
let sink = self.to_glib_none().0;

View file

@ -238,7 +238,7 @@ impl AppSrc {
pub fn set_callbacks(&self, callbacks: AppSrcCallbacks) {
use once_cell::sync::Lazy;
static SET_ONCE_QUARK: Lazy<glib::Quark> =
Lazy::new(|| glib::Quark::from_string("gstreamer-rs-app-src-callbacks"));
Lazy::new(|| glib::Quark::from_str("gstreamer-rs-app-src-callbacks"));
unsafe {
let src = self.to_glib_none().0;

View file

@ -58,7 +58,7 @@ unsafe extern "C" fn video_renderer_create_video_sink<T: PlayerVideoRendererImpl
) -> *mut gst::ffi::GstElement {
use once_cell::sync::Lazy;
static VIDEO_SINK_QUARK: Lazy<glib::Quark> =
Lazy::new(|| glib::Quark::from_string("gstreamer-rs-player-video-sink"));
Lazy::new(|| glib::Quark::from_str("gstreamer-rs-player-video-sink"));
let instance = &*(video_renderer as *mut T::Instance);
let imp = instance.imp();

View file

@ -284,7 +284,7 @@ unsafe extern "C" fn factory_create_pipeline<T: RTSPMediaFactoryImpl>(
use once_cell::sync::Lazy;
static PIPELINE_QUARK: Lazy<glib::Quark> =
Lazy::new(|| glib::Quark::from_string("gstreamer-rs-rtsp-media-pipeline"));
Lazy::new(|| glib::Quark::from_str("gstreamer-rs-rtsp-media-pipeline"));
let instance = &*(ptr as *mut T::Instance);
let imp = instance.imp();

View file

@ -354,7 +354,7 @@ impl VideoRegionOfInterestMeta {
#[doc(alias = "get_roi_type")]
pub fn roi_type<'a>(&self) -> &'a str {
unsafe { glib::Quark::from_glib(self.0.roi_type).to_string() }
unsafe { glib::Quark::from_glib(self.0.roi_type).as_str() }
}
#[cfg(feature = "v1_14")]

View file

@ -191,7 +191,7 @@ impl Bus {
{
use once_cell::sync::Lazy;
static SET_ONCE_QUARK: Lazy<glib::Quark> =
Lazy::new(|| glib::Quark::from_string("gstreamer-rs-sync-handler"));
Lazy::new(|| glib::Quark::from_str("gstreamer-rs-sync-handler"));
unsafe {
let bus = self.to_glib_none().0;

View file

@ -389,7 +389,7 @@ impl StructureRef {
where
<<T as FromValue<'a>>::Checker as glib::value::ValueTypeChecker>::Error: GlibValueError,
{
let name = glib::Quark::from_string(name);
let name = glib::Quark::from_str(name);
self.get_by_quark(name)
}
@ -398,14 +398,14 @@ impl StructureRef {
where
<<T as FromValue<'a>>::Checker as glib::value::ValueTypeChecker>::Error: GlibValueError,
{
let name = glib::Quark::from_string(name);
let name = glib::Quark::from_str(name);
self.get_optional_by_quark(name)
}
#[doc(alias = "get_value")]
#[doc(alias = "gst_structure_get_value")]
pub fn value(&self, name: &str) -> Result<&SendValue, GetError> {
let name = glib::Quark::from_string(name);
let name = glib::Quark::from_str(name);
self.value_by_quark(name)
}
@ -416,7 +416,7 @@ impl StructureRef {
{
self.value_by_quark(name)?
.get()
.map_err(|err| GetError::from_value_get_error(name.to_string(), err))
.map_err(|err| GetError::from_value_get_error(name.as_str(), err))
}
#[doc(alias = "gst_structure_id_get")]
@ -431,7 +431,7 @@ impl StructureRef {
.ok()
.map(|v| v.get())
.transpose()
.map_err(|err| GetError::from_value_get_error(name.to_string(), err))
.map_err(|err| GetError::from_value_get_error(name.as_str(), err))
}
#[doc(alias = "gst_structure_id_get_value")]
@ -440,7 +440,7 @@ impl StructureRef {
let value = ffi::gst_structure_id_get_value(&self.0, name.into_glib());
if value.is_null() {
return Err(GetError::new_field_not_found(name.to_string()));
return Err(GetError::new_field_not_found(name.as_str()));
}
Ok(&*(value as *const SendValue))