RTSRecvThread Class Reference

[ARTS Index] [ARTS Heirarchy]


Service thread for real-time streaming input. More...

#include <thread.h>

Inherits: RTSThread

Public Members

Protected Members


Detailed Description

The service thread used to deliver received rtp packets. This virtual service thread provides the core functionality for streaming of inbound media packets. In fact, streaming includes abstract I/O services that are implemented on a per protocol bases which allows RTSRecvThread to drive IPX "RTP" sockets or even VAT sessions.


RTSRecvThread(Semaphore *start = NULL, int pri = 0, timeout_t timer = 20)

Construct a RTS service thread for receiving packets.

Parameters:
timer for synchronizing frames, default 20ms audio.
pri level of this thread relative to parent.
start semaphore to use for synchronized startup.

virtual ~RTSRecvThread()

Terminate the receiving thread service.

unsigned long getStarting(unsigned long stamp)

Compute offset in pending queue for the specified packet based on it's timestamp.

Parameters:
timestamp of received packet.
Returns:
adjusted timestamp based on window offset.

void setStarting(unsigned long value)

Set starting timestamp for the current window. This starting time stamp is used to compute the relative offset of the received packet for posting into a pending delivery queue with RTSPost.

Parameters:
value of starting time stamp for frame buffer.

unsigned long addStarting(unsigned long offset)

The RTSOutput() method must use addStartup() to adjust the timestamp for the next packets received once real- time data has been retrieved.

Parameters:
offset timestamp by specified samples.
Returns:
new base timestamp in effect.

virtual void InitReceiver(void)

Initial thread service. This is used to support multiple inheretance of sending and receiving threads in a single object.

virtual void ExitReceiver(void)

Exit thread service for self destructing objects. This is used to support multiple inheretance of sending and receiving threads in a single object.

virtual void RunReceiver(void)

The default run method of a sending service thread. This is used to support multipe inheretance of sending and receiving threads in a single object.

virtual ssize_t RTSRecv(unsigned char *buf, unsigned short *encoding, unsigned long *timestamp)

Receive realtime data into an RTP formatted packet using the current protocol from the read routine in the derived class. This may apply decompression and other codec functions. This function normally blocks until a RTP packet is received.

Parameters:
timestamp of received packet.
buf pointer to rtpdata buffer.
encoding sample format of received packet (after codec).
Returns:
actual number of bytes read on success, -1 on error.

virtual void RTSOutput(timeout_t timeout)

Process an output frame for timed playback. Posting is assumed to post data into a buffer queue buffer. Playback may also simply update the 'timing' window of the current frame.

Parameters:
timeout of audio frames.

virtual int RTSWait(timeout_t timeout)

Wait for the specified timeout duration for data to appear at the socket and then do a blind "internal" peek of the message header so that getPeerHeader() will be functional.

Parameters:
timeout of current session in milliseconds.
Returns:
0 if data available, -1 on failure.

virtual size_t RTSPost(unsigned char *buf, unsigned short encoding, unsigned long timestamp, size_t len)

Virtual function used to post the last retrieved message. This operates by calling the protocol 'derived' class which has the header information for the last read packet.

Parameters:
buf pointer to rtpdata buffer.
time stamp of this packet.
encoding sample format of last read packet.
Returns:
number of bytes posted on success, -1 on failure.

virtual void RTSRecvError(void)

Error processing routine for receive failures.

virtual void SessionId(unsigned long session)

Protocol may use this to specify a new session has been initiated.

Parameters:
session number of this session.

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