0

When the audio codec is Opus, some extra parameters are very important for our integration.

Is there a way to get codec delay, seek preroll and codec private?

When SB_API_VERSION is not less than SB_AUDIO_SPECIFIC_CONFIG_AS_POINTER, 'codec private' for Opus has been passed to starboard.

As I am not very sure whether the audio sample was preprocessed with 'codec delay' and 'seek preroll', is it unnecessary for audio decoder to use those?

Ceri Ruan
  • 13
  • 3

1 Answers1

0

Opus metadata is stored in AudioDecoderConfig::extra_data() and passed into SbPlayerCreate() via SbMediaAudioHeader::audio_specific_config. You may parse it by using code similar to ParseOpusHeader function inside "media/filters/opus_audio_decoder.cc".

Unfortunately |audio_specific_config| is an array of 8 bytes in COBALT_9 and the extra bytes of the Opus metadata is missing. There is several solution to this: 1. Remove support of Opus as it is optional per the 2017 requirements. Use aac instead. 2. Use an Opus decoder that doesn't need the metadata. 3. Wait until COBALT_11 is released, in which version the size limit of |audio_specific_config| is removed. But this may not be feasible per your 2017 release schedule. 4. Increase the size of SbMediaAudioHeader::audio_specific_config to a larger number (say 1024). This will make your future rebase slightly harder.

xiaoming
  • 101
  • 2
  • Thanks for your information and advice. I would like to enlarge the config and try to parse it. – Ceri Ruan May 27 '17 at 01:30
  • It's worth noting that after you make such modification you may have to resolve conflicts manually when upgrade to cobalt 11. But I'd expect the work to be trivial. – xiaoming May 28 '17 at 01:45