forked from mirrors/gstreamer-rs
Update for glib::Quark API changes
This commit is contained in:
parent
ac9b1e881c
commit
6d63180bfc
7 changed files with 12 additions and 12 deletions
|
@ -290,7 +290,7 @@ impl AppSink {
|
||||||
pub fn set_callbacks(&self, callbacks: AppSinkCallbacks) {
|
pub fn set_callbacks(&self, callbacks: AppSinkCallbacks) {
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
static SET_ONCE_QUARK: Lazy<glib::Quark> =
|
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 {
|
unsafe {
|
||||||
let sink = self.to_glib_none().0;
|
let sink = self.to_glib_none().0;
|
||||||
|
|
|
@ -238,7 +238,7 @@ impl AppSrc {
|
||||||
pub fn set_callbacks(&self, callbacks: AppSrcCallbacks) {
|
pub fn set_callbacks(&self, callbacks: AppSrcCallbacks) {
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
static SET_ONCE_QUARK: Lazy<glib::Quark> =
|
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 {
|
unsafe {
|
||||||
let src = self.to_glib_none().0;
|
let src = self.to_glib_none().0;
|
||||||
|
|
|
@ -58,7 +58,7 @@ unsafe extern "C" fn video_renderer_create_video_sink<T: PlayerVideoRendererImpl
|
||||||
) -> *mut gst::ffi::GstElement {
|
) -> *mut gst::ffi::GstElement {
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
static VIDEO_SINK_QUARK: Lazy<glib::Quark> =
|
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 instance = &*(video_renderer as *mut T::Instance);
|
||||||
let imp = instance.imp();
|
let imp = instance.imp();
|
||||||
|
|
|
@ -284,7 +284,7 @@ unsafe extern "C" fn factory_create_pipeline<T: RTSPMediaFactoryImpl>(
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
|
|
||||||
static PIPELINE_QUARK: Lazy<glib::Quark> =
|
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 instance = &*(ptr as *mut T::Instance);
|
||||||
let imp = instance.imp();
|
let imp = instance.imp();
|
||||||
|
|
|
@ -354,7 +354,7 @@ impl VideoRegionOfInterestMeta {
|
||||||
|
|
||||||
#[doc(alias = "get_roi_type")]
|
#[doc(alias = "get_roi_type")]
|
||||||
pub fn roi_type<'a>(&self) -> &'a str {
|
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")]
|
#[cfg(feature = "v1_14")]
|
||||||
|
|
|
@ -191,7 +191,7 @@ impl Bus {
|
||||||
{
|
{
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
static SET_ONCE_QUARK: Lazy<glib::Quark> =
|
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 {
|
unsafe {
|
||||||
let bus = self.to_glib_none().0;
|
let bus = self.to_glib_none().0;
|
||||||
|
|
|
@ -389,7 +389,7 @@ impl StructureRef {
|
||||||
where
|
where
|
||||||
<<T as FromValue<'a>>::Checker as glib::value::ValueTypeChecker>::Error: GlibValueError,
|
<<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)
|
self.get_by_quark(name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -398,14 +398,14 @@ impl StructureRef {
|
||||||
where
|
where
|
||||||
<<T as FromValue<'a>>::Checker as glib::value::ValueTypeChecker>::Error: GlibValueError,
|
<<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)
|
self.get_optional_by_quark(name)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc(alias = "get_value")]
|
#[doc(alias = "get_value")]
|
||||||
#[doc(alias = "gst_structure_get_value")]
|
#[doc(alias = "gst_structure_get_value")]
|
||||||
pub fn value(&self, name: &str) -> Result<&SendValue, GetError> {
|
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)
|
self.value_by_quark(name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -416,7 +416,7 @@ impl StructureRef {
|
||||||
{
|
{
|
||||||
self.value_by_quark(name)?
|
self.value_by_quark(name)?
|
||||||
.get()
|
.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")]
|
#[doc(alias = "gst_structure_id_get")]
|
||||||
|
@ -431,7 +431,7 @@ impl StructureRef {
|
||||||
.ok()
|
.ok()
|
||||||
.map(|v| v.get())
|
.map(|v| v.get())
|
||||||
.transpose()
|
.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")]
|
#[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());
|
let value = ffi::gst_structure_id_get_value(&self.0, name.into_glib());
|
||||||
|
|
||||||
if value.is_null() {
|
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))
|
Ok(&*(value as *const SendValue))
|
||||||
|
|
Loading…
Reference in a new issue