History

Fix post-merge compile errors

Nathan Sobo committed 3 years ago

Commit 2079cd61 parent db9ccd74 files · +18 −17Browse files

Unified · Split

4 files
  1. crates/call2/src/room.rs +11 −10
  2. crates/live_kit_client2/examples/test_app.rs +2 −2
  3. crates/live_kit_client2/src/test.rs +3 −3
  4. crates/multi_buffer2/src/multi_buffer2.rs +2 −2
crates/call2/src/room.rs+11−10
@@ -134,7 +134,7 @@ impl Room { · 133 unmodified lines
134 }134 }
135 });135 });
136 136
137 let _maintain_video_tracks = cx.spawn_on_main({137 let _maintain_video_tracks = cx.spawn({
138 let room = room.clone();138 let room = room.clone();
139 move |this, mut cx| async move {139 move |this, mut cx| async move {
140 let mut track_video_changes = room.remote_video_track_updates();140 let mut track_video_changes = room.remote_video_track_updates();
@@ -153,7 +153,7 @@ impl Room { · 12 unmodified lines
153 }153 }
154 });154 });
155 155
156 let _maintain_audio_tracks = cx.spawn_on_main({156 let _maintain_audio_tracks = cx.spawn({
157 let room = room.clone();157 let room = room.clone();
158 |this, mut cx| async move {158 |this, mut cx| async move {
159 let mut track_audio_changes = room.remote_audio_track_updates();159 let mut track_audio_changes = room.remote_audio_track_updates();
@@ -1301,7 +1301,9 @@ impl Room { · 1141 unmodified lines
1301 live_kit.room.unpublish_track(publication);1301 live_kit.room.unpublish_track(publication);
1302 } else {1302 } else {
1303 if muted {1303 if muted {
1304 cx.executor().spawn(publication.set_mute(muted)).detach();1304 cx.background_executor()
1305 .spawn(publication.set_mute(muted))
1306 .detach();
1305 }1307 }
1306 live_kit.microphone_track = LocalTrack::Published {1308 live_kit.microphone_track = LocalTrack::Published {
1307 track_publication: publication,1309 track_publication: publication,
@@ -1344,7 +1346,7 @@ impl Room { · 36 unmodified lines
1344 return Task::ready(Err(anyhow!("live-kit was not initialized")));1346 return Task::ready(Err(anyhow!("live-kit was not initialized")));
1345 };1347 };
1346 1348
1347 cx.spawn_on_main(move |this, mut cx| async move {1349 cx.spawn(move |this, mut cx| async move {
1348 let publish_track = async {1350 let publish_track = async {
1349 let displays = displays.await?;1351 let displays = displays.await?;
1350 let display = displays1352 let display = displays
@@ -1387,7 +1389,9 @@ impl Room { · 36 unmodified lines
1387 live_kit.room.unpublish_track(publication);1389 live_kit.room.unpublish_track(publication);
1388 } else {1390 } else {
1389 if muted {1391 if muted {
1390 cx.executor().spawn(publication.set_mute(muted)).detach();1392 cx.background_executor()
1393 .spawn(publication.set_mute(muted))
1394 .detach();
1391 }1395 }
1392 live_kit.screen_track = LocalTrack::Published {1396 live_kit.screen_track = LocalTrack::Published {
1393 track_publication: publication,1397 track_publication: publication,
@@ -1454,14 +1458,11 @@ impl Room { · 60 unmodified lines
1454 .remote_audio_track_publications(&participant.user.id.to_string())1458 .remote_audio_track_publications(&participant.user.id.to_string())
1455 {1459 {
1456 let deafened = live_kit.deafened;1460 let deafened = live_kit.deafened;
1457 tasks.push(1461 tasks.push(cx.foreground_executor().spawn(track.set_enabled(!deafened)));
1458 cx.executor()
1459 .spawn_on_main(move || track.set_enabled(!deafened)),
1460 );
1461 }1462 }
1462 }1463 }
1463 1464
1464 Ok(cx.executor().spawn_on_main(|| async {1465 Ok(cx.foreground_executor().spawn(async move {
1465 if let Some(mute_task) = mute_task {1466 if let Some(mute_task) = mute_task {
1466 mute_task.await?;1467 mute_task.await?;
1467 }1468 }
crates/live_kit_client2/examples/test_app.rs+2−2
@@ -42,7 +42,7 @@ fn main() { · 41 unmodified lines
42 let live_kit_key = std::env::var("LIVE_KIT_KEY").unwrap_or("devkey".into());42 let live_kit_key = std::env::var("LIVE_KIT_KEY").unwrap_or("devkey".into());
43 let live_kit_secret = std::env::var("LIVE_KIT_SECRET").unwrap_or("secret".into());43 let live_kit_secret = std::env::var("LIVE_KIT_SECRET").unwrap_or("secret".into());
44 44
45 cx.spawn_on_main(|cx| async move {45 cx.spawn(|cx| async move {
46 let user_a_token = token::create(46 let user_a_token = token::create(
47 &live_kit_key,47 &live_kit_key,
48 &live_kit_secret,48 &live_kit_secret,
@@ -104,7 +104,7 @@ fn main() { · 55 unmodified lines
104 }104 }
105 105
106 println!("Pausing for 5 seconds to test audio, make some noise!");106 println!("Pausing for 5 seconds to test audio, make some noise!");
107 let timer = cx.executor().timer(Duration::from_secs(5));107 let timer = cx.background_executor().timer(Duration::from_secs(5));
108 timer.await;108 timer.await;
109 let remote_audio_track = room_b109 let remote_audio_track = room_b
110 .remote_audio_tracks("test-participant-1")110 .remote_audio_tracks("test-participant-1")
crates/live_kit_client2/src/test.rs+3−3
@@ -2,7 +2,7 @@ use anyhow::{anyhow, Context, Result}; · 1 unmodified line
2use async_trait::async_trait;2use async_trait::async_trait;
3use collections::{BTreeMap, HashMap};3use collections::{BTreeMap, HashMap};
4use futures::Stream;4use futures::Stream;
5use gpui2::Executor;5use gpui2::BackgroundExecutor;
6use live_kit_server::token;6use live_kit_server::token;
7use media::core_video::CVImageBuffer;7use media::core_video::CVImageBuffer;
8use parking_lot::Mutex;8use parking_lot::Mutex;
@@ -16,7 +16,7 @@ pub struct TestServer { · 7 unmodified lines
16 pub api_key: String,16 pub api_key: String,
17 pub secret_key: String,17 pub secret_key: String,
18 rooms: Mutex<HashMap<String, TestServerRoom>>,18 rooms: Mutex<HashMap<String, TestServerRoom>>,
19 executor: Arc<Executor>,19 executor: Arc<BackgroundExecutor>,
20}20}
21 21
22impl TestServer {22impl TestServer {
@@ -24,7 +24,7 @@ impl TestServer { · 1 unmodified line
24 url: String,24 url: String,
25 api_key: String,25 api_key: String,
26 secret_key: String,26 secret_key: String,
27 executor: Arc<Executor>,27 executor: Arc<BackgroundExecutor>,
28 ) -> Result<Arc<TestServer>> {28 ) -> Result<Arc<TestServer>> {
29 let mut servers = SERVERS.lock();29 let mut servers = SERVERS.lock();
30 if servers.contains_key(&url) {30 if servers.contains_key(&url) {
crates/multi_buffer2/src/multi_buffer2.rs+2−2
@@ -878,7 +878,7 @@ impl MultiBuffer { · 877 unmodified lines
878 cx.spawn(move |this, mut cx| async move {878 cx.spawn(move |this, mut cx| async move {
879 let mut excerpt_ranges = Vec::new();879 let mut excerpt_ranges = Vec::new();
880 let mut range_counts = Vec::new();880 let mut range_counts = Vec::new();
881 cx.executor()881 cx.background_executor()
882 .scoped(|scope| {882 .scoped(|scope| {
883 scope.spawn(async {883 scope.spawn(async {
884 let (ranges, counts) =884 let (ranges, counts) =
@@ -4177,7 +4177,7 @@ mod tests { · 3292 unmodified lines
4177 let guest_buffer = cx.build_model(|cx| {4177 let guest_buffer = cx.build_model(|cx| {
4178 let state = host_buffer.read(cx).to_proto();4178 let state = host_buffer.read(cx).to_proto();
4179 let ops = cx4179 let ops = cx
4180 .executor()4180 .background_executor()
4181 .block(host_buffer.read(cx).serialize_ops(None, cx));4181 .block(host_buffer.read(cx).serialize_ops(None, cx));
4182 let mut buffer = Buffer::from_proto(1, state, None).unwrap();4182 let mut buffer = Buffer::from_proto(1, state, None).unwrap();
4183 buffer4183 buffer

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t