Skip to content

Commit

Permalink
Fix clippy?
Browse files Browse the repository at this point in the history
  • Loading branch information
mikayla-maki committed Nov 27, 2024
1 parent a1a35a9 commit 841262d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
1 change: 1 addition & 0 deletions crates/live_kit_client/examples/test_app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ use live_kit_client::{

use live_kit_server::token::{self, VideoGrant};
use log::LevelFilter;
use postage::stream::Stream as _;
use simplelog::SimpleLogger;

actions!(live_kit_client, [Quit]);
Expand Down
27 changes: 13 additions & 14 deletions crates/live_kit_client/src/live_kit_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ use webrtc::{
video_stream::native::NativeVideoStream,
};

// TODO
// #[cfg(all(not(any(test, feature = "test-support")), not(target_os = "windows")))]
#[cfg(all(not(any(test, feature = "test-support")), not(target_os = "windows")))]
pub use livekit::*;
// #[cfg(any(test, feature = "test-support", target_os = "windows"))]
// pub use test::*;
#[cfg(any(test, feature = "test-support", target_os = "windows"))]
pub use test::*;

pub use remote_video_track_view::{RemoteVideoTrackView, RemoteVideoTrackViewEvent};

Expand Down Expand Up @@ -177,7 +176,7 @@ pub fn capture_local_audio_track(
let (frame_tx, mut frame_rx) = futures::channel::mpsc::unbounded();
let (_thread_handle, thread_handle_rx) = std::sync::mpsc::channel();

// We can't track device changes here, becuase the LocalAudioTrack isn't controlled
// We can't track device changes here, because the LocalAudioTrack isn't controlled
// by this function, and doesn't have a resampler built in
let (device, config) = default_device(false)?;

Expand Down Expand Up @@ -325,7 +324,7 @@ fn get_default_output() -> anyhow::Result<(cpal::Device, cpal::SupportedStreamCo
fn start_output_stream(
output_config: cpal::SupportedStreamConfig,
output_device: cpal::Device,
track: &prelude::RemoteAudioTrack,
track: &track::RemoteAudioTrack,
background_executor: &BackgroundExecutor,
) -> (Task<()>, std::sync::mpsc::Sender<()>) {
let buffer = Arc::new(Mutex::new(VecDeque::<i16>::new()));
Expand All @@ -337,7 +336,7 @@ fn start_output_stream(
output_config.channels() as i32,
);

let recieve_task = background_executor.spawn({
let receive_task = background_executor.spawn({
let buffer = buffer.clone();
async move {
const MS_OF_BUFFER: u32 = 50;
Expand Down Expand Up @@ -399,7 +398,7 @@ fn start_output_stream(
end_on_drop_rx.recv().ok();
});

(recieve_task, thread)
(receive_task, thread)
}

#[cfg(target_os = "windows")]
Expand Down Expand Up @@ -456,7 +455,7 @@ fn video_frame_buffer_to_webrtc(_frame: ScreenCaptureFrame) -> Option<impl AsRef
None as Option<Box<dyn VideoBuffer>>
}

trait DefaultOutputDeviceChangeListenerApi: Stream<Item = ()> + Sized {
trait DeviceChangeListenerApi: Stream<Item = ()> + Sized {
fn new(input: bool) -> Result<Self>;
}

Expand All @@ -473,7 +472,7 @@ mod macos {
use futures::{channel::mpsc::UnboundedReceiver, StreamExt};
use util::defer;

use crate::DefaultOutputDeviceChangeListenerApi;
use crate::DeviceChangeListenerApi;

/// Implementation from: https://github.com/zed-industries/cpal/blob/fd8bc2fd39f1f5fdee5a0690656caff9a26d9d50/src/host/coreaudio/macos/property_listener.rs#L15
pub struct CoreAudioDefaultDeviceChangeListener {
Expand All @@ -498,7 +497,7 @@ mod macos {
0
}

impl DefaultOutputDeviceChangeListenerApi for CoreAudioDefaultDeviceChangeListener {
impl DeviceChangeListenerApi for CoreAudioDefaultDeviceChangeListener {
fn new(input: bool) -> gpui::Result<Self> {
let (tx, rx) = futures::channel::mpsc::unbounded();

Expand Down Expand Up @@ -573,11 +572,11 @@ type DeviceChangeListener = macos::CoreAudioDefaultDeviceChangeListener;
mod noop_change_listener {
use std::task::Poll;

use crate::DefaultOutputDeviceChangeListenerApi;
use crate::DeviceChangeListenerApi;

pub struct NoopOutputDeviceChangelistener {}

impl DefaultOutputDeviceChangeListenerApi for NoopOutputDeviceChangelistener {
impl DeviceChangeListenerApi for NoopOutputDeviceChangelistener {
fn new(_input: bool) -> anyhow::Result<Self> {
Ok(NoopOutputDeviceChangelistener {})
}
Expand All @@ -596,4 +595,4 @@ mod noop_change_listener {
}

#[cfg(not(target_os = "macos"))]
type OutputDeviceChangeListener = noop_change_listener::NoopOutputDeviceChangelistener;
type DeviceChangeListener = noop_change_listener::NoopOutputDeviceChangelistener;

0 comments on commit 841262d

Please sign in to comment.