mirror of
https://github.com/sile/hls_m3u8.git
synced 2024-11-22 15:21:01 +00:00
Rename module: s/tag/tags/
This commit is contained in:
parent
1434e6606b
commit
cec25050b5
11 changed files with 54 additions and 54 deletions
|
@ -15,7 +15,7 @@ pub use master_playlist::{MasterPlaylist, MasterPlaylistBuilder};
|
||||||
pub use media_playlist::{MediaPlaylist, MediaPlaylistBuilder};
|
pub use media_playlist::{MediaPlaylist, MediaPlaylistBuilder};
|
||||||
pub use media_segment::{MediaSegment, MediaSegmentBuilder};
|
pub use media_segment::{MediaSegment, MediaSegmentBuilder};
|
||||||
|
|
||||||
pub mod tag; // TODO: s/tag/tags/
|
pub mod tags;
|
||||||
pub mod types;
|
pub mod types;
|
||||||
|
|
||||||
mod attribute;
|
mod attribute;
|
||||||
|
|
92
src/line.rs
92
src/line.rs
|
@ -2,7 +2,7 @@ use std::fmt;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use {Error, ErrorKind, Result};
|
use {Error, ErrorKind, Result};
|
||||||
use tag;
|
use tags;
|
||||||
use types::SingleLineString;
|
use types::SingleLineString;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
@ -23,7 +23,7 @@ impl<'a> Lines<'a> {
|
||||||
match c {
|
match c {
|
||||||
'\n' => {
|
'\n' => {
|
||||||
if !next_line_of_ext_x_stream_inf
|
if !next_line_of_ext_x_stream_inf
|
||||||
&& self.input.starts_with(tag::ExtXStreamInf::PREFIX)
|
&& self.input.starts_with(tags::ExtXStreamInf::PREFIX)
|
||||||
{
|
{
|
||||||
next_line_of_ext_x_stream_inf = true;
|
next_line_of_ext_x_stream_inf = true;
|
||||||
adjust = 0;
|
adjust = 0;
|
||||||
|
@ -80,28 +80,28 @@ pub enum Line<'a> {
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
pub enum Tag {
|
pub enum Tag {
|
||||||
ExtM3u(tag::ExtM3u),
|
ExtM3u(tags::ExtM3u),
|
||||||
ExtXVersion(tag::ExtXVersion),
|
ExtXVersion(tags::ExtXVersion),
|
||||||
ExtInf(tag::ExtInf),
|
ExtInf(tags::ExtInf),
|
||||||
ExtXByteRange(tag::ExtXByteRange),
|
ExtXByteRange(tags::ExtXByteRange),
|
||||||
ExtXDiscontinuity(tag::ExtXDiscontinuity),
|
ExtXDiscontinuity(tags::ExtXDiscontinuity),
|
||||||
ExtXKey(tag::ExtXKey),
|
ExtXKey(tags::ExtXKey),
|
||||||
ExtXMap(tag::ExtXMap),
|
ExtXMap(tags::ExtXMap),
|
||||||
ExtXProgramDateTime(tag::ExtXProgramDateTime),
|
ExtXProgramDateTime(tags::ExtXProgramDateTime),
|
||||||
ExtXDateRange(tag::ExtXDateRange),
|
ExtXDateRange(tags::ExtXDateRange),
|
||||||
ExtXTargetDuration(tag::ExtXTargetDuration),
|
ExtXTargetDuration(tags::ExtXTargetDuration),
|
||||||
ExtXMediaSequence(tag::ExtXMediaSequence),
|
ExtXMediaSequence(tags::ExtXMediaSequence),
|
||||||
ExtXDiscontinuitySequence(tag::ExtXDiscontinuitySequence),
|
ExtXDiscontinuitySequence(tags::ExtXDiscontinuitySequence),
|
||||||
ExtXEndList(tag::ExtXEndList),
|
ExtXEndList(tags::ExtXEndList),
|
||||||
ExtXPlaylistType(tag::ExtXPlaylistType),
|
ExtXPlaylistType(tags::ExtXPlaylistType),
|
||||||
ExtXIFramesOnly(tag::ExtXIFramesOnly),
|
ExtXIFramesOnly(tags::ExtXIFramesOnly),
|
||||||
ExtXMedia(tag::ExtXMedia),
|
ExtXMedia(tags::ExtXMedia),
|
||||||
ExtXStreamInf(tag::ExtXStreamInf),
|
ExtXStreamInf(tags::ExtXStreamInf),
|
||||||
ExtXIFrameStreamInf(tag::ExtXIFrameStreamInf),
|
ExtXIFrameStreamInf(tags::ExtXIFrameStreamInf),
|
||||||
ExtXSessionData(tag::ExtXSessionData),
|
ExtXSessionData(tags::ExtXSessionData),
|
||||||
ExtXSessionKey(tag::ExtXSessionKey),
|
ExtXSessionKey(tags::ExtXSessionKey),
|
||||||
ExtXIndependentSegments(tag::ExtXIndependentSegments),
|
ExtXIndependentSegments(tags::ExtXIndependentSegments),
|
||||||
ExtXStart(tag::ExtXStart),
|
ExtXStart(tags::ExtXStart),
|
||||||
Unknown(SingleLineString),
|
Unknown(SingleLineString),
|
||||||
}
|
}
|
||||||
impl fmt::Display for Tag {
|
impl fmt::Display for Tag {
|
||||||
|
@ -136,49 +136,49 @@ impl fmt::Display for Tag {
|
||||||
impl FromStr for Tag {
|
impl FromStr for Tag {
|
||||||
type Err = Error;
|
type Err = Error;
|
||||||
fn from_str(s: &str) -> Result<Self> {
|
fn from_str(s: &str) -> Result<Self> {
|
||||||
if s.starts_with(tag::ExtM3u::PREFIX) {
|
if s.starts_with(tags::ExtM3u::PREFIX) {
|
||||||
track!(s.parse().map(Tag::ExtM3u))
|
track!(s.parse().map(Tag::ExtM3u))
|
||||||
} else if s.starts_with(tag::ExtXVersion::PREFIX) {
|
} else if s.starts_with(tags::ExtXVersion::PREFIX) {
|
||||||
track!(s.parse().map(Tag::ExtXVersion))
|
track!(s.parse().map(Tag::ExtXVersion))
|
||||||
} else if s.starts_with(tag::ExtInf::PREFIX) {
|
} else if s.starts_with(tags::ExtInf::PREFIX) {
|
||||||
track!(s.parse().map(Tag::ExtInf))
|
track!(s.parse().map(Tag::ExtInf))
|
||||||
} else if s.starts_with(tag::ExtXByteRange::PREFIX) {
|
} else if s.starts_with(tags::ExtXByteRange::PREFIX) {
|
||||||
track!(s.parse().map(Tag::ExtXByteRange))
|
track!(s.parse().map(Tag::ExtXByteRange))
|
||||||
} else if s.starts_with(tag::ExtXDiscontinuity::PREFIX) {
|
} else if s.starts_with(tags::ExtXDiscontinuity::PREFIX) {
|
||||||
track!(s.parse().map(Tag::ExtXDiscontinuity))
|
track!(s.parse().map(Tag::ExtXDiscontinuity))
|
||||||
} else if s.starts_with(tag::ExtXKey::PREFIX) {
|
} else if s.starts_with(tags::ExtXKey::PREFIX) {
|
||||||
track!(s.parse().map(Tag::ExtXKey))
|
track!(s.parse().map(Tag::ExtXKey))
|
||||||
} else if s.starts_with(tag::ExtXMap::PREFIX) {
|
} else if s.starts_with(tags::ExtXMap::PREFIX) {
|
||||||
track!(s.parse().map(Tag::ExtXMap))
|
track!(s.parse().map(Tag::ExtXMap))
|
||||||
} else if s.starts_with(tag::ExtXProgramDateTime::PREFIX) {
|
} else if s.starts_with(tags::ExtXProgramDateTime::PREFIX) {
|
||||||
track!(s.parse().map(Tag::ExtXProgramDateTime))
|
track!(s.parse().map(Tag::ExtXProgramDateTime))
|
||||||
} else if s.starts_with(tag::ExtXTargetDuration::PREFIX) {
|
} else if s.starts_with(tags::ExtXTargetDuration::PREFIX) {
|
||||||
track!(s.parse().map(Tag::ExtXTargetDuration))
|
track!(s.parse().map(Tag::ExtXTargetDuration))
|
||||||
} else if s.starts_with(tag::ExtXDateRange::PREFIX) {
|
} else if s.starts_with(tags::ExtXDateRange::PREFIX) {
|
||||||
track!(s.parse().map(Tag::ExtXDateRange))
|
track!(s.parse().map(Tag::ExtXDateRange))
|
||||||
} else if s.starts_with(tag::ExtXMediaSequence::PREFIX) {
|
} else if s.starts_with(tags::ExtXMediaSequence::PREFIX) {
|
||||||
track!(s.parse().map(Tag::ExtXMediaSequence))
|
track!(s.parse().map(Tag::ExtXMediaSequence))
|
||||||
} else if s.starts_with(tag::ExtXDiscontinuitySequence::PREFIX) {
|
} else if s.starts_with(tags::ExtXDiscontinuitySequence::PREFIX) {
|
||||||
track!(s.parse().map(Tag::ExtXDiscontinuitySequence))
|
track!(s.parse().map(Tag::ExtXDiscontinuitySequence))
|
||||||
} else if s.starts_with(tag::ExtXEndList::PREFIX) {
|
} else if s.starts_with(tags::ExtXEndList::PREFIX) {
|
||||||
track!(s.parse().map(Tag::ExtXEndList))
|
track!(s.parse().map(Tag::ExtXEndList))
|
||||||
} else if s.starts_with(tag::ExtXPlaylistType::PREFIX) {
|
} else if s.starts_with(tags::ExtXPlaylistType::PREFIX) {
|
||||||
track!(s.parse().map(Tag::ExtXPlaylistType))
|
track!(s.parse().map(Tag::ExtXPlaylistType))
|
||||||
} else if s.starts_with(tag::ExtXIFramesOnly::PREFIX) {
|
} else if s.starts_with(tags::ExtXIFramesOnly::PREFIX) {
|
||||||
track!(s.parse().map(Tag::ExtXIFramesOnly))
|
track!(s.parse().map(Tag::ExtXIFramesOnly))
|
||||||
} else if s.starts_with(tag::ExtXMedia::PREFIX) {
|
} else if s.starts_with(tags::ExtXMedia::PREFIX) {
|
||||||
track!(s.parse().map(Tag::ExtXMedia))
|
track!(s.parse().map(Tag::ExtXMedia))
|
||||||
} else if s.starts_with(tag::ExtXStreamInf::PREFIX) {
|
} else if s.starts_with(tags::ExtXStreamInf::PREFIX) {
|
||||||
track!(s.parse().map(Tag::ExtXStreamInf))
|
track!(s.parse().map(Tag::ExtXStreamInf))
|
||||||
} else if s.starts_with(tag::ExtXIFrameStreamInf::PREFIX) {
|
} else if s.starts_with(tags::ExtXIFrameStreamInf::PREFIX) {
|
||||||
track!(s.parse().map(Tag::ExtXIFrameStreamInf))
|
track!(s.parse().map(Tag::ExtXIFrameStreamInf))
|
||||||
} else if s.starts_with(tag::ExtXSessionData::PREFIX) {
|
} else if s.starts_with(tags::ExtXSessionData::PREFIX) {
|
||||||
track!(s.parse().map(Tag::ExtXSessionData))
|
track!(s.parse().map(Tag::ExtXSessionData))
|
||||||
} else if s.starts_with(tag::ExtXSessionKey::PREFIX) {
|
} else if s.starts_with(tags::ExtXSessionKey::PREFIX) {
|
||||||
track!(s.parse().map(Tag::ExtXSessionKey))
|
track!(s.parse().map(Tag::ExtXSessionKey))
|
||||||
} else if s.starts_with(tag::ExtXIndependentSegments::PREFIX) {
|
} else if s.starts_with(tags::ExtXIndependentSegments::PREFIX) {
|
||||||
track!(s.parse().map(Tag::ExtXIndependentSegments))
|
track!(s.parse().map(Tag::ExtXIndependentSegments))
|
||||||
} else if s.starts_with(tag::ExtXStart::PREFIX) {
|
} else if s.starts_with(tags::ExtXStart::PREFIX) {
|
||||||
track!(s.parse().map(Tag::ExtXStart))
|
track!(s.parse().map(Tag::ExtXStart))
|
||||||
} else {
|
} else {
|
||||||
track!(SingleLineString::new(s)).map(Tag::Unknown)
|
track!(SingleLineString::new(s)).map(Tag::Unknown)
|
||||||
|
|
|
@ -5,8 +5,8 @@ use std::str::FromStr;
|
||||||
|
|
||||||
use {Error, ErrorKind, Result};
|
use {Error, ErrorKind, Result};
|
||||||
use line::{Line, Lines, Tag};
|
use line::{Line, Lines, Tag};
|
||||||
use tag::{ExtM3u, ExtXIFrameStreamInf, ExtXIndependentSegments, ExtXMedia, ExtXSessionData,
|
use tags::{ExtM3u, ExtXIFrameStreamInf, ExtXIndependentSegments, ExtXMedia, ExtXSessionData,
|
||||||
ExtXSessionKey, ExtXStart, ExtXStreamInf, ExtXVersion, MasterPlaylistTag};
|
ExtXSessionKey, ExtXStart, ExtXStreamInf, ExtXVersion, MasterPlaylistTag};
|
||||||
use types::{ClosedCaptions, MediaType, ProtocolVersion, QuotedString};
|
use types::{ClosedCaptions, MediaType, ProtocolVersion, QuotedString};
|
||||||
|
|
||||||
/// Master playlist builder.
|
/// Master playlist builder.
|
||||||
|
|
|
@ -6,9 +6,9 @@ use std::time::Duration;
|
||||||
use {Error, ErrorKind, Result};
|
use {Error, ErrorKind, Result};
|
||||||
use line::{Line, Lines, Tag};
|
use line::{Line, Lines, Tag};
|
||||||
use media_segment::{MediaSegment, MediaSegmentBuilder};
|
use media_segment::{MediaSegment, MediaSegmentBuilder};
|
||||||
use tag::{ExtM3u, ExtXDiscontinuitySequence, ExtXEndList, ExtXIFramesOnly,
|
use tags::{ExtM3u, ExtXDiscontinuitySequence, ExtXEndList, ExtXIFramesOnly,
|
||||||
ExtXIndependentSegments, ExtXMediaSequence, ExtXPlaylistType, ExtXStart,
|
ExtXIndependentSegments, ExtXMediaSequence, ExtXPlaylistType, ExtXStart,
|
||||||
ExtXTargetDuration, ExtXVersion, MediaPlaylistTag};
|
ExtXTargetDuration, ExtXVersion, MediaPlaylistTag};
|
||||||
use types::ProtocolVersion;
|
use types::ProtocolVersion;
|
||||||
|
|
||||||
/// Media playlist builder.
|
/// Media playlist builder.
|
||||||
|
|
|
@ -2,8 +2,8 @@ use std::fmt;
|
||||||
use std::iter;
|
use std::iter;
|
||||||
|
|
||||||
use {ErrorKind, Result};
|
use {ErrorKind, Result};
|
||||||
use tag::{ExtInf, ExtXByteRange, ExtXDateRange, ExtXDiscontinuity, ExtXKey, ExtXMap,
|
use tags::{ExtInf, ExtXByteRange, ExtXDateRange, ExtXDiscontinuity, ExtXKey, ExtXMap,
|
||||||
ExtXProgramDateTime, MediaSegmentTag};
|
ExtXProgramDateTime, MediaSegmentTag};
|
||||||
use types::{ProtocolVersion, SingleLineString};
|
use types::{ProtocolVersion, SingleLineString};
|
||||||
|
|
||||||
/// Media segment builder.
|
/// Media segment builder.
|
||||||
|
|
Loading…
Reference in a new issue