RTSThread Class Reference

[ARTS Index] [ARTS Heirarchy]


Base thread class for servicing real time queues. More...

#include <thread.h>

Inherits: Thread

Public Members

Protected Members


Detailed Description

The RT service thread is the base class for realtime send and receive servicing. An internal buffer is provided for assembling realtime data packets, and a new time synchronization service is offered so that threads can sleep intervals that can be adjusted to the passing of actual time to account for processing drift.


timeout_t getTimeout(void)

Get the timeout for this service thread.

Returns:
service thread timeout in milliseconds.

RTSThread(Semaphore *start = NULL, int pri = 0)

Construct and set initial timer for a new RTP service thread.

Parameters:
pri thread base priority relative to it's parent.
start starting semaphore for synchronization.

virtual ~RTSThread()

Destroy an realtime service thread. Wait for any remaining time synchronization and exit.

virtual unsigned getAudioSampling(unsigned payload)

Determine audio format being supported by the service thread for the specified payload identifier currently in effect.

Parameters:
payload identifier.
Returns:
0 on error.

virtual AudioCodec *getAudioEncoding(unsigned format)

Get audio encoding codec to use for processing this realtime service stream based on the current payload identifier in effect.

Parameters:
payload identifier.
Returns:
audio codec (base) to use or NULL if none.

void setTimeout(timeout_t timer)

Set the thread timeout.

Parameters:
timeout for this realtime service thread in milliseconds.

void setServiceDelay(int number)

Add to current service thread startup delay.

Parameters:
number of timeouts to add to the current startup.

bool isServiceDelay(void)

Test for and update service delay timer.

Returns:
true if service delay in effect.

void Reset(void)

Reset the pause timer to the current time of day. This is used to initially synchronize the stream timer when time clock based "pacing" is required, such as when streaming data that is not realtime in origin.

bool Pause(timeout_t sync)

This service provides a time synchronized delay via APE sleep. The delay is computed by adjusting the time forward.

Parameters:
time interval to synchronize on.
Returns:
true if delay needed (after sleeping).

timeout_t getTimeUsed(void)

Compute the amount of time that has transpired since the last time sync mark was computed. This can be used to determine if a blocking operation has caused frame delays.

Returns:
used time in milliseconds.

void addTimeUsed(timeout_t timeout)

Adjust current time marker for this thread. This can be used in place of pausing when updating for delays that have already occured.

Parameters:
timeout to adjust start time by.

virtual void setAudioSampling(unsigned format)

Set audio sampling format for this service thread. This change is assumed to take effect on the next operation.

Parameters:
audio sampling format.

  • Author: David Sugar (dyfet@ostel.com)
  • Documentation generated by dyfet@home.tycho.com on Fri Jul 2 11:43:56 EDT 1999
Kdoc