Skip to content

Commit

Permalink
remove mutable self methods
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarriba committed Jan 2, 2025
1 parent df6a0f6 commit 934498d
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions crates/kornia-io/src/stream/capture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl StreamCapture {
}

/// Starts the stream capture pipeline and processes messages on the bus.
pub fn start(&mut self) -> Result<(), StreamCaptureError> {
pub fn start(&self) -> Result<(), StreamCaptureError> {
self.pipeline.set_state(gst::State::Playing)?;

let bus = self
Expand Down Expand Up @@ -63,7 +63,7 @@ impl StreamCapture {
}

/// Closes the stream capture pipeline.
pub fn close(&mut self) -> Result<(), StreamCaptureError> {
pub fn close(&self) -> Result<(), StreamCaptureError> {
let res = self.pipeline.send_event(gst::event::Eos::new());
if !res {
return Err(StreamCaptureError::SendEosError);
Expand Down
2 changes: 1 addition & 1 deletion examples/features/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {

// create a webcam capture object with camera id 0
// and force the image size to 640x480
let mut webcam = V4L2CameraConfig::new().with_size(size).build()?;
let webcam = V4L2CameraConfig::new().with_size(size).build()?;

// start the background pipeline
webcam.start()?;
Expand Down
2 changes: 1 addition & 1 deletion examples/filters/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {

// create a webcam capture object with camera id 0
// and force the image size to 640x480
let mut webcam = V4L2CameraConfig::new().with_size(size).build()?;
let webcam = V4L2CameraConfig::new().with_size(size).build()?;

// start the background pipeline
webcam.start()?;
Expand Down
2 changes: 1 addition & 1 deletion examples/rtspcam/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let rec = rerun::RecordingStreamBuilder::new("Kornia Rtsp Stream Capture App").spawn()?;

//// create a stream capture object
let mut capture = RTSPCameraConfig::new()
let capture = RTSPCameraConfig::new()
.with_settings(
&args.username,
&args.password,
Expand Down
2 changes: 1 addition & 1 deletion examples/video_write/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {

// create a webcam capture object with camera id 0
// and force the image size to 640x480
let mut webcam = V4L2CameraConfig::new()
let webcam = V4L2CameraConfig::new()
.with_camera_id(args.camera_id)
.with_fps(args.fps as u32)
.with_size(frame_size)
Expand Down
2 changes: 1 addition & 1 deletion examples/webcam/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {

// create a webcam capture object with camera id 0
// and force the image size to 640x480
let mut webcam = V4L2CameraConfig::new()
let webcam = V4L2CameraConfig::new()
.with_camera_id(args.camera_id)
.with_fps(args.fps)
.with_size(ImageSize {
Expand Down
2 changes: 1 addition & 1 deletion kornia-viz/src/bin/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct KorniaApp {

impl Default for KorniaApp {
fn default() -> Self {
let mut capture = kornia::io::stream::V4L2CameraConfig::new()
let capture = kornia::io::stream::V4L2CameraConfig::new()
.with_camera_id(0)
.build()
.unwrap();
Expand Down

0 comments on commit 934498d

Please sign in to comment.