OpalMediaFormat Class Reference

#include <mediafmt.h>

List of all members.

Public Types

enum  { DefaultAudioSessionID = 1, DefaultVideoSessionID = 2, DefaultDataSessionID = 3, DefaultH224SessionID = 4 }
enum  StandardTimeUnits { AudioTimeUnits = 8, VideoTimeUnits = 90 }

Public Member Functions

 PLIST (List, OpalMediaFormat)
 OpalMediaFormat ()
 OpalMediaFormat (const char *search, BOOL exact=TRUE)
BOOL IsValid () const
RTP_DataFrame::PayloadTypes GetPayloadType () const
unsigned GetDefaultSessionID () const
BOOL NeedsJitterBuffer () const
unsigned GetBandwidth () const
PINDEX GetFrameSize () const
unsigned GetFrameTime () const
unsigned GetTimeUnits () const
 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)

Static Public Member Functions

static List GetRegisteredMediaFormats ()
static void GetRegisteredMediaFormats (List &list)

Protected Attributes

RTP_DataFrame::PayloadTypes rtpPayloadType
unsigned defaultSessionID
BOOL needsJitter
unsigned bandwidth
PINDEX frameSize
unsigned frameTime
unsigned timeUnits
time_t codecBaseTime

Friends

class OpalStaticMediaFormat


Detailed Description

This class describes a media format as used in the OPAL system. A media format is the type of any media data that is trasferred between OPAL entities. For example an audio codec such as G.723.1 is a media format, a video codec such as H.261 is also a media format.

Member Enumeration Documentation

anonymous enum

Enumerator:
DefaultAudioSessionID 
DefaultVideoSessionID 
DefaultDataSessionID 
DefaultH224SessionID 

Enumerator:
AudioTimeUnits  8kHz sample rate
VideoTimeUnits  90kHz sample rate


Constructor & Destructor Documentation

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.

Parameters:
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.

Parameters:
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)


Member Function Documentation

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.

References RTP_DataFrame::MaxPayloadType, and rtpPayloadType.

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.

References rtpPayloadType.

unsigned OpalMediaFormat::GetDefaultSessionID (  )  const [inline]

Get the default session ID for media format.

References defaultSessionID.

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.

References needsJitter.

unsigned OpalMediaFormat::GetBandwidth (  )  const [inline]

Get the average bandwidth used in bits/second.

References bandwidth.

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.

References frameSize.

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

References frameTime.

unsigned OpalMediaFormat::GetTimeUnits (  )  const [inline]

Get the number of RTP timestamp units per millisecond.

References timeUnits.

static List OpalMediaFormat::GetRegisteredMediaFormats (  )  [static]

Get the list of media formats that have been registered.

static void OpalMediaFormat::GetRegisteredMediaFormats ( List &  list  )  [static]


Friends And Related Function Documentation

friend class OpalStaticMediaFormat [friend]


Member Data Documentation

Referenced by GetPayloadType(), and IsValid().

unsigned OpalMediaFormat::defaultSessionID [protected]

Referenced by GetDefaultSessionID().

BOOL OpalMediaFormat::needsJitter [protected]

Referenced by NeedsJitterBuffer().

unsigned OpalMediaFormat::bandwidth [protected]

Referenced by GetBandwidth().

PINDEX OpalMediaFormat::frameSize [protected]

Referenced by GetFrameSize().

unsigned OpalMediaFormat::frameTime [protected]

Referenced by GetFrameTime().

unsigned OpalMediaFormat::timeUnits [protected]

Referenced by GetTimeUnits().

time_t OpalMediaFormat::codecBaseTime [protected]


The documentation for this class was generated from the following file:

Generated on Mon Sep 1 12:40:00 2008 for OpenH323 by  doxygen 1.5.6