chromium/media/base/video_frame_converter_unittest.cc

// Copyright 2024 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/base/video_frame_converter.h"

#include "base/logging.h"
#include "media/base/test_helpers.h"
#include "media/base/video_frame.h"
#include "media/base/video_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/libyuv/include/libyuv.h"

namespace media {

namespace {

// Use 64x64 for visible size ensure U,V planes are > 8x8 since libyuv can't
// calculate the SSIM for smaller sizes.
constexpr gfx::Size kCodedSize(128, 128);
constexpr gfx::Rect kVisibleRect(64, 64, 64, 64);

gfx::Size SelectDestSize(bool scaled) {}

gfx::Rect SelectDestRect(bool scaled) {}

bool IsConversionSupported(VideoPixelFormat src, VideoPixelFormat dest) {}

// SSIM/PSNR mismatch debugging function. Writes a VideoFrame into a packed
// plane by plane layout that can be used with ffplay or ffmpeg to view the raw
// output or convert to png. E.g.,
//
//   ffplay -f rawvideo -pixel_format yuv444p -video_size 64x64 -framerate 1
//       expected_PIXEL_FORMAT_I444_64x64.bin
//
//   ffmpeg -f rawvideo -pixel_format yuv444p -video_size 64x64 -framerate 1
//       -i expected_PIXEL_FORMAT_I444_64x64.bin expected.png
//
[[maybe_unused]] void DumpFrame(const VideoFrame& frame, const char* prefix) {}

}  // namespace

TestParams;
class VideoFrameConverterTest
    : public testing::Test,
      public ::testing::WithParamInterface<TestParams> {};

TEST_P(VideoFrameConverterTest, ConvertAndScale) {}

INSTANTIATE_TEST_SUITE_P();

}  // namespace media