#![cfg_attr(test, allow(clippy::unwrap_used, clippy::expect_used))]
mod api;
#[cfg(feature = "audio-core")]
mod audio;
mod call;
mod config;
pub mod device;
pub mod e2ee;
mod engine;
pub mod gateway;
mod noise;
mod pc;
mod provider;
#[cfg(feature = "rust-crypto")]
mod rust_crypto;
mod signal;
pub mod stats;
mod transport;
mod video;
#[cfg(feature = "audio")]
pub use audio::platform_audio_config;
#[cfg(feature = "audio-core")]
pub use audio::{
AUDIO_BACKEND, AudioBridge, AudioBridgeError, AudioSession, BridgeLevels, SessionEvent,
};
pub use call::{
Call, CallClient, CallCounters, CallError, CallErrorEvent, CallEvent, CallLeaver, CallMoved,
CallRecording, CallSecurity, CallSnapshot, CallState, EndReason, FrameSender, FrameStream,
OpusFrame, Participant, RecordingConsent, RecordingMember, RecvItem, RecvOpus, ServerControls,
Speaking,
};
#[cfg(feature = "testing")]
pub use config::TestingOverrides;
pub use config::{ClientConfig, default_video_h264};
#[cfg(feature = "audio-core")]
pub use kessel_audio;
#[cfg(feature = "video-core")]
pub use kessel_video;
#[cfg(feature = "audio-core")]
pub use noise::NoiseRemovalControl;
#[cfg(feature = "noise-bench")]
pub use noise::bench as noise_bench;
#[cfg(feature = "noise-probe")]
pub use noise::probe as noise_probe;
pub use noise::{
CaptureDspSched, CaptureDspSchedError, CaptureDspSchedFallback, CaptureDspSchedMode,
CaptureDspScheduling, CaptureStageClock, CaptureTransient, NoiseDfn3State, NoiseModel,
NoiseRemoval, NoiseRemovalReason, NoiseRemovalState, NoiseStepDownReason, PhoneAudioMode,
};
#[cfg(feature = "dfn3")]
pub use noise::{DFN3_IDLE_UNLOAD, Dfn3LoadInfo};
pub use provider::{
AnswerError, BoxFuture, CONSENT_UNSUPPORTED, CallCredential, ConsentAnswer, ConsentRequired,
DmCall, JoinAnswer, JoinProvider, JoinRequest, ProviderError, RECORDING_UNSUPPORTED,
RecordingControl, RecordingRequest, RejoinReason,
};
pub use rustls;
#[cfg(feature = "dfn3")]
pub use sew_noise::dfn3::LoadError as Dfn3LoadError;
#[cfg(feature = "dfn3")]
pub use sew_noise::dfn3::WEIGHTS_FILE as DFN3_WEIGHTS_FILE;
pub use sew_proto::recording::{
ConsentPrompt, RecordUnavailable, Recording, RecordingNotice, RecordingRef, RecordingTrigger,
};
pub use stats::{
BeaconOutcome, BeforeFirstWindow, CallStatsReport, PlayoutSource, PlayoutStats, PlayoutTotals,
StatsWindow,
};
#[cfg(all(
feature = "video-core",
not(sew_apple_preview),
any(test, feature = "testing")
))]
#[doc(hidden)]
pub use video::FakePreview;
#[cfg(all(feature = "video-core", any(sew_preview_events, test)))]
pub use video::PreviewHandle;
#[cfg(feature = "video-core")]
pub use video::h264_encode_detection;
pub use video::{
BackupSpec, EncodedVideo, LayerRate, LayerSpec, LocalVideo, VideoCaps, VideoControl,
VideoError, VideoPublication, VideoPublish, VideoSendStats, VideoSender, plan_layers,
plan_screen_layers,
};
#[cfg(feature = "video-core")]
pub use video::{CameraFeed, CameraFrame, CameraTap, CameraTapItem, CameraTapSender};
#[cfg(feature = "video-core")]
#[allow(deprecated)]
pub use video::{
CameraRequest, CameraState, CodecPlan, PlannedCodec, SelfViewFrames, SelfViewItem, SourceFeed,
SourceNote, VideoBridge, choose_codec, choose_codecs,
};
#[cfg(feature = "video-core")]
pub use video::{
CameraSource, Capture, CaptureEnd, CaptureError, CaptureEvent, CaptureKind, CapturePause,
LocalFrame, PREVIEW_BITRATE_BPS, PREVIEW_FPS, PREVIEW_HEIGHT, PREVIEW_QUEUE, PREVIEW_WIDTH,
Preview, PreviewFrames, PreviewItem, ScreenChoice, ScreenPick, ScreenSource,
THUMBNAIL_MAX_WIDTH, VideoCapture, preview_codec, screen_constraints, thumbnail_png,
};
pub use video::{
CodecPreferenceReason, H264Detection, VideoCodecPreference, effective_publish_codec,
effective_publish_codec_under_policy,
};
#[cfg(all(feature = "testing", feature = "video-core"))]
pub use video::{FixtureBackend, FixtureError, FixtureH264, FixtureOptions};
pub use video::{
VideoCodec, VideoFrame, VideoFrameStream, VideoLayerInfo, VideoPause, VideoRecvItem, VideoSink,
VideoSinkSpec, VideoSource, VideoTrack, VideoTrackView,
};
#[cfg(all(
any(target_os = "ios", target_os = "android"),
not(feature = "rust-crypto")
))]
compile_error!(
"sew-call-client on iOS and Android needs the `mobile` feature (or `rust-crypto`): aws-lc-rs is not built for phones"
);
pub const CRYPTO_BACKEND: &str = if cfg!(feature = "rust-crypto") {
"rust-crypto"
} else {
"aws-lc-rs"
};
#[cfg(target_os = "android")]
pub fn android_init(
env: &mut jni::JNIEnv<'_>,
context: jni::objects::JObject<'_>,
) -> Result<(), jni::errors::Error> {
rustls_platform_verifier::android::init_with_env(env, context)
}
#[cfg(target_os = "android")]
pub use jni;
pub const ENGINE_VERSION: &str = concat!("sew-call-client/", env!("CARGO_PKG_VERSION"));
pub const USER_AGENT: &str = concat!(
"sew-call-client/",
env!("CARGO_PKG_VERSION"),
" (+https://github.com/Alakazam-211)"
);
pub type Clock = std::sync::Arc<dyn Fn() -> u64 + Send + Sync>;
pub fn system_clock() -> Clock {
use sew_proto::clock::Clock as _;
std::sync::Arc::new(|| sew_proto::clock::SystemClock.now_unix_ms())
}
#[cfg(all(doctest, feature = "audio-core"))]
#[doc = include_str!("../README.md")]
struct ReadmeExamples;