chromium/media/gpu/h264_decoder_unittest.cc

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

#include <stdint.h>
#include <string.h>

#include <cstring>
#include <memory>
#include <string>

#include "base/check.h"
#include "base/command_line.h"
#include "base/containers/queue.h"
#include "base/containers/span.h"
#include "base/files/file_util.h"
#include "base/memory/raw_ptr.h"
#include "media/base/test_data_util.h"
#include "media/gpu/h264_decoder.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

_;
Args;
Expectation;
InSequence;
MakeMatcher;
Matcher;
MatcherInterface;
MatchResultListener;
Mock;
Return;

namespace media {
namespace {

const std::string kBaselineFrame0 =;
const std::string kBaselineFrame1 =;
const std::string kBaselineFrame2 =;
const std::string kBaselineFrame3 =;
const std::string kHighFrame0 =;
const std::string kHighFrame1 =;
const std::string kHighFrame2 =;
const std::string kHighFrame3 =;
const std::string k10BitFrame0 =;
const std::string k10BitFrame1 =;
const std::string k10BitFrame2 =;
const std::string k10BitFrame3 =;
const std::string kYUV444Frame =;

// Checks whether the decrypt config in the picture matches the decrypt config
// passed to this matcher.
MATCHER_P(DecryptConfigMatches, decrypt_config, "") {}

MATCHER(SubsampleSizeMatches, "Verify subsample sizes match buffer size") {}

// Emulates encrypted slice header parsing. We don't actually encrypt the data
// so we can easily do this by just parsing it.
H264Decoder::H264Accelerator::Status ParseSliceHeader(
    const std::vector<base::span<const uint8_t>>& data,
    const std::vector<SubsampleEntry>& subsamples,
    const std::vector<uint8_t>& sps_nalu_data,
    const std::vector<uint8_t>& pps_nalu_data,
    H264SliceHeader* slice_hdr_out) {}

class MockH264Accelerator : public H264Decoder::H264Accelerator {};

// Test H264Decoder by feeding different of h264 frame sequences and make
// sure it behaves as expected.
class H264DecoderTest : public ::testing::Test {};

void H264DecoderTest::SetUp() {}

void H264DecoderTest::SetInputFrameFiles(
    const std::vector<std::string>& input_frame_files) {}

AcceleratedVideoDecoder::DecodeResult H264DecoderTest::Decode(
    bool full_sample_encryption) {}

// To have better description on mismatch.
class WithPocMatcher : public MatcherInterface<scoped_refptr<H264Picture>> {};

inline Matcher<scoped_refptr<H264Picture>> WithPoc(int expected_poc) {}

// Test Cases

TEST_F(H264DecoderTest, DecodeSingleFrame) {}

// This is for CENCv1 full sample encryption.
TEST_F(H264DecoderTest, DecodeSingleEncryptedFrame) {}

TEST_F(H264DecoderTest, SkipNonIDRFrames) {}

TEST_F(H264DecoderTest, DecodeProfileBaseline) {}

TEST_F(H264DecoderTest, Decode10BitStream) {}

TEST_F(H264DecoderTest, OutputPictureFailureCausesDecodeToFail) {}

TEST_F(H264DecoderTest, DecodeProfileHigh) {}

TEST_F(H264DecoderTest, DenyDecodeNonYUV420) {}

TEST_F(H264DecoderTest, SwitchBaselineToHigh) {}

TEST_F(H264DecoderTest, SwitchHighToBaseline) {}

TEST_F(H264DecoderTest, SwitchYUV420ToNonYUV420) {}

// Verify that the decryption config is passed to the accelerator.
TEST_F(H264DecoderTest, SetEncryptedStream) {}

TEST_F(H264DecoderTest, ParseEncryptedSliceHeaderRetry) {}

TEST_F(H264DecoderTest, SubmitFrameMetadataRetry) {}

TEST_F(H264DecoderTest, SubmitSliceRetry) {}

TEST_F(H264DecoderTest, SubmitDecodeRetry) {}

TEST_F(H264DecoderTest, SetStreamRetry) {}

}  // namespace
}  // namespace media