chromium/media/ffmpeg/ffmpeg_common_unittest.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#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) {}

// Verifies there are no collisions of the codec name hashes used for UMA.  Also
// includes code for updating the histograms XML.
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  // BUILDFLAG(ENABLE_PLATFORM_HEVC)
#endif  // BUILDFLAG(USE_PROPRIETARY_CODECS)

// Verifies that the HDR Metadata and VideoColorSpace are correctly parsed.
TEST_F(FFmpegCommonTest, VerifyHDRMetadataAndColorSpaceInfo) {}

#if BUILDFLAG(ENABLE_AV1_DECODER)
TEST_F(FFmpegCommonTest, VerifyAv1Profiles) {}
#endif

}  // namespace media