use crate::{
CaptureError, DeviceEvent, DeviceHotplug, DeviceInfo, DeviceKind, PermissionState, Support,
Unavailable,
};
use mediaway_common::GpuDeviceHandle;
pub struct WindowsDeviceHotplug {
_priv: (),
}
impl WindowsDeviceHotplug {
pub const fn open(_kinds: &[DeviceKind]) -> Result<Self, CaptureError> {
Err(CaptureError::Unsupported)
}
}
impl DeviceHotplug for WindowsDeviceHotplug {
fn poll_event(&mut self) -> Result<Option<DeviceEvent>, CaptureError> {
Err(CaptureError::Unsupported)
}
fn close(&mut self) -> Result<(), CaptureError> {
Err(CaptureError::Unsupported)
}
}
#[must_use]
pub const fn support(_kind: DeviceKind) -> Support {
Support::Unavailable(Unavailable::NotImplemented)
}
pub const fn request_permission(_kind: DeviceKind) -> Result<PermissionState, CaptureError> {
Ok(PermissionState::NotSupported)
}
pub const fn enumerate(_kind: DeviceKind) -> Result<Vec<DeviceInfo>, CaptureError> {
Err(CaptureError::Unsupported)
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct GpuAdapterInfo {
pub index: u32,
pub name: String,
pub vendor_id: u32,
pub device_id: u32,
pub dedicated_video_memory: u64,
pub is_hardware: bool,
}
pub const fn enumerate_gpu_adapters() -> Result<Vec<GpuAdapterInfo>, CaptureError> {
Err(CaptureError::Unsupported)
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum GpuAdapterSelect {
#[default]
Default,
Index(u32),
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct GpuDeviceOptions {
pub adapter: GpuAdapterSelect,
pub video_support: bool,
pub debug_layer: bool,
}
impl Default for GpuDeviceOptions {
fn default() -> Self {
Self {
adapter: GpuAdapterSelect::Default,
video_support: true,
debug_layer: false,
}
}
}
pub struct GpuDevice {
_priv: (),
}
impl GpuDevice {
pub const fn create(_options: GpuDeviceOptions) -> Result<Self, CaptureError> {
Err(CaptureError::Unsupported)
}
pub const fn handle(&self) -> GpuDeviceHandle {
GpuDeviceHandle::WebGpu { device_id: 0 }
}
}