# OpalMediaFormatList Class Reference

`#include <mediafmt.h>`

List of all members.

## Public Member Functions

Operations
OpalMediaFormatList & | operator+= (const OpalMediaFormat &format)
OpalMediaFormatList & | operator+= (const OpalMediaFormatList &formats)
OpalMediaFormatList & | operator-= (const OpalMediaFormat &format)
OpalMediaFormatList & | operator-= (const OpalMediaFormatList &formats)
const_iterator | FindFormat (RTP_DataFrame::PayloadTypes rtpPayloadType, const unsigned clockRate, const char *rtpEncodingName=NULL, const char *protocol=NULL) const
const_iterator | FindFormat (const PString &wildcard, const_iterator start=const_iterator()) const
PBoolean | HasFormat (RTP_DataFrame::PayloadTypes rtpPayloadType) const
PBoolean | HasFormat (const PString &wildcard) const
void | Remove (const PStringArray &mask)
void | Reorder (const PStringArray &order)

## Detailed Description

This class contains a list of media formats.

## Constructor & Destructor Documentation

OpalMediaFormatList::OpalMediaFormatList | ( |  | ) |

Create an empty media format list.

OpalMediaFormatList::OpalMediaFormatList | ( | const OpalMediaFormat & | format | ) |

Create a media format list with one media format in it.

Parameters:

  format | Format to add

OpalMediaFormatList::OpalMediaFormatList | ( | const OpalMediaFormatList & | l | ) | `[inline]`

Create a copy of a media format list.

OpalMediaFormatList::OpalMediaFormatList | ( |  | ) |

Create an empty media format list.

OpalMediaFormatList::OpalMediaFormatList | ( | const OpalMediaFormat & | format | ) |

Create a media format list with one media format in it.

Parameters:

  format | Format to add

OpalMediaFormatList::OpalMediaFormatList | ( | const OpalMediaFormatList & | l | ) | `[inline]`

Create a copy of a media format list.

## Member Function Documentation

OpalMediaFormatList& OpalMediaFormatList::operator+= | ( | const OpalMediaFormat & | format | ) |

Add a format to the list. If the format is invalid or already in the list then it is not added.

Parameters:

  format | Format to add

OpalMediaFormatList& OpalMediaFormatList::operator+= | ( | const OpalMediaFormatList & | formats | ) |

Add a format to the list. If the format is invalid or already in the list then it is not added.

Parameters:

  formats | Formats to add

OpalMediaFormatList& OpalMediaFormatList::operator-= | ( | const OpalMediaFormat & | format | ) |

Remove a format to the list. If the format is invalid or not in the list then this does nothing.

Parameters:

  format | Format to remove

OpalMediaFormatList& OpalMediaFormatList::operator-= | ( | const OpalMediaFormatList & | formats | ) |

Remove a format to the list. If the format is invalid or not in the list then this does nothing.

Parameters:

  formats | Formats to remove

const_iterator OpalMediaFormatList::FindFormat | ( | RTP_DataFrame::PayloadTypes | rtpPayloadType,
|  | const unsigned | clockRate,
|  | const char * | rtpEncodingName = `NULL`,
|  | const char * | protocol = `NULL` |
| ) |  |  | const

Get a format position in the list matching the payload type.

Returns P_MAX_INDEX if not in list.

Parameters:

  rtpPayloadType | RTP payload type code
  clockRate | clock rate
  rtpEncodingName | RTP payload type name
  protocol | protocol to be valid for (if NULL, then all)

const_iterator OpalMediaFormatList::FindFormat | ( | const PString & | wildcard,
|  | const_iterator | start = `const_iterator()` |
| ) |  |  | const

Get a format position in the list matching the wildcard. The wildcard string is a simple substring match using the '*' character. For example: "G.711*" would match "G.711-uLaw-64k" and "G.711-ALaw-64k".

Returns P_MAX_INDEX if not in list.

Parameters:

  wildcard | Wildcard string name.

PBoolean OpalMediaFormatList::HasFormat | ( | RTP_DataFrame::PayloadTypes | rtpPayloadType | ) | const`[inline]`

Determine if a format matching the payload type is in the list.

Parameters:

  rtpPayloadType | RTP payload type code

PBoolean OpalMediaFormatList::HasFormat | ( | const PString & | wildcard | ) | const`[inline]`

Determine if a format matching the wildcard is in the list. The wildcard string is a simple substring match using the '*' character. For example: "G.711*" would match "G.711-uLaw-64k" and "G.711-ALaw-64k".

Parameters:

  wildcard | Wildcard string name.

void OpalMediaFormatList::Remove | ( | const PStringArray & | mask | ) |

Remove all the formats specified.

void OpalMediaFormatList::Reorder | ( | const PStringArray & | order | ) |

Reorder the formats in the list. The order variable is an array of wildcards and the list is reordered according to the order in that array.

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

- mediafmt.h