DataChannel Class Reference
a DataChannel object reads data from an input. <short description=""> More...
#include <DataChannel.hpp>
Inheritance diagram for DataChannel:
Public Member Functions | |
DataChannel (IO *input, ESInfo *es) | |
creates a DataChannel only a dummy adaptor is set | |
DataChannel (IO *input, ESInfo *es, Adaptor *adapt) | |
creates a DataChannel object that reads data from an input. | |
void | setAdaptor (Adaptor *adapt) |
changes the adaptor to a new one, works even while the thread is working. | |
void | setESInfo (ESInfo *new_es) |
changes the connected ESInfo | |
void | setFinalFrameNumber (long frameNumber) |
set the frame number, where the DC-thread should stop streaming. | |
void | initiateThreadStop (bool forceTearDown) |
waits until the DC-thread is stopped | |
void | setInput (IO *new_io) |
bool | play (u32 clientId, double prefetch) |
Moves a previously inserted cliented from the paused list to the active list returns false when the DataChannel has already ended. | |
bool | mute (u32 clientId) |
mutes a client. | |
bool | unmute (u32 clientId) |
unmutes a MUTED client. | |
bool | pause (u32 clientId) |
pauses a client. | |
bool | insert (DataSink *c) |
inserts the client into the paused queue. | |
char * | enableCaching (bool omitHeader, const char *outDir, bool proxyMode=true, const Url *url=NULL) |
stores the result of the global Adaptor stream to the disk. | |
void | visualizeCaching () |
renders the result of the global Adaptor stream to the screen. | |
bool | teardown (u32 clientId, bool immediate=false) |
returns false, when the client was not found in the active or paused queue. | |
bool | tearDownFlagSet () const |
int | getNumberOfActiveDataSinks () |
returns the number of active clients | |
IO * | getInput () |
Adaptor * | getAdaptor () const |
void | run () |
starts the thread. | |
void | setSessionId (int i) |
uint | getSessionId () const |
const ESInfo * | getESInfo () const |
DataSink * | getDataSink (u32 clientId) |
returns the DataSink with id | |
const DataSink * | getActiveDataSink (u32 clientId) |
list< u32 > | getListOfActiveClientIds () |
list< u32 > | getListOfPausedClientIds () |
void | setOutputStatistics (Statistics *stats) |
this is BIG HACK... | |
Statistics * | getOutputStatistics () |
this is BIG HACK... | |
Protected Attributes | |
int | sessionId |
IO * | input |
list< DataSink * > | active |
list of receivers | |
list< DataSink * > | paused |
list of paused receivers | |
DataSink * | localViewer |
local viewer | |
VMutex | lockDataSink |
Semaphore used to sync access to the active clients. | |
VMutex | lockInput |
Semaphore used to sync access to the Input IO. | |
VMutex | lockAdaptor |
a semaphore to lock the adaptor | |
Adaptor * | adaptor |
each DataChannel can have an Adaptor, per default a Forwarder is set here | |
list< Frame * > | sendQueue |
bool | channelOpen |
specifies if new DataSinks can be added | |
bool | tearDown |
bool | immediateClose |
ESInfo * | es |
Statistics * | outstats |
long | currentFrameNumber |
long | finalFrameNumber |
Detailed Description
a DataChannel object reads data from an input. <short description="">Note that you must at least add one DataSink via play before the DataChannel can actually send data. Each DataChannel has an Adaptor, after sending the data through the the Adaptor, the result of the adaptation is distributed to each DataSink. To each DataSink, there has to be attached an IO output
- Author:
- Michael Kropfberger and Peter Schojer
- Version:
- Id
- DataChannel.hpp,v 1.23 2006/01/26 09:50:45 mkropfbe Exp
Definition at line 74 of file DataChannel.hpp.
Constructor & Destructor Documentation
|
creates a DataChannel object that reads data from an input. Note that you must at least add one DataSink via play before the DataChannel can actually send data. Each DataChannel has an Adaptor, after sending the data through the the Adaptor, the result of the adaptation is distributed to each DataSink. Definition at line 76 of file DataChannel.cpp.
|
Member Function Documentation
|
stores the result of the global Adaptor stream to the disk.
References active, channelOpen, ESInfo::getContainerInfo(), ContainerInfo::getLocalFile(), ESInfo::getStreamId(), ESInfo::isAudioStream(), ESInfo::isODStream(), ESInfo::isSceneDescriptionStream(), ESInfo::isVisualStream(), VMutex::lock(), lockDataSink, and VMutex::release(). Referenced by ContainerDemux::demultiplexAndUpdateIO().
|
|
returns the DataSink with id
References VMutex::lock(), lockDataSink, paused, and VMutex::release().
|
|
this is BIG HACK... by that, you get only one output stats from the first datasink out (eg. RTP) since the code isnt able to cope with more than one networked DataSink anyway, it should workDefinition at line 974 of file DataChannel.cpp.
|
|
waits until the DC-thread is stopped
|
|
inserts the client into the paused queue. This is the first mandatory step, if you want to start playing a client.Definition at line 794 of file DataChannel.cpp. References DataSink::getDataSinkId(), VMutex::lock(), lockDataSink, paused, and VMutex::release(). Referenced by ContainerDemux::createDataChannel().
|
|
mutes a client. The client stays on the active list, and received frames are still passed through the global DC adaptors (eg. statistics), but it will bypass the client adaptors (eg. decoding). But the frames will still be handed over to the I/O output classes' writeFrame for sync. To return to PLAY state, call DataChannel::unmute(clientId) Definition at line 718 of file DataChannel.cpp. References active, VMutex::lock(), lockDataSink, and VMutex::release().
|
|
pauses a client. The client is searched in the active list. If it is found there, it is moved to the pause queue. Otherwise false is returned. Note that when you pause the last client, the thread will terminate and has to be restarted where it will continue from the last frame. Definition at line 762 of file DataChannel.cpp. References active, VMutex::lock(), lockDataSink, IO::pause(), paused, and VMutex::release().
|
|
Moves a previously inserted cliented from the paused list to the active list returns false when the DataChannel has already ended. In this case the client is not added. Note that for at least one client play must be called PRIOR starting the DataChannel, otherwise the thread will terminate immediately. You can only play clients which were inserted previously. Definition at line 527 of file DataChannel.cpp. References active, channelOpen, VMutex::lock(), lockDataSink, paused, IO::play(), and VMutex::release(). Referenced by ContainerDemux::createDataChannel().
|
|
starts the thread. if for no client play was called previously, the thread terminates immediately. If clients were set, the thread runs till the input reaches End-of-stream. When this state is reached, all buffered data is sent, then the active queue is emptied. The clients are not destroyed. Implements VThread. Definition at line 187 of file DataChannel.cpp. References active, Adaptor::adapt(), adaptor, channelOpen, Adaptor::close(), IO::close(), Frame::getAU(), IO::getFrame(), Adaptor::getName(), IO::getState(), IO::getURL(), localViewer, VMutex::lock(), lockAdaptor, lockDataSink, lockInput, IO::open(), VMutex::release(), DataSink::send(), and ESInfo::setCompleteState().
|
|
changes the adaptor to a new one, works even while the thread is working. If null is passed as parameter, a forwarder is set Definition at line 455 of file DataChannel.cpp. References adaptor, VMutex::lock(), lockAdaptor, and VMutex::release(). Referenced by ContainerDemux::createDataChannel().
|
|
set the frame number, where the DC-thread should stop streaming. this is needed for reaching the switchPoint for stream switchingDefinition at line 473 of file DataChannel.cpp.
|
|
this is BIG HACK... by that, we set the stats of the FIRST dataSink output (eg. RTP), since the code isnt able to cope with more than one networked DataSink anyway :(Definition at line 969 of file DataChannel.cpp.
|
|
returns false, when the client was not found in the active or paused queue. If c was found, the client will be deleted! Definition at line 904 of file DataChannel.cpp. References active, channelOpen, IO::close(), VMutex::lock(), lockDataSink, paused, and VMutex::release().
|
|
unmutes a MUTED client. This returns the client into PLAY state Definition at line 740 of file DataChannel.cpp. References active, VMutex::lock(), lockDataSink, and VMutex::release().
|
|
renders the result of the global Adaptor stream to the screen. Creates internally a DataSink with ID 0. Use this id to control the visualizing DataSinkDefinition at line 685 of file DataChannel.cpp. References AdaptorChain::addAdaptor(), channelOpen, UncompressedVideoFrame::ColorSpace, ESInfo::isVisualStream(), localViewer, VMutex::lock(), lockDataSink, VMutex::release(), and Adaptor::setESInfo(). Referenced by ContainerDemux::createDataChannel().
|
The documentation for this class was generated from the following files: