2018-02-14 03:00:19 +00:00
|
|
|
//! [4.3. Playlist Tags]
|
|
|
|
//!
|
|
|
|
//! [4.3. Playlist Tags]: https://tools.ietf.org/html/rfc8216#section-4.3
|
2018-02-11 06:10:52 +00:00
|
|
|
|
|
|
|
macro_rules! may_invalid {
|
|
|
|
($expr:expr) => {
|
|
|
|
$expr.map_err(|e| track!(Error::from(ErrorKind::InvalidInput.cause(e))))
|
2018-10-04 11:18:56 +00:00
|
|
|
};
|
2018-02-11 06:10:52 +00:00
|
|
|
}
|
|
|
|
|
2018-02-14 03:00:19 +00:00
|
|
|
macro_rules! impl_from {
|
|
|
|
($to:ident, $from:ident) => {
|
|
|
|
impl From<$from> for $to {
|
|
|
|
fn from(f: $from) -> Self {
|
|
|
|
$to::$from(f)
|
|
|
|
}
|
|
|
|
}
|
2018-10-04 11:18:56 +00:00
|
|
|
};
|
2018-02-14 03:00:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
mod basic;
|
2018-02-14 09:57:15 +00:00
|
|
|
mod master_playlist;
|
2018-02-14 07:44:28 +00:00
|
|
|
mod media_playlist;
|
2018-02-14 03:16:36 +00:00
|
|
|
mod media_segment;
|
2019-09-06 10:55:00 +00:00
|
|
|
mod shared;
|
|
|
|
|
|
|
|
pub use basic::*;
|
|
|
|
pub use master_playlist::*;
|
|
|
|
pub use media_playlist::*;
|
|
|
|
pub use media_segment::*;
|
|
|
|
pub use shared::*;
|
2018-02-14 03:00:19 +00:00
|
|
|
|
2018-02-14 17:52:56 +00:00
|
|
|
/// [4.3.4. Master Playlist Tags]
|
|
|
|
///
|
|
|
|
/// See also [4.3.5. Media or Master Playlist Tags]
|
|
|
|
///
|
2018-02-14 19:47:44 +00:00
|
|
|
/// [4.3.4. Master Playlist Tags]: https://tools.ietf.org/html/rfc8216#section-4.3.4
|
2018-02-14 17:52:56 +00:00
|
|
|
/// [4.3.5. Media or Master Playlist Tags]: https://tools.ietf.org/html/rfc8216#section-4.3.5
|
|
|
|
#[allow(missing_docs)]
|
2019-03-31 10:00:02 +00:00
|
|
|
#[allow(clippy::large_enum_variant)]
|
2018-02-14 17:52:56 +00:00
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
|
|
pub enum MasterPlaylistTag {
|
|
|
|
ExtXMedia(ExtXMedia),
|
|
|
|
ExtXStreamInf(ExtXStreamInf),
|
|
|
|
ExtXIFrameStreamInf(ExtXIFrameStreamInf),
|
|
|
|
ExtXSessionData(ExtXSessionData),
|
|
|
|
ExtXSessionKey(ExtXSessionKey),
|
|
|
|
ExtXIndependentSegments(ExtXIndependentSegments),
|
|
|
|
ExtXStart(ExtXStart),
|
|
|
|
}
|
|
|
|
impl_from!(MasterPlaylistTag, ExtXMedia);
|
|
|
|
impl_from!(MasterPlaylistTag, ExtXStreamInf);
|
|
|
|
impl_from!(MasterPlaylistTag, ExtXIFrameStreamInf);
|
|
|
|
impl_from!(MasterPlaylistTag, ExtXSessionData);
|
|
|
|
impl_from!(MasterPlaylistTag, ExtXSessionKey);
|
|
|
|
impl_from!(MasterPlaylistTag, ExtXIndependentSegments);
|
|
|
|
impl_from!(MasterPlaylistTag, ExtXStart);
|
|
|
|
|
2018-02-14 19:18:02 +00:00
|
|
|
/// [4.3.3. Media Playlist Tags]
|
|
|
|
///
|
|
|
|
/// See also [4.3.5. Media or Master Playlist Tags]
|
|
|
|
///
|
2018-02-14 19:47:44 +00:00
|
|
|
/// [4.3.3. Media Playlist Tags]: https://tools.ietf.org/html/rfc8216#section-4.3.3
|
2018-02-14 19:18:02 +00:00
|
|
|
/// [4.3.5. Media or Master Playlist Tags]: https://tools.ietf.org/html/rfc8216#section-4.3.5
|
|
|
|
#[allow(missing_docs)]
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
|
|
pub enum MediaPlaylistTag {
|
|
|
|
ExtXTargetDuration(ExtXTargetDuration),
|
|
|
|
ExtXMediaSequence(ExtXMediaSequence),
|
|
|
|
ExtXDiscontinuitySequence(ExtXDiscontinuitySequence),
|
|
|
|
ExtXEndList(ExtXEndList),
|
|
|
|
ExtXPlaylistType(ExtXPlaylistType),
|
|
|
|
ExtXIFramesOnly(ExtXIFramesOnly),
|
|
|
|
ExtXIndependentSegments(ExtXIndependentSegments),
|
|
|
|
ExtXStart(ExtXStart),
|
|
|
|
}
|
|
|
|
impl_from!(MediaPlaylistTag, ExtXTargetDuration);
|
|
|
|
impl_from!(MediaPlaylistTag, ExtXMediaSequence);
|
|
|
|
impl_from!(MediaPlaylistTag, ExtXDiscontinuitySequence);
|
|
|
|
impl_from!(MediaPlaylistTag, ExtXEndList);
|
|
|
|
impl_from!(MediaPlaylistTag, ExtXPlaylistType);
|
|
|
|
impl_from!(MediaPlaylistTag, ExtXIFramesOnly);
|
|
|
|
impl_from!(MediaPlaylistTag, ExtXIndependentSegments);
|
|
|
|
impl_from!(MediaPlaylistTag, ExtXStart);
|
|
|
|
|
2018-02-14 19:47:44 +00:00
|
|
|
/// [4.3.2. Media Segment Tags]
|
|
|
|
///
|
|
|
|
/// [4.3.2. Media Segment Tags]: https://tools.ietf.org/html/rfc8216#section-4.3.2
|
2018-02-14 03:00:19 +00:00
|
|
|
#[allow(missing_docs)]
|
2019-03-31 10:00:02 +00:00
|
|
|
#[allow(clippy::large_enum_variant)]
|
2018-02-12 16:00:23 +00:00
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
|
|
pub enum MediaSegmentTag {
|
|
|
|
ExtInf(ExtInf),
|
|
|
|
ExtXByteRange(ExtXByteRange),
|
|
|
|
ExtXDateRange(ExtXDateRange),
|
|
|
|
ExtXDiscontinuity(ExtXDiscontinuity),
|
|
|
|
ExtXKey(ExtXKey),
|
|
|
|
ExtXMap(ExtXMap),
|
|
|
|
ExtXProgramDateTime(ExtXProgramDateTime),
|
|
|
|
}
|
2018-02-14 03:16:36 +00:00
|
|
|
impl_from!(MediaSegmentTag, ExtInf);
|
|
|
|
impl_from!(MediaSegmentTag, ExtXByteRange);
|
|
|
|
impl_from!(MediaSegmentTag, ExtXDateRange);
|
|
|
|
impl_from!(MediaSegmentTag, ExtXDiscontinuity);
|
|
|
|
impl_from!(MediaSegmentTag, ExtXKey);
|
|
|
|
impl_from!(MediaSegmentTag, ExtXMap);
|
|
|
|
impl_from!(MediaSegmentTag, ExtXProgramDateTime);
|