This PR contains a set of changes for improving FreeBSD support (#15309, #29550) and is a kind of follow up to the PR #20480 which added an initial support for FreeBSD. A summary of changes is as follows: - Add some more freebsd conditionals which seem missing in the previous PR. - Implement `anonymous_fd()` and `current_path()` functions for FreeBSD. - Improve detection of FreeBSD in telemetry and GPU detection. - Temporarily disable LiveKit/WebRTC support to make build succeed. - Remove support for flatpak since it is Linux-only packaging format. Adding `RUSTFLAGS="-C link-dead-code"` does not seem necessary anymore. It builds fine without the flag. Known issues: - Integrated terminal is painfully laggy and virtually unusable in my environment. This might be specific to my setup. - I cannot input Japanese using IME. When I type characters, they appear on the screen. But when I hit return key, they disappears. Seems the same issue as #15409. My environment is MATE desktop on X11 on FreeBSD 14.2 on Intel Core i5-7260U integrated graphics. P.S. For those who might be interested, a work-in-progress FreeBSD port and binary packages are available at https://github.com/tagattie/FreeBSD-Zed Release Notes: - N/A --------- Co-authored-by: Peter Tripp <peter@zed.dev>
165 lines
4.1 KiB
Rust
165 lines
4.1 KiB
Rust
use collections::HashMap;
|
|
|
|
mod remote_video_track_view;
|
|
pub use remote_video_track_view::{RemoteVideoTrackView, RemoteVideoTrackViewEvent};
|
|
|
|
#[cfg(not(any(
|
|
test,
|
|
feature = "test-support",
|
|
any(all(target_os = "windows", target_env = "gnu"), target_os = "freebsd")
|
|
)))]
|
|
mod livekit_client;
|
|
#[cfg(not(any(
|
|
test,
|
|
feature = "test-support",
|
|
any(all(target_os = "windows", target_env = "gnu"), target_os = "freebsd")
|
|
)))]
|
|
pub use livekit_client::*;
|
|
|
|
#[cfg(any(
|
|
test,
|
|
feature = "test-support",
|
|
any(all(target_os = "windows", target_env = "gnu"), target_os = "freebsd")
|
|
))]
|
|
mod mock_client;
|
|
#[cfg(any(
|
|
test,
|
|
feature = "test-support",
|
|
any(all(target_os = "windows", target_env = "gnu"), target_os = "freebsd")
|
|
))]
|
|
pub mod test;
|
|
#[cfg(any(
|
|
test,
|
|
feature = "test-support",
|
|
any(all(target_os = "windows", target_env = "gnu"), target_os = "freebsd")
|
|
))]
|
|
pub use mock_client::*;
|
|
|
|
#[derive(Debug, Clone)]
|
|
pub enum Participant {
|
|
Local(LocalParticipant),
|
|
Remote(RemoteParticipant),
|
|
}
|
|
|
|
#[derive(Debug, Clone)]
|
|
pub enum TrackPublication {
|
|
Local(LocalTrackPublication),
|
|
Remote(RemoteTrackPublication),
|
|
}
|
|
|
|
impl TrackPublication {
|
|
pub fn sid(&self) -> TrackSid {
|
|
match self {
|
|
TrackPublication::Local(local) => local.sid(),
|
|
TrackPublication::Remote(remote) => remote.sid(),
|
|
}
|
|
}
|
|
|
|
pub fn is_muted(&self) -> bool {
|
|
match self {
|
|
TrackPublication::Local(local) => local.is_muted(),
|
|
TrackPublication::Remote(remote) => remote.is_muted(),
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Clone, Debug)]
|
|
pub enum RemoteTrack {
|
|
Audio(RemoteAudioTrack),
|
|
Video(RemoteVideoTrack),
|
|
}
|
|
|
|
impl RemoteTrack {
|
|
pub fn sid(&self) -> TrackSid {
|
|
match self {
|
|
RemoteTrack::Audio(remote_audio_track) => remote_audio_track.sid(),
|
|
RemoteTrack::Video(remote_video_track) => remote_video_track.sid(),
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Clone, Debug)]
|
|
pub enum LocalTrack {
|
|
Audio(LocalAudioTrack),
|
|
Video(LocalVideoTrack),
|
|
}
|
|
|
|
#[derive(Clone, Debug)]
|
|
#[non_exhaustive]
|
|
pub enum RoomEvent {
|
|
ParticipantConnected(RemoteParticipant),
|
|
ParticipantDisconnected(RemoteParticipant),
|
|
LocalTrackPublished {
|
|
publication: LocalTrackPublication,
|
|
track: LocalTrack,
|
|
participant: LocalParticipant,
|
|
},
|
|
LocalTrackUnpublished {
|
|
publication: LocalTrackPublication,
|
|
participant: LocalParticipant,
|
|
},
|
|
LocalTrackSubscribed {
|
|
track: LocalTrack,
|
|
},
|
|
TrackSubscribed {
|
|
track: RemoteTrack,
|
|
publication: RemoteTrackPublication,
|
|
participant: RemoteParticipant,
|
|
},
|
|
TrackUnsubscribed {
|
|
track: RemoteTrack,
|
|
publication: RemoteTrackPublication,
|
|
participant: RemoteParticipant,
|
|
},
|
|
TrackSubscriptionFailed {
|
|
participant: RemoteParticipant,
|
|
// error: livekit::track::TrackError,
|
|
track_sid: TrackSid,
|
|
},
|
|
TrackPublished {
|
|
publication: RemoteTrackPublication,
|
|
participant: RemoteParticipant,
|
|
},
|
|
TrackUnpublished {
|
|
publication: RemoteTrackPublication,
|
|
participant: RemoteParticipant,
|
|
},
|
|
TrackMuted {
|
|
participant: Participant,
|
|
publication: TrackPublication,
|
|
},
|
|
TrackUnmuted {
|
|
participant: Participant,
|
|
publication: TrackPublication,
|
|
},
|
|
RoomMetadataChanged {
|
|
old_metadata: String,
|
|
metadata: String,
|
|
},
|
|
ParticipantMetadataChanged {
|
|
participant: Participant,
|
|
old_metadata: String,
|
|
metadata: String,
|
|
},
|
|
ParticipantNameChanged {
|
|
participant: Participant,
|
|
old_name: String,
|
|
name: String,
|
|
},
|
|
ParticipantAttributesChanged {
|
|
participant: Participant,
|
|
changed_attributes: HashMap<String, String>,
|
|
},
|
|
ActiveSpeakersChanged {
|
|
speakers: Vec<Participant>,
|
|
},
|
|
ConnectionStateChanged(ConnectionState),
|
|
Connected {
|
|
participants_with_tracks: Vec<(RemoteParticipant, Vec<RemoteTrackPublication>)>,
|
|
},
|
|
Disconnected {
|
|
reason: &'static str,
|
|
},
|
|
Reconnecting,
|
|
Reconnected,
|
|
}
|