#include <mediastrm.h>
Inheritance diagram for OpalMediaStream:
Construction | |
~OpalMediaStream () | |
OpalMediaStream (const OpalMediaFormat &mediaFormat, unsigned sessionID, BOOL isSource) | |
Public Member Functions | |
Overrides from PObject | |
void | PrintOn (ostream &strm) const |
Operations | |
virtual OpalMediaFormat | GetMediaFormat () const |
virtual BOOL | UpdateMediaFormat (const OpalMediaFormat &mediaFormat) |
virtual BOOL | ExecuteCommand (const OpalMediaCommand &command) |
virtual void | SetCommandNotifier (const PNotifier ¬ifier) |
virtual BOOL | Open () |
virtual BOOL | Start () |
virtual BOOL | Close () |
virtual BOOL | WritePackets (RTP_DataFrameList &packets) |
virtual BOOL | ReadPacket (RTP_DataFrame &packet) |
virtual BOOL | WritePacket (RTP_DataFrame &packet) |
virtual BOOL | ReadData (BYTE *data, PINDEX size, PINDEX &length) |
virtual BOOL | WriteData (const BYTE *data, PINDEX length, PINDEX &written) |
virtual BOOL | SetDataSize (PINDEX dataSize) |
PINDEX | GetDataSize () const |
virtual BOOL | IsSynchronous () const =0 |
virtual BOOL | RequiresPatchThread () const |
virtual void | EnableJitterBuffer () const |
Member variable access | |
BOOL | IsSource () const |
BOOL | IsSink () const |
unsigned | GetSessionID () const |
unsigned | GetTimestamp () const |
void | SetTimestamp (unsigned ts) |
BOOL | GetMarker () const |
void | SetMarker (BOOL m) |
BOOL | IsPaused () const |
void | SetPaused (BOOL p) |
BOOL | IsOpen () |
void | SetPatch (OpalMediaPatch *patch) |
OpalMediaPatch * | GetPatch () const |
Protected Attributes | |
OpalMediaFormat | mediaFormat |
unsigned | sessionID |
BOOL | paused |
BOOL | isSource |
BOOL | isOpen |
PINDEX | defaultDataSize |
unsigned | timestamp |
BOOL | marker |
unsigned | mismatchedPayloadTypes |
OpalMediaPatch * | patchThread |
PMutex | patchMutex |
PNotifier | commandNotifier |
|
Construct a new media stream.
|
|
Destroy the media stream. Make sure the patch, if present, has been stopped and deleted. |
|
Close the media stream. The default does nothing. Reimplemented in OpalIAX2MediaStream, OpalLineMediaStream, OpalRTPMediaStream, and OpalRawMediaStream. |
|
Enable jitter buffer for the media stream. The default behaviour does nothing. Reimplemented in OpalRTPMediaStream. |
|
Execute the command specified to the transcoder. The commands are highly context sensitive, for example VideoFastUpdate would only apply to a video transcoder. The default behaviour passes the command on to the OpalMediaPatch.
|
|
Get the data size in bytes that is expected to be used. Some media streams can make use of this information to perform optimisations. |
|
Get the marker bit of last read. |
|
Get the currently selected media format. The media data format is a string representation of the format being transferred by the media channel. It is typically a value as provided by the RTP_PayloadType class. The default behaviour simply returns the member variable "mediaFormat". |
|
Get the patch thread that is using the stream. |
|
Get the session number of the stream. |
|
Get the timestamp of last read. |
|
Returns TRUE if the media stream is open. |
|
Get the paused state for writing. |
|
Determine of media stream is a source or a sink. |
|
Determine of media stream is a source or a sink. |
|
Indicate if the media stream is synchronous. If this returns TRUE then the media stream will block of the amount of time it takes to annunciate the data. For example if the media stream is over a sound card, and 480 bytes of data are to be written it will take 30 milliseconds to complete. Implemented in OpalIAX2MediaStream, OpalLineMediaStream, OpalNullMediaStream, OpalRTPMediaStream, OpalFileMediaStream, OpalAudioMediaStream, and OpalVideoMediaStream. |
|
Open the media stream using the media format. The default behaviour simply sets the isOpen variable to TRUE. Reimplemented in OpalIAX2MediaStream, OpalLineMediaStream, OpalRTPMediaStream, and OpalVideoMediaStream. |
|
Standard stream print function. The PObject class has a << operator defined that calls this function polymorphically.
|
|
Read raw media data from the source media stream. The default behaviour simply calls ReadPacket() on the data portion of the RTP_DataFrame and sets the frames timestamp and marker from the internal member variables of the media stream class.
Reimplemented in OpalIAX2MediaStream, OpalLineMediaStream, OpalNullMediaStream, OpalRawMediaStream, and OpalVideoMediaStream. |
|
Read an RTP frame of data from the source media stream. The default behaviour simply calls ReadData() on the data portion of the RTP_DataFrame and sets the frames timestamp and marker from the internal member variables of the media stream class. Reimplemented in OpalRTPMediaStream. |
|
Indicate if the media stream requires a OpalMediaPatch thread. The default behaviour returns TRUE. Reimplemented in OpalNullMediaStream. |
|
Set a notifier to receive commands generated by the transcoder. The commands are highly context sensitive, for example VideoFastUpdate would only apply to a video transcoder. The default behaviour passes the command on to the OpalMediaPatch and sets the member variable commandNotifier.
|
|
Set the data size in bytes that is expected to be used. Some media streams can make use of this information to perform optimisations. The default behaviour does nothing.
Reimplemented in OpalAudioMediaStream, and OpalVideoMediaStream. |
|
Set marker bit for next write. |
|
Set the patch thread that is using this stream.
|
|
Set the paused state for writing. |
|
Set timestamp for next write. |
|
Start the media stream. The default behaviour calls Resume() on the associated OpalMediaPatch thread if it was suspended. Reimplemented in OpalIAX2MediaStream. |
|
Update the media format. This can be used to adjust the parameters of a codec at run time. Note you cannot change the basic media format, eg change GSM0610 to G.711, only options for that format, eg 6k3 mode to 5k3 mode in G.723.1. The default behaviour updates the mediaFormat member variable and pases the value on to the OpalMediaPatch.
|
|
Write raw media data to the sink media stream. The default behaviour calls WritePacket() on the data portion of the RTP_DataFrame and and sets the internal timestamp and marker from the member variables of the media stream class.
Reimplemented in OpalIAX2MediaStream, OpalLineMediaStream, OpalNullMediaStream, OpalRawMediaStream, and OpalVideoMediaStream. |
|
Write an RTP frame of data to the sink media stream. The default behaviour simply calls WriteData() on the data portion of the RTP_DataFrame and and sets the internal timestamp and marker from the member variables of the media stream class. Reimplemented in OpalRTPMediaStream. |
|
Write a list of RTP frames of data to the sink media stream. The default behaviour simply calls WritePacket() on each of the elements in the list. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|