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
data: Bytes
The raw unencrypted tag data.
This includes all data that follows the StreamID field. See the legacy FLV spec, Annex E.4.1 for more information.
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>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more