예제 #1
0
파일: AmAudioFile.cpp 프로젝트: 46labs/sems
amci_codec_t* AmAudioFileFormat::getCodec()
{
  if(p_subtype && p_subtype->codec_id != codec_id){
    codec_id = p_subtype->codec_id;
    destroyCodec();
  }
  return AmAudioFormat::getCodec();
}
예제 #2
0
파일: AmAudioFile.cpp 프로젝트: 46labs/sems
void AmAudioFileFormat::setSubtypeId(int subtype_id)  { 
  if (subtype != subtype_id) {
    DBG("changing file subtype to ID %d\n", subtype_id);
    destroyCodec();
    subtype = subtype_id; 
    p_subtype = 0;
    codec = getCodec();
  }
}
예제 #3
0
int AmAudioRtpFormat::setCurrentPayload(Payload pl)
{
  if (this->codec_id != pl.codec_id) {
    DBG("setCurrentPayload({%u, '%s', %u, %u, %u, '%s'})\n",
	pl.pt, pl.name.c_str(), pl.clock_rate, pl.advertised_clock_rate,
	pl.codec_id, pl.format_parameters.c_str());
    this->codec_id = pl.codec_id;
    DBG("fmt.codec_id = %d", this->codec_id);
    this->channels = 1;
    this->rate = pl.clock_rate;
    DBG("fmt.rate = %d", this->rate);
    this->advertized_rate = pl.advertised_clock_rate;
    DBG("fmt.advertized_rate = %d", this->advertized_rate);
    this->frame_size = 20*this->rate/1000;
    this->sdp_format_parameters = pl.format_parameters;
    DBG("fmt.sdp_format_parameters = %s", this->sdp_format_parameters.c_str());
    if (this->codec != NULL) {
      destroyCodec();
    }
  }
  return 0;
}
예제 #4
0
AmAudioFormat::~AmAudioFormat()
{
  destroyCodec();
}