Example #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);
}
Example #2
0
void CallManager::GetAllowedFormats (OpalMediaFormatList & full_list)
{
  OpalMediaFormatList list = OpalTranscoder::GetPossibleFormats (pcssEP->GetMediaFormats ());
  std::list<std::string> black_list;

  black_list.push_back ("GSM-AMR");
  black_list.push_back ("Linear-16-Stereo-48kHz");
  black_list.push_back ("LPC-10");
  black_list.push_back ("SpeexIETFNarrow-11k");
  black_list.push_back ("SpeexIETFNarrow-15k");
  black_list.push_back ("SpeexIETFNarrow-18.2k");
  black_list.push_back ("SpeexIETFNarrow-24.6k");
  black_list.push_back ("SpeexIETFNarrow-5.95k");
  black_list.push_back ("iLBC-13k3");
  black_list.push_back ("iLBC-15k2");
  black_list.push_back ("RFC4175_YCbCr-4:2:0");
  black_list.push_back ("RFC4175_RGB");

  // Purge blacklisted codecs
  for (PINDEX i = 0 ; i < list.GetSize () ; i++) {

    std::list<std::string>::iterator it = find (black_list.begin (), black_list.end (), (const char *) list [i]);
    if (it == black_list.end ()) {
      if (list [i].GetMediaType () == OpalMediaType::Audio () || list [i].GetMediaType () == OpalMediaType::Video ())
        full_list += list [i];
    }
  }
}
Example #3
0
void
CallManager::OnClosedMediaStream (const OpalMediaStream & stream)
{
  OpalMediaFormatList list = pcssEP->GetMediaFormats ();
  OpalManager::OnClosedMediaStream (stream);

  if (list.FindFormat(stream.GetMediaFormat()) != list.end ())
    dynamic_cast <Opal::Call &> (stream.GetConnection ().GetCall ()).OnClosedMediaStream ((OpalMediaStream &) stream);
}
Example #4
0
bool
CallManager::OnOpenMediaStream (OpalConnection & connection,
				OpalMediaStream & stream)
{
  OpalMediaFormatList list = pcssEP->GetMediaFormats ();
  if (!OpalManager::OnOpenMediaStream (connection, stream))
    return FALSE;

  if (list.FindFormat(stream.GetMediaFormat()) == list.end ())
    dynamic_cast <Opal::Call &> (connection.GetCall ()).OnOpenMediaStream (stream);

  return TRUE;
}
Example #5
0
void
CodecList::GetAllowedFormats (OpalMediaFormatList & formats)
{
  OpalMediaFormat::GetAllRegisteredMediaFormats (formats);
  formats.RemoveNonTransportable ();

  OpalMediaFormatList black_list;

  black_list += "Linear-16-Stereo-48kHz";
  black_list += "LPC-10";
  black_list += "Speex*";
  black_list += "FECC*";
  black_list += "RFC4175*";

  // Blacklist NSE, since it is unused in ekiga and might create
  // problems with some registrars (such as Eutelia)
  black_list += "NamedSignalEvent";

  // Only keep OPUS in mono mode (for VoIP chat)
  // and with the maximum sample rate
  black_list += "Opus-8*";
  black_list += "Opus-12*";
  black_list += "Opus-16*";
  black_list += "Opus-24*";
  black_list += "Opus-48S";

  // Only include the VP8 RFC version of the capability
  black_list += "VP8-OM";

  // Purge blacklisted codecs
  formats -= black_list;

  // Only keep audio and video codecs
  for (int i = 0 ; i < formats.GetSize () ; i++) {
    if (formats[i].GetMediaType () != OpalMediaType::Audio ()
        && formats[i].GetMediaType () != OpalMediaType::Video ())
      formats -= formats[i];
  }

  PTRACE(4, "Ekiga\tAll available audio & video media formats: " << setfill (',') << formats);
}
Example #6
0
void
CodecList::load (const std::list<std::string> & codecs_config)
{
  OpalMediaFormatList formats;
  GetAllowedFormats (formats);

  clear ();

  // FIXME: This is not very efficient.
  // We add each codec of the string list to our own internal list
  for (std::list<std::string>::const_iterator iter = codecs_config.begin ();
       iter != codecs_config.end ();
       iter++) {

    std::vector<std::string> strs;
    boost::split (strs, *iter, boost::is_any_of (":"));

    for (int i = 0 ; i < formats.GetSize () ; i++) {
      // Found our codec in the formats, add it to our
      // internal lists
      if (strs[0] == (const char *) formats[i]) {
        CodecDescription d (formats[i], (strs[1] == "1"));
        append (d);
        formats -= formats[i];
        break;
      }
    }
  }

  // We will now add codecs which were not part of the codecs_config
  // list but that we support (ie all codecs from "list").
  for (int i = 0 ; i < formats.GetSize () ; i++) {
    CodecDescription d (formats[i], false);
    append (d);
  }
}