From e75391139ca3ff02fd73d1c180d9061876992b3d Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 7 Apr 2023 14:55:40 +0200 Subject: [PATCH] fix typos in comments Part-of: --- examples/src/bin/appsink.rs | 2 +- examples/src/bin/cairo_compositor.rs | 4 ++-- examples/src/bin/d3d11videosink.rs | 4 ++-- examples/src/bin/gtkvideooverlay.rs | 6 +++--- examples/src/bin/iterator.rs | 2 +- examples/src/bin/launch.rs | 2 +- examples/src/bin/overlay-composition-d2d.rs | 2 +- examples/src/bin/overlay-composition.rs | 6 +++--- examples/src/bin/pango-cairo.rs | 6 +++--- examples/src/bin/playbin.rs | 2 +- examples/src/bin/rtsp-server-record.rs | 2 +- examples/src/bin/subclass.rs | 2 +- gstreamer-pbutils/Gir.toml | 2 +- gstreamer-video/src/video_format_info.rs | 2 +- gstreamer/src/buffer_serde.rs | 2 +- gstreamer/src/date_time.rs | 2 +- gstreamer/src/format/compatible.rs | 4 ++-- gstreamer/src/format/mod.rs | 2 +- gstreamer/src/format/signed.rs | 2 +- gstreamer/src/tags_serde.rs | 2 +- tutorials/src/bin/basic-tutorial-8.rs | 2 +- tutorials/src/bin/playback-tutorial-3.rs | 2 +- 22 files changed, 31 insertions(+), 31 deletions(-) diff --git a/examples/src/bin/appsink.rs b/examples/src/bin/appsink.rs index 3b3d1ba25..15bf095f9 100644 --- a/examples/src/bin/appsink.rs +++ b/examples/src/bin/appsink.rs @@ -91,7 +91,7 @@ fn create_pipeline() -> Result { element_error!( appsink, gst::ResourceError::Failed, - ("Failed to interprete buffer as S16 PCM") + ("Failed to interpret buffer as S16 PCM") ); gst::FlowError::Error diff --git a/examples/src/bin/cairo_compositor.rs b/examples/src/bin/cairo_compositor.rs index 35f76db10..a4d5483d7 100644 --- a/examples/src/bin/cairo_compositor.rs +++ b/examples/src/bin/cairo_compositor.rs @@ -53,7 +53,7 @@ mod cairo_compositor { // Implementation of glib::Object virtual methods. impl ObjectImpl for CairoCompositor { - // Specfication of the compositor properties. + // Specification of the compositor properties. // In this case a single property for configuring the background color of the // composition. fn properties() -> &'static [glib::ParamSpec] { @@ -453,7 +453,7 @@ mod cairo_compositor { // Implementation of glib::Object virtual methods. impl ObjectImpl for CairoCompositorPad { - // Specfication of the compositor pad properties. + // Specification of the compositor pad properties. // In this case there are various properties for defining the position and otherwise // the appearance of the stream corresponding to this pad. fn properties() -> &'static [glib::ParamSpec] { diff --git a/examples/src/bin/d3d11videosink.rs b/examples/src/bin/d3d11videosink.rs index de5b51d2c..a2018f185 100644 --- a/examples/src/bin/d3d11videosink.rs +++ b/examples/src/bin/d3d11videosink.rs @@ -1,7 +1,7 @@ // This example demonstrates the use of the d3d11videosink's "present" // signal and the use of Direct2D/DirectWrite APIs in Rust. // -// Application can perform various hardware-acceleated 2D graphics operation +// Application can perform various hardware-accelerated 2D graphics operation // (e.g., like cairo can support) and text rendering via the Windows APIs. // In this example, 2D graphics operation and text rendering will happen // directly to the on the DXGI swapchain's backbuffer via Windows API in @@ -129,7 +129,7 @@ fn main() -> Result<()> { // APIs are marked as unsafe, except for cast. // // In theory, all the Direct3D/Direct2D APIs could fail for - // some reasons (it's hardware!), but in pratice, it's very unexpected + // some reasons (it's hardware!), but in practice, it's very unexpected // situation and any of failure below would mean we are doing // something in wrong way or driver bug or so. unsafe { diff --git a/examples/src/bin/gtkvideooverlay.rs b/examples/src/bin/gtkvideooverlay.rs index e5119deae..535899206 100644 --- a/examples/src/bin/gtkvideooverlay.rs +++ b/examples/src/bin/gtkvideooverlay.rs @@ -1,5 +1,5 @@ // This example demonstrates another type of combination of gtk and gstreamer, -// in comparision to the gtksink example. +// in comparison to the gtksink example. // This example uses regions that are managed by the window system, and uses // the window system's api to insert a videostream into these regions. // So essentially, the window system of the system overlays our gui with @@ -107,7 +107,7 @@ fn create_ui(app: >k::Application) { src.link(&sink).unwrap(); // First, we create our gtk window - which will contain a region where - // our overlayed video will be displayed in. + // our overlaid video will be displayed in. let window = gtk::Window::new(gtk::WindowType::Toplevel); window.set_default_size(320, 240); @@ -130,7 +130,7 @@ fn create_ui(app: >k::Application) { .unwrap() .downgrade(); // Connect to this widget's realize signal, which will be emitted - // after its display has been initialized. This is neccessary, because + // after its display has been initialized. This is necessary, because // the window system doesn't know about our region until it was initialized. video_window.connect_realize(move |video_window| { // Here we temporarily retrieve a strong reference on the video-overlay from the diff --git a/examples/src/bin/iterator.rs b/examples/src/bin/iterator.rs index d29d7b9b1..99d35918b 100644 --- a/examples/src/bin/iterator.rs +++ b/examples/src/bin/iterator.rs @@ -1,5 +1,5 @@ // This example demonstrates how to use GStreamer's iteration APIs. -// This is used at multiple occassions - for example to iterate an +// This is used at multiple occasions - for example to iterate an // element's pads. use gst::prelude::*; diff --git a/examples/src/bin/launch.rs b/examples/src/bin/launch.rs index 05c28458f..29daf4a2f 100644 --- a/examples/src/bin/launch.rs +++ b/examples/src/bin/launch.rs @@ -17,7 +17,7 @@ fn example_main() { gst::init().unwrap(); // Let GStreamer create a pipeline from the parsed launch syntax on the cli. - // In comparision to the launch_glib_main example, this is using the advanced launch syntax + // In comparison to the launch_glib_main example, this is using the advanced launch syntax // parsing API of GStreamer. The function returns a Result, handing us the pipeline if // parsing and creating succeeded, and hands us detailed error information if something // went wrong. The error is passed as gst::ParseError. In this example, we separately diff --git a/examples/src/bin/overlay-composition-d2d.rs b/examples/src/bin/overlay-composition-d2d.rs index 88fb9f387..420daded5 100644 --- a/examples/src/bin/overlay-composition-d2d.rs +++ b/examples/src/bin/overlay-composition-d2d.rs @@ -250,7 +250,7 @@ fn create_pipeline() -> Result { // will then change its caps and we use the notification about this change to // resize our canvas's size. // Another possibility for when this might happen is, when our video is a network - // stream that dynamically changes resolution when enough bandwith is available. + // stream that dynamically changes resolution when enough bandwidth is available. overlay.connect_closure( "caps-changed", false, diff --git a/examples/src/bin/overlay-composition.rs b/examples/src/bin/overlay-composition.rs index 4b55181f1..509e446cd 100644 --- a/examples/src/bin/overlay-composition.rs +++ b/examples/src/bin/overlay-composition.rs @@ -150,7 +150,7 @@ fn create_pipeline() -> Result { // The image we draw (the text) will be static, but we will change the // transformation on the drawing context, which rotates and shifts everything - // that we draw afterwards. Like this, we have no complicated calulations + // that we draw afterwards. Like this, we have no complicated calculations // in the actual drawing below. // Calling multiple transformation methods after each other will apply the // new transformation on top. If you repeat the cr.rotate(angle) line below @@ -179,7 +179,7 @@ fn create_pipeline() -> Result { // to end up as a 200x100 rectangle would now be 100x200. pangocairo::functions::update_layout(&cr, layout); let (width, _height) = layout.size(); - // Using width and height of the text, we can properly possition it within + // Using width and height of the text, we can properly position it within // our canvas. cr.move_to( -(f64::from(width) / f64::from(pango::SCALE)) / 2.0, @@ -241,7 +241,7 @@ fn create_pipeline() -> Result { // will then change its caps and we use the notification about this change to // resize our canvas's size. // Another possibility for when this might happen is, when our video is a network - // stream that dynamically changes resolution when enough bandwith is available. + // stream that dynamically changes resolution when enough bandwidth is available. overlay.connect_closure( "caps-changed", false, diff --git a/examples/src/bin/pango-cairo.rs b/examples/src/bin/pango-cairo.rs index 74e807ff2..df8030c47 100644 --- a/examples/src/bin/pango-cairo.rs +++ b/examples/src/bin/pango-cairo.rs @@ -134,7 +134,7 @@ fn create_pipeline() -> Result { // The image we draw (the text) will be static, but we will change the // transformation on the drawing context, which rotates and shifts everything - // that we draw afterwards. Like this, we have no complicated calulations + // that we draw afterwards. Like this, we have no complicated calculations // in the actual drawing below. // Calling multiple transformation methods after each other will apply the // new transformation on top. If you repeat the cr.rotate(angle) line below @@ -163,7 +163,7 @@ fn create_pipeline() -> Result { // to end up as a 200x100 rectangle would now be 100x200. pangocairo::functions::update_layout(&cr, layout); let (width, _height) = layout.size(); - // Using width and height of the text, we can properly possition it within + // Using width and height of the text, we can properly position it within // our canvas. cr.move_to( -(f64::from(width) / f64::from(pango::SCALE)) / 2.0, @@ -187,7 +187,7 @@ fn create_pipeline() -> Result { // will then change its caps and we use the notification about this change to // resize our canvas's size. // Another possibility for when this might happen is, when our video is a network - // stream that dynamically changes resolution when enough bandwith is available. + // stream that dynamically changes resolution when enough bandwidth is available. overlay.connect("caps-changed", false, move |args| { let _overlay = args[0].get::().unwrap(); let caps = args[1].get::().unwrap(); diff --git a/examples/src/bin/playbin.rs b/examples/src/bin/playbin.rs index 70885009e..0a9836178 100644 --- a/examples/src/bin/playbin.rs +++ b/examples/src/bin/playbin.rs @@ -59,7 +59,7 @@ fn example_main() { let playbin = values[0] .get::() .expect("playbin \"audio-tags-changed\" signal values[1]"); - // This gets the index of the stream that changed. This is neccessary, since + // This gets the index of the stream that changed. This is necessary, since // there could e.g. be multiple audio streams (english, spanish, ...). let idx = values[1] .get::() diff --git a/examples/src/bin/rtsp-server-record.rs b/examples/src/bin/rtsp-server-record.rs index 4de6f4609..e252b2408 100644 --- a/examples/src/bin/rtsp-server-record.rs +++ b/examples/src/bin/rtsp-server-record.rs @@ -50,7 +50,7 @@ fn main_loop() -> Result<(), Error> { &"user", )]); let basic = gst_rtsp_server::RTSPAuth::make_basic("user", "password"); - // For propery authentication, we want to use encryption. And there's no + // For proper authentication, we want to use encryption. And there's no // encryption without a certificate! let cert = gio::TlsCertificate::from_pem( "-----BEGIN CERTIFICATE-----\ diff --git a/examples/src/bin/subclass.rs b/examples/src/bin/subclass.rs index b90c87b84..cb11e2381 100644 --- a/examples/src/bin/subclass.rs +++ b/examples/src/bin/subclass.rs @@ -60,7 +60,7 @@ mod fir_filter { // Implementation of gst::Element virtual methods impl ElementImpl for FirFilter { // The element specific metadata. This information is what is visible from - // gst-inspect-1.0 and can also be programatically retrieved from the gst::Registry + // gst-inspect-1.0 and can also be programmatically retrieved from the gst::Registry // after initial registration without having to load the plugin in memory. fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { static ELEMENT_METADATA: Lazy = Lazy::new(|| { diff --git a/gstreamer-pbutils/Gir.toml b/gstreamer-pbutils/Gir.toml index bd5383d77..da0610e14 100644 --- a/gstreamer-pbutils/Gir.toml +++ b/gstreamer-pbutils/Gir.toml @@ -191,7 +191,7 @@ status = "generate" name = "is_missing_plugin_message" ignore = true - # Initialization is handled implicitely + # Initialization is handled implicitly [[object.function]] name = "pb_utils_init" ignore = true diff --git a/gstreamer-video/src/video_format_info.rs b/gstreamer-video/src/video_format_info.rs index 3f1994145..6192cebb4 100644 --- a/gstreamer-video/src/video_format_info.rs +++ b/gstreamer-video/src/video_format_info.rs @@ -400,7 +400,7 @@ impl Ord for VideoFormatInfo { .then_with(|| self.h_sub().cmp(other.h_sub()).reverse()) .then_with(|| self.n_planes().cmp(&other.n_planes())) .then_with(|| { - // Format using native endianess is considered as bigger + // Format using native endianness is considered as bigger match ( self.flags().contains(crate::VideoFormatFlags::LE), other.flags().contains(crate::VideoFormatFlags::LE), diff --git a/gstreamer/src/buffer_serde.rs b/gstreamer/src/buffer_serde.rs index a011d46a9..e1079e0ca 100644 --- a/gstreamer/src/buffer_serde.rs +++ b/gstreamer/src/buffer_serde.rs @@ -9,7 +9,7 @@ use serde_bytes::{ByteBuf, Bytes}; use crate::{Buffer, BufferFlags, BufferRef, ClockTime}; -// TODO: try `Either` to merge the base reprensentations for ser and de +// TODO: try `Either` to merge the base representations for ser and de // while avoiding unneeded copy impl Serialize for BufferRef { diff --git a/gstreamer/src/date_time.rs b/gstreamer/src/date_time.rs index 12e75fee8..8500178d8 100644 --- a/gstreamer/src/date_time.rs +++ b/gstreamer/src/date_time.rs @@ -302,7 +302,7 @@ impl DateTime { .and_then(|d| d.to_utc()) .map(|d| d.into()) } else { - // It would be cheaper to build a `glib::DateTime` direcly, unfortunetaly + // It would be cheaper to build a `glib::DateTime` directly, unfortunetaly // this would require using `glib::TimeZone::new_offset` which is feature-gated // to `glib/v2_58`. So we need to build a new `gst::DateTime` with `0f64` // and then discard seconds again diff --git a/gstreamer/src/format/compatible.rs b/gstreamer/src/format/compatible.rs index 2721e0723..6e12f0239 100644 --- a/gstreamer/src/format/compatible.rs +++ b/gstreamer/src/format/compatible.rs @@ -88,13 +88,13 @@ pub trait CompatibleFormattedValue { /// Returns `Ok(self)` with its type restored if it is compatible with the format of `V`. /// /// When possible, prefer using [`Self::try_into_checked`] which - /// reduces the risk of missuse. + /// reduces the risk of misuse. /// /// When used with compatible [`SpecificFormattedValue`]s, checks /// are enforced by the type system, no runtime checks are performed. /// /// When used with [`SpecificFormattedValue`] as a parameter and - /// a [`GenericFormattedValue`] as `Self`, a runtime check is perfomed + /// a [`GenericFormattedValue`] as `Self`, a runtime check is performed /// against the default format of the parameter. If the check fails, /// `Err(FormattedValueError)` is returned. /// diff --git a/gstreamer/src/format/mod.rs b/gstreamer/src/format/mod.rs index 87cf07903..013f68fa6 100644 --- a/gstreamer/src/format/mod.rs +++ b/gstreamer/src/format/mod.rs @@ -110,7 +110,7 @@ //! assert_eq!(*(8.mebibytes()), 8 * 1024 * 1024); //! assert_eq!(*(4.gibibytes()), 4 * 1024 * 1024 * 1024); //! -//! // ... and the macthing constants: +//! // ... and the matching constants: //! assert_eq!(512 * Bytes::KiB, 512.kibibytes()); //! //! // `Percent` can be built from a percent integer value: diff --git a/gstreamer/src/format/signed.rs b/gstreamer/src/format/signed.rs index bcd6bc390..6b0183f7f 100644 --- a/gstreamer/src/format/signed.rs +++ b/gstreamer/src/format/signed.rs @@ -9,7 +9,7 @@ use crate::utils::Displayable; /// A signed wrapper. /// /// This wrapper allows representing a signed value from a type -/// which is originaly unsigned. In C APIs, this is represented +/// which is originally unsigned. In C APIs, this is represented /// by a tuple with a signed integer positive or negative and /// the absolute value. #[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] diff --git a/gstreamer/src/tags_serde.rs b/gstreamer/src/tags_serde.rs index 7fd38b05c..38d0e38ab 100644 --- a/gstreamer/src/tags_serde.rs +++ b/gstreamer/src/tags_serde.rs @@ -38,7 +38,7 @@ macro_rules! ser_opt_tag ( ); ); -// Note: unlike `Value`s, `Tag`s with optional `Type` `String` & `Date` values are guarenteed +// Note: unlike `Value`s, `Tag`s with optional `Type` `String` & `Date` values are guaranteed // to be Non-null and non-empty in the C API. See: // https://gitlab.freedesktop.org/gstreamer/gstreamer/blob/d90d771a9a512381315f7694c3a50b152035f3cb/gst/gststructure.c#L810-853 diff --git a/tutorials/src/bin/basic-tutorial-8.rs b/tutorials/src/bin/basic-tutorial-8.rs index 689e1d137..a91487f66 100644 --- a/tutorials/src/bin/basic-tutorial-8.rs +++ b/tutorials/src/bin/basic-tutorial-8.rs @@ -198,7 +198,7 @@ fn main() { let mut samples = buffer.map_writable().unwrap(); let samples = samples.as_mut_slice_of::().unwrap(); - // Generate some psychodelic waveforms + // Generate some psychedelic waveforms data.c += data.d; data.d -= data.c / 1000.0; let freq = 1100.0 + 1000.0 * data.d; diff --git a/tutorials/src/bin/playback-tutorial-3.rs b/tutorials/src/bin/playback-tutorial-3.rs index 308574965..21155092a 100644 --- a/tutorials/src/bin/playback-tutorial-3.rs +++ b/tutorials/src/bin/playback-tutorial-3.rs @@ -107,7 +107,7 @@ fn tutorial_main() -> Result<(), Error> { let mut samples = buffer.map_writable().unwrap(); let samples = samples.as_mut_slice_of::().unwrap(); - // Generate some psychodelic waveforms + // Generate some psychedelic waveforms data.c += data.d; data.d -= data.c / 1000.0; let freq = 1100.0 + 1000.0 * data.d;