post fix-getters manual updates

This commit is contained in:
François Laignel 2021-04-12 12:01:22 +02:00
parent 53be8e5f58
commit 99616ec0b4
10 changed files with 15 additions and 15 deletions

View file

@ -60,7 +60,7 @@ fn create_pipeline() -> Result<gst::Pipeline, Error> {
.expect("Failed to create video info"); .expect("Failed to create video info");
appsrc.set_caps(Some(&video_info.to_caps().unwrap())); appsrc.set_caps(Some(&video_info.to_caps().unwrap()));
appsrc.set_property_format(gst::Format::Time); appsrc.set_format(gst::Format::Time);
// Our frame counter, that is stored in the mutable environment // Our frame counter, that is stored in the mutable environment
// of the closure of the need-data callback // of the closure of the need-data callback

View file

@ -356,7 +356,7 @@ impl App {
use glutin::platform::unix::WindowExtUnix; use glutin::platform::unix::WindowExtUnix;
use glutin::platform::ContextTraitExt; use glutin::platform::ContextTraitExt;
let api = App::map_gl_api(windowed_context.api()); let api = App::map_gl_api(windowed_context.get_api());
let (gl_context, gl_display, platform) = match unsafe { windowed_context.raw_handle() } let (gl_context, gl_display, platform) = match unsafe { windowed_context.raw_handle() }
{ {
@ -365,7 +365,7 @@ impl App {
let mut gl_display = None; let mut gl_display = None;
#[cfg(feature = "gst-gl-egl")] #[cfg(feature = "gst-gl-egl")]
if let Some(display) = unsafe { windowed_context.egl_display() } { if let Some(display) = unsafe { windowed_context.get_egl_display() } {
gl_display = Some( gl_display = Some(
unsafe { gst_gl_egl::GLDisplayEGL::with_egl_display(display as usize) } unsafe { gst_gl_egl::GLDisplayEGL::with_egl_display(display as usize) }
.unwrap() .unwrap()
@ -610,7 +610,7 @@ fn main_loop(app: App) -> Result<(), Error> {
println!( println!(
"Pixel format of the window's GL context {:?}", "Pixel format of the window's GL context {:?}",
app.windowed_context.pixel_format() app.windowed_context.get_pixel_format()
); );
let gl = load(&app.windowed_context); let gl = load(&app.windowed_context);

View file

@ -585,7 +585,7 @@ mod tests {
let video_profile: EncodingVideoProfile = let video_profile: EncodingVideoProfile =
glib::object::Cast::downcast(video_profile).ok().unwrap(); glib::object::Cast::downcast(video_profile).ok().unwrap();
assert_eq!(video_profile.variableframerate(), VARIABLE_FRAMERATE); assert_eq!(video_profile.is_variableframerate(), VARIABLE_FRAMERATE);
assert_eq!(video_profile.pass(), PASS); assert_eq!(video_profile.pass(), PASS);
let restriction = gst::Caps::new_simple("video/x-raw", &[("format", &"NV12")]); let restriction = gst::Caps::new_simple("video/x-raw", &[("format", &"NV12")]);

View file

@ -369,7 +369,7 @@ mod tests {
assert_eq!(rtp_buffer.seq(), 42); assert_eq!(rtp_buffer.seq(), 42);
rtp_buffer.set_marker(true); rtp_buffer.set_marker(true);
assert!(rtp_buffer.marker()); assert!(rtp_buffer.is_marker());
rtp_buffer.set_payload_type(43); rtp_buffer.set_payload_type(43);
assert_eq!(rtp_buffer.payload_type(), 43); assert_eq!(rtp_buffer.payload_type(), 43);
@ -394,7 +394,7 @@ mod tests {
assert!(rtp_buffer.get_csrc(2).is_none()); assert!(rtp_buffer.get_csrc(2).is_none());
rtp_buffer.set_extension(true); rtp_buffer.set_extension(true);
assert_eq!(rtp_buffer.extension(), true); assert_eq!(rtp_buffer.is_extension(), true);
assert_eq!(rtp_buffer.extension_bytes(), None); assert_eq!(rtp_buffer.extension_bytes(), None);
} }

View file

@ -136,11 +136,11 @@ pub trait ElementExtManual: 'static {
fn set_state(&self, state: State) -> Result<StateChangeSuccess, StateChangeError>; fn set_state(&self, state: State) -> Result<StateChangeSuccess, StateChangeError>;
fn current_state(&self) -> State { fn current_state(&self) -> State {
self.state(ClockTime::from(0)).1 self.get_state(ClockTime::from(0)).1
} }
fn pending_state(&self) -> State { fn pending_state(&self) -> State {
self.state(ClockTime::from(0)).2 self.get_state(ClockTime::from(0)).2
} }
fn query(&self, query: &mut QueryRef) -> bool; fn query(&self, query: &mut QueryRef) -> bool;

View file

@ -108,7 +108,7 @@ macro_rules! result_from_gboolean(
); );
#[derive(Debug, Clone, Error)] #[derive(Debug, Clone, Error)]
#[error("Error {:?}: {:?} at {}:{}", .category.get_name(), .bool_error.message, .bool_error.filename, .bool_error.line)] #[error("Error {:?}: {:?} at {}:{}", .category.name(), .bool_error.message, .bool_error.filename, .bool_error.line)]
pub struct LoggableError { pub struct LoggableError {
category: crate::DebugCategory, category: crate::DebugCategory,
bool_error: glib::BoolError, bool_error: glib::BoolError,

View file

@ -111,7 +111,7 @@ impl GhostPad {
) -> Result<Self, glib::BoolError> { ) -> Result<Self, glib::BoolError> {
skip_assert_initialized!(); skip_assert_initialized!();
if target.direction() != templ.property_direction() { if target.direction() != templ.direction() {
return Err(glib::bool_error!( return Err(glib::bool_error!(
"Template and target have different directions" "Template and target have different directions"
)); ));

View file

@ -1682,7 +1682,7 @@ impl<T: IsA<Pad> + IsA<glib::Object> + glib::object::IsClass> PadBuilder<T> {
type_, type_,
&[ &[
("name", &name), ("name", &name),
("direction", &templ.property_direction()), ("direction", &templ.direction()),
("template", templ), ("template", templ),
], ],
) )

View file

@ -53,7 +53,7 @@ impl Promise {
let promise: Borrowed<Promise> = from_glib_borrow(promise); let promise: Borrowed<Promise> = from_glib_borrow(promise);
let res = match promise.wait() { let res = match promise.wait() {
PromiseResult::Replied => Ok(promise.reply()), PromiseResult::Replied => Ok(promise.get_reply()),
PromiseResult::Interrupted => Err(PromiseError::Interrupted), PromiseResult::Interrupted => Err(PromiseError::Interrupted),
PromiseResult::Expired => Err(PromiseError::Expired), PromiseResult::Expired => Err(PromiseError::Expired),
PromiseResult::Pending => { PromiseResult::Pending => {
@ -103,7 +103,7 @@ impl Promise {
} }
} }
pub fn reply(&self) -> Option<&StructureRef> { pub fn get_reply(&self) -> Option<&StructureRef> {
unsafe { unsafe {
let s = ffi::gst_promise_get_reply(self.to_glib_none().0); let s = ffi::gst_promise_get_reply(self.to_glib_none().0);
if s.is_null() { if s.is_null() {

View file

@ -127,7 +127,7 @@ fn main() {
.dynamic_cast::<AppSrc>() .dynamic_cast::<AppSrc>()
.expect("Source element is expected to be an appsrc!"); .expect("Source element is expected to be an appsrc!");
appsrc.set_caps(Some(&audio_caps)); appsrc.set_caps(Some(&audio_caps));
appsrc.set_property_format(gst::Format::Time); appsrc.set_format(gst::Format::Time);
let appsink = appsink let appsink = appsink
.dynamic_cast::<AppSink>() .dynamic_cast::<AppSink>()