X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-core%2Fsrc%2Fframe.rs;h=6386d6f80902c7b2c7ba9e72487e9b2c396dc029;hb=60b9641e93c0feb263f961dec5be151b59b5939a;hp=26e8640aa5dc236ee7ba605cf2126e91c333a957;hpb=89f25cd7aaba43aa728c4923c27da59b7285b170;p=nihav.git diff --git a/nihav-core/src/frame.rs b/nihav-core/src/frame.rs index 26e8640..6386d6f 100644 --- a/nihav-core/src/frame.rs +++ b/nihav-core/src/frame.rs @@ -53,12 +53,15 @@ pub struct NAVideoInfo { pub flipped: bool, /// Picture pixel format. pub format: NAPixelFormaton, + /// Declared bits per sample. + pub bits: u8, } impl NAVideoInfo { /// Constructs a new `NAVideoInfo` instance. pub fn new(w: usize, h: usize, flip: bool, fmt: NAPixelFormaton) -> Self { - NAVideoInfo { width: w, height: h, flipped: flip, format: fmt } + let bits = fmt.get_total_depth(); + NAVideoInfo { width: w, height: h, flipped: flip, format: fmt, bits } } /// Returns picture width. pub fn get_width(&self) -> usize { self.width as usize }