# OpalMediaTypeDefinition Class Reference

`#include <mediatype.h>`

Inheritance diagram for OpalMediaTypeDefinition:

[legend]
Collaboration diagram for OpalMediaTypeDefinition:
[legend]

## Public Member Functions

| OpalMediaTypeDefinition (const char *mediaType, const char *mediaSession, unsigned requiredSessionId=0, OpalMediaType::AutoStartMode autoStart=OpalMediaType::DontOffer)
| Create a new media type definition.
virtual | ~OpalMediaTypeDefinition ()
OpalMediaType::AutoStartMode | GetAutoStart () const
void | SetAutoStart (OpalMediaType::AutoStartMode v)
void | SetAutoStart (OpalMediaType::AutoStartMode v, bool on)
unsigned | GetDefaultSessionId () const
const PString & | GetMediaSessionType () const
virtual bool | MatchesSDP (const PCaselessString &sdpMediaType, const PCaselessString &sdpTransport, const PStringArray &sdpLines, PINDEX index)
| Determine of this media type is valid for SDP m= section.
virtual SDPMediaDescription * | CreateSDPMediaDescription (const OpalTransportAddress &localAddress) const
| create an SDP media description entry for this media type

## Protected Attributes

OpalMediaType | m_mediaType
PString | m_mediaSessionType
unsigned | m_defaultSessionId
OpalMediaType::AutoStartMode | m_autoStart

## Detailed Description

This class defines the type used to define the attributes of a media type

## Constructor & Destructor Documentation

OpalMediaTypeDefinition::OpalMediaTypeDefinition | ( | const char * | mediaType,
|  | const char * | mediaSession,
|  | unsigned | requiredSessionId = `0`,
|  | OpalMediaType::AutoStartMode | autoStart = `OpalMediaType::DontOffer` |
| ) |  |  |

Create a new media type definition.

Parameters:

  mediaType | name of the media type (audio, video etc)
  mediaSession | name of media session class (via factory)
  requiredSessionId | Session ID to use, asserts if already in use
  autoStart | Default value for auto-start transmit & receive

virtual OpalMediaTypeDefinition::~OpalMediaTypeDefinition | ( |  | ) | `[virtual]`

## Member Function Documentation

virtual SDPMediaDescription* OpalMediaTypeDefinition::CreateSDPMediaDescription | ( | const OpalTransportAddress & | localAddress | ) | const`[virtual]`

create an SDP media description entry for this media type

Reimplemented in OpalH224MediaType, OpalAudioMediaType, and OpalVideoMediaType.

OpalMediaType::AutoStartMode OpalMediaTypeDefinition::GetAutoStart | ( |  | ) | const`[inline]`

Get flags for media type can auto-start on call initiation.

unsigned OpalMediaTypeDefinition::GetDefaultSessionId | ( |  | ) | const`[inline]`

Return the default session ID for this media type.

const PString& OpalMediaTypeDefinition::GetMediaSessionType | ( |  | ) | const`[inline]`

Return the default session type (factory name) for this media type.

virtual bool OpalMediaTypeDefinition::MatchesSDP | ( | const PCaselessString & | sdpMediaType,
|  | const PCaselessString & | sdpTransport,
|  | const PStringArray & | sdpLines,
|  | PINDEX | index |
| ) |  |  | `[virtual]`

Determine of this media type is valid for SDP m= section.

Reimplemented in OpalH224MediaType, and OpalRTPAVPMediaType.

void OpalMediaTypeDefinition::SetAutoStart | ( | OpalMediaType::AutoStartMode | v,
|  | bool | on |
| ) |  |  | `[inline]`

void OpalMediaTypeDefinition::SetAutoStart | ( | OpalMediaType::AutoStartMode | v | ) | `[inline]`

Set flag for media type can auto-start receive on call initiation.

## Field Documentation

OpalMediaType::AutoStartMode OpalMediaTypeDefinition::m_autoStart `[protected]`

unsigned OpalMediaTypeDefinition::m_defaultSessionId `[protected]`

PString OpalMediaTypeDefinition::m_mediaSessionType `[protected]`

OpalMediaType OpalMediaTypeDefinition::m_mediaType `[protected]`

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

- mediatype.h