nokhwa/backends/capture/mod.rs
1/*
2 * Copyright 2022 l1npengtul <l1npengtul@protonmail.com> / The Nokhwa Contributors
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#[cfg(all(feature = "input-v4l", target_os = "linux"))]
18#[cfg_attr(feature = "docs-features", doc(cfg(feature = "input-v4l")))]
19pub use nokhwa_bindings_linux::V4LCaptureDevice;
20#[cfg(any(
21 all(feature = "input-msmf", target_os = "windows"),
22 all(feature = "docs-only", feature = "docs-nolink", feature = "input-msmf")
23))]
24mod msmf_backend;
25#[cfg(any(
26 all(feature = "input-msmf", target_os = "windows"),
27 all(feature = "docs-only", feature = "docs-nolink", feature = "input-msmf")
28))]
29#[cfg_attr(feature = "docs-features", doc(cfg(feature = "input-msmf")))]
30pub use msmf_backend::MediaFoundationCaptureDevice;
31#[cfg(any(
32 all(
33 feature = "input-avfoundation",
34 any(target_os = "macos", target_os = "ios")
35 ),
36 all(
37 feature = "docs-only",
38 feature = "docs-nolink",
39 feature = "input-avfoundation"
40 )
41))]
42mod avfoundation;
43#[cfg(any(
44 all(
45 feature = "input-avfoundation",
46 any(target_os = "macos", target_os = "ios")
47 ),
48 all(
49 feature = "docs-only",
50 feature = "docs-nolink",
51 feature = "input-avfoundation"
52 )
53))]
54#[cfg_attr(feature = "docs-features", doc(cfg(feature = "input-avfoundation")))]
55pub use avfoundation::AVFoundationCaptureDevice;
56// FIXME: Fix Lifetime Issues
57// #[cfg(feature = "input-uvc")]
58// mod uvc_backend;
59// #[cfg(feature = "input-uvc")]
60// #[cfg_attr(feature = "docs-features", doc(cfg(feature = "input-uvc")))]
61// pub use uvc_backend::UVCCaptureDevice;
62// #[cfg(feature = "input-gst")]
63// mod gst_backend;
64// #[cfg(feature = "input-gst")]
65// #[cfg_attr(feature = "docs-features", doc(cfg(feature = "input-gst")))]
66// pub use gst_backend::GStreamerCaptureDevice;
67// #[cfg(feature = "input-jscam")]
68// mod browser_backend;
69// #[cfg(feature = "input-jscam")]
70// #[cfg_attr(feature = "docs-features", doc(cfg(feature = "input-jscam")))]
71// pub use browser_backend::BrowserCaptureDevice;
72/// A camera that uses `OpenCV` to access IP (rtsp/http) on the local network
73// #[cfg(feature = "input-ipcam")]
74// #[cfg_attr(feature = "docs-features", doc(cfg(feature = "input-ipcam")))]
75// mod network_camera;
76// #[cfg(feature = "input-ipcam")]
77// #[cfg_attr(feature = "docs-features", doc(cfg(feature = "input-ipcam")))]
78// pub use network_camera::NetworkCamera;
79#[cfg(feature = "input-opencv")]
80mod opencv_backend;
81#[cfg(feature = "input-opencv")]
82#[cfg_attr(feature = "docs-features", doc(cfg(feature = "input-opencv")))]
83pub use opencv_backend::OpenCvCaptureDevice;