make Demuxed public

This commit is contained in:
Scott Lamb 2021-06-28 16:07:35 -07:00
parent 7f32639608
commit 265b6b9490

View File

@ -623,9 +623,8 @@ pub enum PacketItem {
} }
impl Session<Playing> { impl Session<Playing> {
pub fn demuxed( /// Returns a wrapper which demuxes/depacketizes into frames.
mut self, pub fn demuxed(mut self) -> Result<Demuxed, Error> {
) -> Result<impl futures::Stream<Item = Result<CodecItem, Error>>, Error> {
for s in &mut self.state.presentation.streams { for s in &mut self.state.presentation.streams {
if matches!(s.state, StreamState::Playing { .. }) { if matches!(s.state, StreamState::Playing { .. }) {
if let Err(ref mut e) = s.depacketizer { if let Err(ref mut e) = s.depacketizer {
@ -804,8 +803,9 @@ enum DemuxedState {
Pulling(usize), Pulling(usize),
} }
/// Wrapper returned by [`Session<Playing>::demuxed`] which demuxes/depacketizes into frames.
#[pin_project] #[pin_project]
struct Demuxed { pub struct Demuxed {
state: DemuxedState, state: DemuxedState,
#[pin] #[pin]
session: Session<Playing>, session: Session<Playing>,