From: Kostya Shishkov Date: Thu, 14 Feb 2019 13:35:00 +0000 (+0100) Subject: frame: make get_vbuf() work for immutable refs X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=6e09a92e6b5a5d49f5f64e564ff3a93ca75a8a2e;p=nihav.git frame: make get_vbuf() work for immutable refs --- diff --git a/nihav-core/src/frame.rs b/nihav-core/src/frame.rs index 3ae8536..253842a 100644 --- a/nihav-core/src/frame.rs +++ b/nihav-core/src/frame.rs @@ -211,45 +211,45 @@ impl NABufferType { _ => None, } } - pub fn get_vbuf(&mut self) -> Option> { + pub fn get_vbuf(&self) -> Option> { match *self { NABufferType::Video(ref vb) => Some(vb.clone()), NABufferType::VideoPacked(ref vb) => Some(vb.clone()), _ => None, } } - pub fn get_vbuf16(&mut self) -> Option> { + pub fn get_vbuf16(&self) -> Option> { match *self { NABufferType::Video16(ref vb) => Some(vb.clone()), _ => None, } } - pub fn get_vbuf32(&mut self) -> Option> { + pub fn get_vbuf32(&self) -> Option> { match *self { NABufferType::Video32(ref vb) => Some(vb.clone()), _ => None, } } - pub fn get_abuf_u8(&mut self) -> Option> { + pub fn get_abuf_u8(&self) -> Option> { match *self { NABufferType::AudioU8(ref ab) => Some(ab.clone()), NABufferType::AudioPacked(ref ab) => Some(ab.clone()), _ => None, } } - pub fn get_abuf_i16(&mut self) -> Option> { + pub fn get_abuf_i16(&self) -> Option> { match *self { NABufferType::AudioI16(ref ab) => Some(ab.clone()), _ => None, } } - pub fn get_abuf_i32(&mut self) -> Option> { + pub fn get_abuf_i32(&self) -> Option> { match *self { NABufferType::AudioI32(ref ab) => Some(ab.clone()), _ => None, } } - pub fn get_abuf_f32(&mut self) -> Option> { + pub fn get_abuf_f32(&self) -> Option> { match *self { NABufferType::AudioF32(ref ab) => Some(ab.clone()), _ => None,