Exemplo n.º 1
0
void XMH323Connection::OnDecodingVideoFailed(OpalMediaFormat & mediaFormat, INT ignore)
{
  excludedFormats += mediaFormat;
  
  // Request a mode change, use the existing audio / H.224 channels and all available video formats
  PString modePrefix = "";
  OpalMediaStreamPtr audioStream = GetMediaStream(OpalMediaType::Audio(), true);
  OpalMediaStreamPtr h224Stream = GetMediaStream(OpalH224MediaType::MediaType(), true);
  if (audioStream != NULL) {
    modePrefix += audioStream->GetMediaFormat().GetName() + "\t";
  }
  if (h224Stream != NULL) {
    modePrefix += h224Stream->GetMediaFormat().GetName() + "\t";
  }
  PString modes = "";
  OpalMediaFormatList mediaFormats = GetMediaFormats();
  mediaFormats -= excludedFormats;
  for (PINDEX i = 0; i < mediaFormats.GetSize(); i++) {
    const OpalMediaFormat & mediaFormat = mediaFormats[i];
    if (mediaFormat.GetMediaType() == OpalMediaType::Video()) {
      modes += modePrefix + mediaFormat.GetName() + "\n";
    }
  }
  PTRACE(1, "XMH323Con\tRequest mode change since can't decode incoming video stream");
  RequestModeChange(modes);
}
Exemplo n.º 2
0
CodecDescription::CodecDescription (const OpalMediaFormat & _format,
                                    bool _active)
{
  name = (const char *) _format;
  if (name == "G722")  // G722 has the wrong rate in RFC
    rate = 16000;
  else
    rate = _format.GetClockRate ();
  audio = (_format.GetMediaType () == OpalMediaType::Audio ());
  video = (_format.GetMediaType () == OpalMediaType::Video ());
  if (_format.IsValidForProtocol ("SIP"))
    protocols.push_back ("SIP");
  if (_format.IsValidForProtocol ("H.323"))
    protocols.push_back ("H.323");
  protocols.sort ();
  for (PINDEX i = 0 ; KnownCodecs[i][0] ; i++) {
    if (name == KnownCodecs[i][0]) {
      display_name = gettext (KnownCodecs[i][1]);
      display_info = gettext (KnownCodecs[i][2]);
      break;
    }
  }
  if (display_name.empty ())
    display_name = name;

  format = _format;
  active = _active;
}