Esempio n. 1
0
bool OMXPlayerAudio::OpenDecoder()
{
  bool bAudioRenderOpen = false;

  m_decoder = new COMXAudio();
  m_decoder->SetClock(m_av_clock);

  if(m_use_passthrough)
    m_passthrough = IsPassthrough(m_hints);

  if(!m_passthrough && m_use_hw_decode)
    m_hw_decode = COMXAudio::HWDecode(m_hints.codec);

  if(m_passthrough || m_use_hw_decode)
  {
    if(m_passthrough)
      m_hw_decode = false;
    bAudioRenderOpen = m_decoder->Initialize(m_device.substr(4), m_pChannelMap,
                                             m_hints, m_av_clock, m_passthrough, 
                                             m_hw_decode, m_boost_on_downmix);
  }
  else
  {
    unsigned int downmix_channels = m_hints.channels;

    /* omx needs 6 channels packed into 8 for PCM */
    if(m_hints.channels == 6)
      m_hints.channels = 8;

    bAudioRenderOpen = m_decoder->Initialize(m_device.substr(4), m_hints.channels, m_pChannelMap,
                                             downmix_channels, m_hints.samplerate, m_hints.bitspersample,
                                             false, m_boost_on_downmix, false, m_passthrough);
  }

  m_codec_name = m_omx_reader->GetCodecName(OMXSTREAM_AUDIO);
  
  if(!bAudioRenderOpen)
  {
    delete m_decoder; 
    m_decoder = NULL;
    return false;
  }
  else
  {
    if(m_passthrough)
    {
      ofLog(OF_LOG_VERBOSE, "Audio codec %s channels %d samplerate %d bitspersample %d\n",
        m_codec_name.c_str(), 2, m_hints.samplerate, m_hints.bitspersample);
    }
    else
    {
      ofLog(OF_LOG_VERBOSE, "Audio codec %s channels %d samplerate %d bitspersample %d\n",
        m_codec_name.c_str(), m_hints.channels, m_hints.samplerate, m_hints.bitspersample);
    }
  }

  return true;
}
Esempio n. 2
0
bool OMXPlayerAudio::OpenDecoder()
{
  bool bAudioRenderOpen = false;

  m_decoder = new COMXAudio();

  if(m_use_passthrough)
    m_passthrough = IsPassthrough(m_hints);

  if(!m_passthrough && m_use_hw_decode)
    m_hw_decode = COMXAudio::HWDecode(m_hints.codec);

  if(m_passthrough || m_use_hw_decode)
  {
    if(m_passthrough)
      m_hw_decode = false;
    bAudioRenderOpen = m_decoder->Initialize(m_device.substr(4), m_pChannelMap,
                                             m_hints, m_av_clock, m_passthrough,
                                             m_hw_decode, m_boost_on_downmix, m_initialVolume, m_fifo_size);
  }
  else
  {
    unsigned int downmix_channels = m_hints.channels;

    bAudioRenderOpen = m_decoder->Initialize(m_device.substr(4), m_hints.channels, m_pChannelMap,
                                             downmix_channels, m_hints.samplerate, m_pAudioCodec->GetBitsPerSample(),
                                             m_boost_on_downmix, m_av_clock, m_passthrough, m_initialVolume, m_fifo_size);
  }

  m_codec_name = m_omx_reader->GetCodecName(OMXSTREAM_AUDIO);
  
  if(!bAudioRenderOpen)
  {
    delete m_decoder; 
    m_decoder = NULL;
    return false;
  }
  else
  {
    if(m_passthrough)
    {
      printf("Audio codec %s passthrough channels %d samplerate %d bitspersample %d\n",
        m_codec_name.c_str(), m_hints.channels, m_hints.samplerate, m_hints.bitspersample);
    }
    else
    {
      printf("Audio codec %s channels %d samplerate %d bitspersample %d\n",
        m_codec_name.c_str(), m_hints.channels, m_hints.samplerate, m_hints.bitspersample);
    }
  }

  return true;
}
Esempio n. 3
0
bool OMXPlayerAudio::OpenDecoder()
{
  bool bAudioRenderOpen = false;

  m_decoder = new COMXAudio();

  if(m_use_passthrough)
    m_passthrough = IsPassthrough(m_hints);

  if(!m_passthrough && m_use_hw_decode)
    m_hw_decode = COMXAudio::HWDecode(m_hints.codec);

  if(m_passthrough)
    m_hw_decode = false;

  bAudioRenderOpen = m_decoder->Initialize(m_device, m_hints.channels, m_pAudioCodec->GetChannelMap(),
                           m_hints, m_layout, m_hints.samplerate, m_pAudioCodec->GetBitsPerSample(), m_boost_on_downmix,
                           m_av_clock, m_passthrough, m_hw_decode, m_live, m_fifo_size);

  m_codec_name = m_omx_reader->GetCodecName(OMXSTREAM_AUDIO);
  
  if(!bAudioRenderOpen)
  {
    delete m_decoder; 
    m_decoder = NULL;
    return false;
  }
/*  else
  {
    if(m_passthrough)
    {
      printf("Audio codec %s passthrough channels %d samplerate %d bitspersample %d\n",
        m_codec_name.c_str(), m_hints.channels, m_hints.samplerate, m_hints.bitspersample);
    }
    else
    {
      printf("Audio codec %s channels %d samplerate %d bitspersample %d\n",
        m_codec_name.c_str(), m_hints.channels, m_hints.samplerate, m_hints.bitspersample);
    }
  }
*/
  // setup current volume settings
  m_decoder->SetVolume(m_CurrentVolume);
  m_decoder->SetMute(m_mute);
  m_decoder->SetDynamicRangeCompression(m_amplification);

  return true;
}