#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "media/ffmpeg/ffmpeg_common.h"
#include <stddef.h>
#include <stdint.h>
#include <cstring>
#include "base/files/memory_mapped_file.h"
#include "base/functional/bind.h"
#include "base/logging.h"
#include "media/base/audio_decoder_config.h"
#include "media/base/media.h"
#include "media/base/media_util.h"
#include "media/base/test_data_util.h"
#include "media/base/video_decoder_config.h"
#include "media/filters/ffmpeg_glue.h"
#include "media/filters/in_memory_url_protocol.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace media {
class FFmpegCommonTest : public testing::Test { … };
uint8_t kExtraData[5] = …;
template <typename T>
void TestConfigConvertExtraData(
AVStream* stream,
T* decoder_config,
const base::RepeatingCallback<bool(const AVStream*, T*)>& converter_fn) { … }
void VerifyProfileTest(const char* file_name,
VideoCodecProfile expected_profile) { … }
TEST_F(FFmpegCommonTest, AVStreamToDecoderConfig) { … }
TEST_F(FFmpegCommonTest, AVStreamToAudioDecoderConfig_OpusAmbisonics_4ch) { … }
TEST_F(FFmpegCommonTest, AVStreamToAudioDecoderConfig_OpusAmbisonics_11ch) { … }
TEST_F(FFmpegCommonTest, AVStreamToAudioDecoderConfig_9ch_wav) { … }
TEST_F(FFmpegCommonTest, TimeBaseConversions) { … }
TEST_F(FFmpegCommonTest, VerifyFormatSizes) { … }
TEST_F(FFmpegCommonTest, VerifyUmaCodecHashes) { … }
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
TEST_F(FFmpegCommonTest, VerifyH264Profile) {
VerifyProfileTest("bear-1280x720.mp4", H264PROFILE_HIGH);
}
#if BUILDFLAG(ENABLE_PLATFORM_HEVC)
TEST_F(FFmpegCommonTest, VerifyH265MainProfile) {
VerifyProfileTest("bear-1280x720-hevc.mp4", HEVCPROFILE_MAIN);
}
TEST_F(FFmpegCommonTest, VerifyH265Main10Profile) {
VerifyProfileTest("bear-1280x720-hevc-10bit.mp4", HEVCPROFILE_MAIN10);
}
#endif
#endif
TEST_F(FFmpegCommonTest, VerifyHDRMetadataAndColorSpaceInfo) { … }
#if BUILDFLAG(ENABLE_AV1_DECODER)
TEST_F(FFmpegCommonTest, VerifyAv1Profiles) { … }
#endif
}