GlobalTimer Class Reference
This adaptor class provides a means for synchronizing DataChannels (media streams) by providing methods for obtaining the elapsed time since the start of streaming (not including PAUSED states) and for blocking DataChannels when set to the PREFETCHING or PAUSED state. Adaptor for synchronizing several DataChannels with PREFETCHING or PAUSED states. More...
#include <GlobalTimer.hpp>
Inheritance diagram for GlobalTimer:
Public Member Functions | |
list< Frame * > | adapt (Frame *frm) |
Accepts as input a frame, and checks if it can adapt the frame, If the frame is modified, a new Frame object is created and inserted into the return list. | |
Adaptor * | clone () |
Create a shallow copy of the Adaptor. | |
void | reset () |
void | initialize () |
Initialize internal data structures. | |
list< Frame * > | close () |
Close and destroy an Adaptor. | |
double | getActualSec () |
Return the time elapsed since the start of streaming, excluding any time periods when the GlobalTimer was was blocked. | |
void | adjustToTS (int ts, int mediaTimeScale) |
void | adjust (double sec) |
Adjust timer to play-out time point. | |
void | setPaused (bool pause) |
bool | isPaused () const |
void | setPrefetching (bool pause) |
bool | isPrefetching () |
void | dropFramesUntil (u32 cts) |
Drop all frames with a CTS less than the given one. | |
void | setESInfo (ESInfo *esi) |
dummy implementations since a GlobalTimer is used by many ESs | |
ESInfo * | getESInfo () |
u32 | getTranscodingCosts () const |
returns adaptation costs (CPU only) |
Detailed Description
This adaptor class provides a means for synchronizing DataChannels (media streams) by providing methods for obtaining the elapsed time since the start of streaming (not including PAUSED states) and for blocking DataChannels when set to the PREFETCHING or PAUSED state. Adaptor for synchronizing several DataChannels with PREFETCHING or PAUSED states.All DataChannels representing synchronized media streams (usually 1 video and 1 audio stream) need to include the same GlobalTimer instance as a SharedAdaptor. Note that a GlobalTimer needs to be coupled with an ESSynchronizer to achieve display rate control for video streams.
- See also:
- SharedAdaptor
- Author:
- Michael Kropfberger, Peter Schojer, Mario Taschwer
- Version:
- Id
- GlobalTimer.hpp,v 1.13 2006/01/20 15:37:17 mkropfbe Exp
Definition at line 83 of file GlobalTimer.hpp.
Member Function Documentation
|
Accepts as input a frame, and checks if it can adapt the frame, If the frame is modified, a new Frame object is created and inserted into the return list. This new frame is returned only, if the size of the payload is larger than zero. If the frame was not modified, it is also inserted into the list. For more complex adaptors, it will happen, that the adaptor caches up one complete GOP and returns the full GOP in network order. A caching adaptor has to create deep-copies for each frames. Never directly modify the payload of the input frm, always create copies!!!
Reimplemented from Adaptor. Definition at line 173 of file GlobalTimer.cpp. References VCondition::condWait(), Frame::getAU(), VMutex::getMutexObject(), ReferenceCounter::getUsage(), VMutex::lock(), and VMutex::release().
|
|
Adjust timer to play-out time point.
References VMutex::lock(), and VMutex::release(). Referenced by ESSynchronizer::adapt(), ESSynchronizer::adjust(), and ESSynchronizer::setOutputRateFactor().
|
|
Create a shallow copy of the Adaptor. Creates an Adaptor with the same setup (without copying the current status).
Implements Adaptor. Definition at line 95 of file GlobalTimer.hpp.
|
|
Close and destroy an Adaptor. Releases all internally buffered frame objects, and deallocate all allocated memory. The Adaptor must not be used after calling the close method!!!
Reimplemented from Adaptor. Definition at line 101 of file GlobalTimer.hpp.
|
|
Drop all frames with a CTS less than the given one. Frames are dropped even if the GlobalTimer is PAUSED or PREFETCHING. This allows media streams to be sychronized to a given time stamp, e.g. after a PAUSE/PLAY in a network player application. Note that you need to insert a decoder before the GlobalTimer into the adaptor chain if you want to use this method.Definition at line 141 of file GlobalTimer.cpp.
|
|
Return the time elapsed since the start of streaming, excluding any time periods when the GlobalTimer was was blocked. Definition at line 127 of file GlobalTimer.cpp. References VMutex::lock(), and VMutex::release(). Referenced by ESSynchronizer::adapt(), and ESSynchronizer::setOutputRateFactor().
|
|
Initialize internal data structures.
Implements Adaptor. Definition at line 90 of file GlobalTimer.cpp.
|
The documentation for this class was generated from the following files: