Skip to content

Commit

Permalink
🎨 Rename fns
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbrunsfeld committed Jun 22, 2024
1 parent 2f9c15f commit 1cc0594
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions crates/call/src/room.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,7 @@ impl Room {

cx.spawn(move |this, mut cx| async move {
let (track, stream) =
livekit::create_audio_track_from_microphone(&cx.background_executor()).await?;
livekit::capture_local_audio_track(&cx.background_executor()).await?;

let publication = participant
.publish_track(
Expand Down Expand Up @@ -1403,8 +1403,7 @@ impl Room {
let sources = sources.await??;
let source = sources.first().ok_or_else(|| anyhow!("no display found"))?;

let (track, _stream) =
livekit::create_video_track_from_screen_capture_source(&**source).await?;
let (track, _stream) = livekit::capture_local_video_track(&**source).await?;

let publication = participant
.publish_track(
Expand Down
4 changes: 2 additions & 2 deletions crates/live_kit_client/examples/test_app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use gpui::{
WindowHandle, WindowOptions,
};
use live_kit_client::{
create_audio_track_from_microphone,
capture_local_audio_track,
options::TrackPublishOptions,
play_remote_audio_track,
publication::LocalTrackPublication,
Expand Down Expand Up @@ -254,7 +254,7 @@ impl LivekitWindow {
} else {
let participant = self.room.local_participant();
cx.spawn(|this, mut cx| async move {
let track = create_audio_track_from_microphone(cx.background_executor());
let track = capture_local_audio_track(cx.background_executor());
let (track, stream) = track.await?;
let publication = participant
.publish_track(LocalTrack::Audio(track), TrackPublishOptions::default())
Expand Down
4 changes: 2 additions & 2 deletions crates/live_kit_client/src/live_kit_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub fn init(dispatcher: Arc<dyn gpui::PlatformDispatcher>) {
livekit::dispatcher::set_dispatcher(Dispatcher(dispatcher));
}

pub async fn create_video_track_from_screen_capture_source(
pub async fn capture_local_video_track(
capture_source: &dyn ScreenCaptureSource,
) -> Result<(track::LocalVideoTrack, Box<dyn ScreenCaptureStream>)> {
let track_source = NativeVideoSource::new(VideoResolution {
Expand Down Expand Up @@ -75,7 +75,7 @@ pub async fn create_video_track_from_screen_capture_source(
))
}

pub async fn create_audio_track_from_microphone(
pub async fn capture_local_audio_track(
cx: &BackgroundExecutor,
) -> Result<(track::LocalAudioTrack, AudioStream)> {
let host = cpal::default_host();
Expand Down

0 comments on commit 1cc0594

Please sign in to comment.