IO Class Reference

<class description="" goes="" here=""> <short description=""> More...

#include <IO.hpp>

Inheritance diagram for IO:

VThread AudioIO BufferedIO DevNull DVDIO FilteredIO IncompleteIO MP4IO MPGStreamIO MuxDemuxIO RawStreamIO Rtp VideoRenderer List of all members.

Public Types

enum  State {
  CLOSED, CLOSING, FORCE_CLOSING, OPENING,
  OPEN, PAUSED, MUTED, PREFETCHING,
  STREAMEOF, STREAMERR
}

Public Member Functions

virtual FramegetFrame ()=0
 returns a frame if one complete frame is available, otherwise null is returned.
virtual int writeFrame (Frame *frm, ESInfo *es=NULL)=0
 returns the number of packets sent.
virtual bool open ()=0
 opens the IO connection.
virtual bool close (bool immediate=false)=0
 closes the IO class.
virtual bool destroy ()=0
 deletes the data source for this IO class.
virtual State getState () const
virtual State setState (State s)
 returns the newly set state
virtual int getBufferFillLevel () const =0
 returns a value from 0..100 indicating buffer usage
virtual int flushBuffer (long from_ts=0, long to_ts=-1)
 flushes the buffer from starting TimeStamp to end TS
virtual const char * getURL () const =0
 returns a pointer to the local file name or an URL
virtual bool setToFrameNumber (u32 frameNumber)
 repositions the IO class to the given frame.
virtual long setToClosestIFrame (u32 frameNumber, bool backwards=true)
 repositions the IO class to
virtual bool setEndFrameNumber (u32 stopNumber)
 sets the last frame that should be sent.
virtual u32 getEndFrameNumber () const
virtual u32 getCurrentFrameNumber () const
virtual void setResendFrameHeader (bool set)
 indicates if the next call to getFrame will send the frame header.
virtual void run ()
virtual void setESInfo (ESInfo *es)=0
virtual ESInfogetESInfo ()=0
virtual u32 getFramesSeen () const
 returns the number of frames received or sent.
virtual void setRtxInfo (const rtx_info *rtx)
 sets a shallow copy of
virtual State play (double prefetchTime=0.0)
virtual State pause ()
virtual State mute ()

Protected Attributes

State state
bool resendFrameHeader
 indicates if the next call to getFrame will send the frame header.
u32 currentFrameNumber
u32 endFrameNumber
 specifies the last frame number that should be sent
VMutex mutexStateChanged
u32 framesSeen

Detailed Description

<class description="" goes="" here=""> <short description="">

Author:
Michael Kropfberger and Peter Schojer
Version:
Id
IO.hpp,v 1.25 2006/03/17 17:14:52 tkuglits Exp

Definition at line 215 of file IO.hpp.


Member Function Documentation

virtual bool IO::close bool  immediate = false  )  [pure virtual]
 

closes the IO class.

Parameters:
immediate specifies, if (optional) buffered data should be read/sent to the client (==false), or immediately dumped (==true)

Implemented in BufferedHttpMPGStreamReader, BufferedIO, DevNull, DSPaudioIO, DVDIO, FilteredIO, IncompleteIO, MP4IO, MPGStreamIO, MuxDemuxIO, RawStreamIO, Rtp, SDLaudioIO, and VideoRenderer.

Referenced by FilteredIO::close(), DataSink::close(), DataChannel::run(), and DataChannel::teardown().

virtual bool IO::destroy  )  [pure virtual]
 

deletes the data source for this IO class.

Will only work with local files, remote files can not be deleted and will always return true.

Implemented in AudioIO, BufferedHttpMPGStreamReader, BufferedIO, DevNull, DVDIO, FilteredIO, IncompleteIO, MP4IO, MPGStreamIO, MuxDemuxIO, RawStreamIO, Rtp, and VideoRenderer.

Referenced by FilteredIO::destroy().

virtual int IO::flushBuffer long  from_ts = 0,
long  to_ts = -1
[inline, virtual]
 

flushes the buffer from starting TimeStamp to end TS

Parameters:
from_ts: 0 is beginning, everything else is somewhere in the stream
to_ts: -1 is ending, everything else is somewhere in the stream
Returns:
the number of freed bytes

Reimplemented in FilteredIO, IncompleteIO, and Rtp.

Definition at line 275 of file IO.hpp.

Referenced by IncompleteIO::flushBuffer(), and FilteredIO::flushBuffer().

00276 { 00277 from_ts = from_ts; // 4Wall 00278 to_ts = to_ts; // 4Wall 00279 return 0; 00280 };

virtual Frame* IO::getFrame  )  [pure virtual]
 

returns a frame if one complete frame is available, otherwise null is returned.

This function is typically blocking. Don't use a NULL return value to conclude STREAMEOF, always check with getState()!

