chromium/media/base/audio_codecs.h

// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef MEDIA_BASE_AUDIO_CODECS_H_
#define MEDIA_BASE_AUDIO_CODECS_H_

#include <string>
#include <string_view>

#include "media/base/media_export.h"
#include "media/media_buildflags.h"

namespace media {

enum class AudioCodec {};

enum class AudioCodecProfile {};

std::string MEDIA_EXPORT GetCodecName(AudioCodec codec);
std::string MEDIA_EXPORT GetProfileName(AudioCodecProfile profile);

MEDIA_EXPORT std::ostream& operator<<(std::ostream& os,
                                      const AudioCodec& codec);
MEDIA_EXPORT AudioCodec StringToAudioCodec(const std::string& codec_id);
#if BUILDFLAG(ENABLE_PLATFORM_AC4_AUDIO)
MEDIA_EXPORT bool ParseDolbyAc4CodecId(const std::string& codec_id,
                                       uint8_t* bitstream_version,
                                       uint8_t* presentation_version,
                                       uint8_t* presentation_level);
#endif  // BUILDFLAG(ENABLE_PLATFORM_AC4_AUDIO)
#if BUILDFLAG(ENABLE_PLATFORM_IAMF_AUDIO)
MEDIA_EXPORT bool ParseIamfCodecId(std::string_view codec_id,
                                   uint8_t* primary_profilec,
                                   uint8_t* additional_profilec);
#endif  // BUILDFLAG(ENABLE_PLATFORM_IAMF_AUDIO)

}  // namespace media

#endif  // MEDIA_BASE_AUDIO_CODECS_H_