summaryrefslogtreecommitdiffstats
path: root/third_party/rust/cubeb/src/frame.rs
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/cubeb/src/frame.rs')
-rw-r--r--third_party/rust/cubeb/src/frame.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/third_party/rust/cubeb/src/frame.rs b/third_party/rust/cubeb/src/frame.rs
new file mode 100644
index 0000000000..65fd2084f6
--- /dev/null
+++ b/third_party/rust/cubeb/src/frame.rs
@@ -0,0 +1,25 @@
+//! Frame utilities
+
+/// A `Frame` is a collection of samples which have a a specific
+/// layout represented by `ChannelLayout`
+pub trait Frame {}
+
+#[derive(Clone, Copy, Debug, PartialEq, Eq)]
+/// A monaural frame.
+pub struct MonoFrame<T> {
+ /// Mono channel
+ pub m: T,
+}
+
+impl<T> Frame for MonoFrame<T> {}
+
+#[derive(Clone, Copy, Debug, PartialEq, Eq)]
+/// A stereo frame.
+pub struct StereoFrame<T> {
+ /// Left channel
+ pub l: T,
+ /// Right channel
+ pub r: T,
+}
+
+impl<T> Frame for StereoFrame<T> {}