collab: Add screen selector (#31506)
Instead of selecting a screen to share arbitrarily, we'll now allow user to select the screen to share. Note that sharing multiple screens at the time is still not supported (though prolly not too far-fetched). Related to #4666  Release Notes: - Added screen selector dropdown to screen share button --------- Co-authored-by: Kirill Bulatov <kirill@zed.dev> Co-authored-by: Cole Miller <cole@zed.dev>
This commit is contained in:
parent
57ab09c2da
commit
88af35fe47
26 changed files with 473 additions and 145 deletions
|
@ -326,11 +326,11 @@ pub(crate) async fn capture_local_video_track(
|
|||
capture_source: &dyn ScreenCaptureSource,
|
||||
cx: &mut gpui::AsyncApp,
|
||||
) -> Result<(crate::LocalVideoTrack, Box<dyn ScreenCaptureStream>)> {
|
||||
let resolution = capture_source.resolution()?;
|
||||
let metadata = capture_source.metadata()?;
|
||||
let track_source = gpui_tokio::Tokio::spawn(cx, async move {
|
||||
NativeVideoSource::new(VideoResolution {
|
||||
width: resolution.width.0 as u32,
|
||||
height: resolution.height.0 as u32,
|
||||
width: metadata.resolution.width.0 as u32,
|
||||
height: metadata.resolution.height.0 as u32,
|
||||
})
|
||||
})?
|
||||
.await?;
|
||||
|
|
|
@ -5,7 +5,7 @@ use crate::{
|
|||
};
|
||||
use anyhow::Result;
|
||||
use collections::HashMap;
|
||||
use gpui::{AsyncApp, ScreenCaptureSource, ScreenCaptureStream};
|
||||
use gpui::{AsyncApp, ScreenCaptureSource, ScreenCaptureStream, TestScreenCaptureStream};
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct LocalParticipant {
|
||||
|
@ -119,7 +119,3 @@ impl RemoteParticipant {
|
|||
self.identity.clone()
|
||||
}
|
||||
}
|
||||
|
||||
struct TestScreenCaptureStream;
|
||||
|
||||
impl gpui::ScreenCaptureStream for TestScreenCaptureStream {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue