pub enum FlvTagData<'a> {
Audio(AudioData),
Video(VideoData<'a>),
ScriptData(ScriptData<'a>),
Encrypted {
data: Bytes,
},
Unknown {
tag_type: FlvTagType,
data: Bytes,
},
}
Expand description
FLV Tag Data
This is a container for the actual media data. This enum contains the data for the different types of tags.
Defined by:
- Legacy FLV spec, Annex E.4.1
Variants§
Audio(AudioData)
AudioData when the FlvTagType is Audio(8)
Defined by:
- Legacy FLV spec, Annex E.4.2.1
Video(VideoData<'a>)
VideoData when the FlvTagType is Video(9)
Defined by:
- Legacy FLV spec, Annex E.4.3.1
ScriptData(ScriptData<'a>)
ScriptData when the FlvTagType is ScriptData(18)
Defined by:
- Legacy FLV spec, Annex E.4.4.1
Encrypted
Encrypted tag.
This library neither supports demuxing nor decrypting encrypted tags.
Fields
Unknown
Any tag type that we dont know how to demux, with the corresponding data being the raw bytes of the tag.
Implementations§
Source§impl FlvTagData<'_>
impl FlvTagData<'_>
Sourcepub fn demux(
tag_type: FlvTagType,
reader: &mut Cursor<Bytes>,
) -> Result<Self, FlvError>
pub fn demux( tag_type: FlvTagType, reader: &mut Cursor<Bytes>, ) -> Result<Self, FlvError>
Demux a FLV tag data from the given reader.
The reader will be enirely consumed.
The reader needs to be a std::io::Cursor
with a Bytes
buffer because we
take advantage of zero-copy reading.
Trait Implementations§
Source§impl<'a> Clone for FlvTagData<'a>
impl<'a> Clone for FlvTagData<'a>
Source§fn clone(&self) -> FlvTagData<'a>
fn clone(&self) -> FlvTagData<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for FlvTagData<'a>
impl<'a> Debug for FlvTagData<'a>
Source§impl<'a> PartialEq for FlvTagData<'a>
impl<'a> PartialEq for FlvTagData<'a>
impl<'a> StructuralPartialEq for FlvTagData<'a>
Auto Trait Implementations§
impl<'a> !Freeze for FlvTagData<'a>
impl<'a> RefUnwindSafe for FlvTagData<'a>
impl<'a> Send for FlvTagData<'a>
impl<'a> Sync for FlvTagData<'a>
impl<'a> Unpin for FlvTagData<'a>
impl<'a> UnwindSafe for FlvTagData<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more