#include <mediafmt.h>
OpalMediaFormat::OpalMediaFormat | ( | ) |
Default constructor creates a PCM-16 media format.
OpalMediaFormat::OpalMediaFormat | ( | const char * | search, | |
BOOL | exact = TRUE | |||
) |
A constructor that only has a string name will search through the RegisteredMediaFormats list for the full specification so the other information fields can be set from the database.
search | Name to search for |
exact | Flag for if search is to match name exactly |
OpalMediaFormat::OpalMediaFormat | ( | const char * | fullName, | |
unsigned | defaultSessionID, | |||
RTP_DataFrame::PayloadTypes | rtpPayloadType, | |||
BOOL | needsJitter, | |||
unsigned | bandwidth, | |||
PINDEX | frameSize = 0 , |
|||
unsigned | frameTime = 0 , |
|||
unsigned | timeUnits = 0 , |
|||
time_t | timeStamp = 0 | |||
) |
This form of the constructor will register the full details of the media format into an internal database. This would typically be used as a static global. In fact it would be very dangerous for an instance to use this constructor in any other way, especially local variables.
If the rtpPayloadType is RTP_DataFrame::DynamicBase, then the RTP payload type is actually set to teh first unused dynamic RTP payload type that is in the registers set of media formats.
The frameSize parameter indicates that the media format has a maximum size for each data frame, eg G.723.1 frames are no more than 24 bytes long. If zero then there is no intrinsic maximum, eg G.711.
fullName | Full name of media format |
defaultSessionID | Default session for codec type |
rtpPayloadType | RTP payload type code |
needsJitter | Indicate format requires a jitter buffer |
bandwidth | Bandwidth in bits/second |
frameSize | Size of frame in bytes (if applicable) |
frameTime | Time for frame in RTP units (if applicable) |
timeUnits | RTP units for frameTime (if applicable) |
timeStamp | timestamp (for versioning) |
OpalMediaFormat::PLIST | ( | List | , | |
OpalMediaFormat | ||||
) |
BOOL OpalMediaFormat::IsValid | ( | ) | const [inline] |
Return TRUE if media format info is valid. This may be used if the single string constructor is used to check that it matched something in the registered media formats database.
RTP_DataFrame::PayloadTypes OpalMediaFormat::GetPayloadType | ( | ) | const [inline] |
Get the RTP payload type that is to be used for this media format. This will either be an intrinsic one for the media format eg GSM or it will be automatically calculated as a dynamic media format that will be uniqueue amongst the registered media formats.
unsigned OpalMediaFormat::GetDefaultSessionID | ( | ) | const [inline] |
Get the default session ID for media format.
BOOL OpalMediaFormat::NeedsJitterBuffer | ( | ) | const [inline] |
Determine if the media format requires a jitter buffer. As a rule an audio codec needs a jitter buffer and all others do not.
unsigned OpalMediaFormat::GetBandwidth | ( | ) | const [inline] |
Get the average bandwidth used in bits/second.
PINDEX OpalMediaFormat::GetFrameSize | ( | ) | const [inline] |
Get the maximum frame size in bytes. If this returns zero then the media format has no intrinsic maximum frame size, eg G.711 would return zero but G.723.1 whoud return 24.
unsigned OpalMediaFormat::GetFrameTime | ( | ) | const [inline] |
Get the frame rate in RTP timestamp units. If this returns zero then the media format is not real time and has no intrinsic timing eg
unsigned OpalMediaFormat::GetTimeUnits | ( | ) | const [inline] |
Get the number of RTP timestamp units per millisecond.
static List OpalMediaFormat::GetRegisteredMediaFormats | ( | ) | [static] |
Get the list of media formats that have been registered.
static void OpalMediaFormat::GetRegisteredMediaFormats | ( | List & | list | ) | [static] |
friend class OpalStaticMediaFormat [friend] |
unsigned OpalMediaFormat::defaultSessionID [protected] |
BOOL OpalMediaFormat::needsJitter [protected] |
unsigned OpalMediaFormat::bandwidth [protected] |
PINDEX OpalMediaFormat::frameSize [protected] |
unsigned OpalMediaFormat::frameTime [protected] |
unsigned OpalMediaFormat::timeUnits [protected] |
time_t OpalMediaFormat::codecBaseTime [protected] |