diff --git a/media/src/io/h264_writer/mod.rs b/media/src/io/h264_writer/mod.rs index a79db29a6..a6a89034d 100644 --- a/media/src/io/h264_writer/mod.rs +++ b/media/src/io/h264_writer/mod.rs @@ -1,7 +1,7 @@ #[cfg(test)] mod h264_writer_test; -use std::io::{Seek, Write}; +use std::io::Write; use rtp::codecs::h264::H264Packet; use rtp::packetizer::Depacketizer; @@ -29,13 +29,13 @@ fn is_key_frame(data: &[u8]) -> bool { /// Currently it only supports non-interleaved mode /// Therefore, only 1-23, 24 (STAP-A), 28 (FU-A) NAL types are allowed. /// -pub struct H264Writer { +pub struct H264Writer { writer: W, has_key_frame: bool, cached_packet: Option, } -impl H264Writer { +impl H264Writer { // new initializes a new H264 writer with an io.Writer output pub fn new(writer: W) -> Self { H264Writer { @@ -46,7 +46,7 @@ impl H264Writer { } } -impl Writer for H264Writer { +impl Writer for H264Writer { /// write_rtp adds a new packet and writes the appropriate headers for it fn write_rtp(&mut self, packet: &rtp::packet::Packet) -> Result<()> { if packet.payload.is_empty() { diff --git a/media/src/io/ogg_writer/mod.rs b/media/src/io/ogg_writer/mod.rs index f3ff966ae..c40345ea6 100644 --- a/media/src/io/ogg_writer/mod.rs +++ b/media/src/io/ogg_writer/mod.rs @@ -1,7 +1,7 @@ #[cfg(test)] mod ogg_writer_test; -use std::io::{BufWriter, Seek, Write}; +use std::io::{BufWriter, Write}; use byteorder::{LittleEndian, WriteBytesExt}; use bytes::Bytes; @@ -12,7 +12,7 @@ use crate::io::ogg_reader::*; use crate::io::Writer; /// OggWriter is used to take RTP packets and write them to an OGG on disk -pub struct OggWriter { +pub struct OggWriter { writer: W, sample_rate: u32, channel_count: u8, @@ -25,7 +25,7 @@ pub struct OggWriter { last_payload: Bytes, } -impl OggWriter { +impl OggWriter { /// new initialize a new OGG Opus writer with an io.Writer output pub fn new(writer: W, sample_rate: u32, channel_count: u8) -> Result { let mut w = OggWriter { @@ -166,7 +166,7 @@ impl OggWriter { } } -impl Writer for OggWriter { +impl Writer for OggWriter { /// write_rtp adds a new packet and writes the appropriate headers for it fn write_rtp(&mut self, packet: &rtp::packet::Packet) -> Result<()> { if packet.payload.is_empty() {