Implemented in BufferedHttpMPGStreamReader, BufferedIO, BufferedMPGStreamReader, DevNull, DSPaudioIO, DVDIO, FilteredIO, IncompleteIO, MP4IO, MPGStreamIO, MuxDemuxIO, RawStreamIO, Rtp, SDLaudioIO, VideoRenderer, VITMuxDemuxIO, and YUVStreamIO.

Referenced by FilteredIO::getFrame(), and DataChannel::run().

virtual u32 IO::getFramesSeen  )  const [inline, virtual]
 

returns the number of frames received or sent.

counter will be resetted when open is called

Reimplemented in FilteredIO.

Definition at line 338 of file IO.hpp.

00338 { return framesSeen;};

virtual bool IO::open  )  [pure virtual]
 

opens the IO connection.

State is set to OPENING. Depending on the underlying QIODevice, a network connection or a file connection is established. When the connection is ready for use, State is OPEN

Implemented in BufferedHttpMPGStreamReader, BufferedIO, DevNull, DSPaudioIO, DVDIO, FilteredIO, IncompleteIO, MP4IO, MPGStreamIO, MuxDemuxIO, QLabelRenderer, RawStreamIO, Rtp, SDLaudioIO, SDLRenderer, VideoRenderer, and X11Renderer.

Referenced by DataDump::adapt(), FilteredIO::open(), DataChannel::run(), and DataSink::send().

virtual bool IO::setEndFrameNumber u32  stopNumber  )  [inline, virtual]
 

sets the last frame that should be sent.

Allows to specify in combination with setToFrameNumber a range of frames that should be sent. Set

Parameters:
stopNumber to 0, to specify the last frame.
Returns:
true on success

Reimplemented in FilteredIO, and Rtp.

Definition at line 317 of file IO.hpp.

References endFrameNumber.

Referenced by ContainerDemux::createDataChannel(), and FilteredIO::setEndFrameNumber().

00317 { 00318 endFrameNumber=stopNumber; 00319 return true; 00320 }

virtual void IO::setRtxInfo const rtx_info *  rtx  )  [inline, virtual]
 

sets a shallow copy of

Parameters:
rtx at the ESInfo object

Reimplemented in FilteredIO, IncompleteIO, and Rtp.

Definition at line 341 of file IO.hpp.

Referenced by FilteredIO::setRtxInfo().

00341 { rtx = rtx; };

virtual long IO::setToClosestIFrame u32  frameNumber,
bool  backwards = true
[inline, virtual]
 

repositions the IO class to

Parameters:
frameNumber,if this Frame is an I-frame. Otherwise, according to
backwards,a frameNumber lower or higher than
frameNumber is searched and returned.
Returns:
the chosen frameNumber or -1 in case of an error will only work with IO classes opened for reading.

Reimplemented in BufferedHttpMPGStreamReader, FilteredIO, IncompleteIO, and MPGStreamIO.

Definition at line 304 of file IO.hpp.

References setToFrameNumber().

Referenced by ContainerDemux::createDataChannel(), and FilteredIO::setToClosestIFrame().

00304 { 00305 dprintf_full("IO::setToClosestIFrame dummy implementation\n"); 00306 setToFrameNumber(frameNumber); 00307 backwards = backwards; 00308 return 0; 00309 };

virtual bool IO::setToFrameNumber u32  frameNumber  )  [inline, virtual]
 

repositions the IO class to the given frame.

Will return false in the following cases:

  • an illegal frame number (too large) was specified
  • the stream is not seekable, because the underlying device is a network device and the requested frame is already out of range.
  • Seeking doesn't work on IO classes opened for writing

Reimplemented in AudioIO, BufferedHttpMPGStreamReader, DevNull, FilteredIO, IncompleteIO, MP4IO, MPGStreamIO, RawStreamIO, and Rtp.

Definition at line 293 of file IO.hpp.

Referenced by setToClosestIFrame(), and FilteredIO::setToFrameNumber().

00293 { 00294 dprintf_full("IO::setToFrameNumber dummy implementation\n"); 00295 return false; 00296 };

virtual int IO::writeFrame Frame frm,
ESInfo es = NULL
[pure virtual]
 

returns the number of packets sent.

Returns 0 on error

Implemented in BufferedIO, DevNull, DSPaudioIO, DVDIO, FilteredIO, IncompleteIO, MP4IO, MPGStreamIO, MuxDemuxIO, QLabelRenderer, RawStreamIO, Rtp, SDLaudioIO, SDLRenderer, VideoRenderer, VITMuxDemuxIO, and X11Renderer.

Referenced by DataDump::adapt(), DataSink::close(), DataSink::send(), and FilteredIO::writeFrame().


Member Data Documentation

bool IO::resendFrameHeader [protected]
 

indicates if the next call to getFrame will send the frame header.

This is a fix for Quicktime which gets confused if we sent a header a second time, even though npt=0.0Definition at line 358 of file IO.hpp.

Referenced by setResendFrameHeader().


The documentation for this class was generated from the following files: