Commit 7883e6b9 authored by David Staessens's avatar David Staessens Committed by Commit Bot

media/gpu/test: Cleanup and split test helpers build target.

This change splits up the test helpers target in separate encode, decode and
other helpers. Tests now only depend on what they actually need. This change
doesn't introduce any new code, but some things are moved to avoid weird
dependancies (such as encode helpers depending on frame mapper which depends on
decode helpers).

This change also moves code in the video_accelerator_unittest_helpers.h file
from the media to the media/test namespace.

TEST=ran video/jpeg encode/decode tests on nocturne

CQ-DEPEND=CL:1345670

BUG=879065

Change-Id: I17704399c5724cbacc5611578e0dec22191e7a50
Reviewed-on: https://chromium-review.googlesource.com/c/1345701Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Commit-Queue: David Staessens <dstaessens@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610757}
parent 3819e0e4
......@@ -363,10 +363,6 @@ source_set("common") {
# TODO(watk): Run this on bots. http://crbug.com/461437
if (is_win || is_android || use_v4l2_codec || use_vaapi) {
test("video_decode_accelerator_unittest") {
sources = [
"test/video_accelerator_unittest_helpers.h",
]
data = [
"//media/test/data/",
]
......@@ -392,9 +388,12 @@ if (is_win || is_android || use_v4l2_codec || use_vaapi) {
configs += [ "//third_party/khronos:khronos_headers" ]
if (is_win || is_chromeos || use_v4l2_codec) {
sources += [ "video_decode_accelerator_unittest.cc" ]
sources = [
"video_decode_accelerator_unittest.cc",
]
deps += [
"test:helpers",
"test:decode_helpers",
"test:frame_validator",
"//mojo/core/embedder",
"//ui/display",
"//ui/display/types",
......@@ -477,7 +476,7 @@ source_set("android_video_decode_accelerator_unittests") {
if (use_v4l2_codec || use_vaapi || is_mac || is_win) {
test("video_encode_accelerator_unittest") {
deps = [
"test:helpers",
"test:encode_helpers",
"//base",
"//base/test:test_support",
"//media:test_support",
......@@ -507,6 +506,7 @@ if (use_v4l2_codec || use_vaapi || is_mac || is_win) {
if (use_v4l2_codec || use_vaapi) {
test("jpeg_encode_accelerator_unittest") {
deps = [
"test:helpers",
"//base",
"//base/test:test_support",
"//media:test_support",
......@@ -525,7 +525,6 @@ if (use_v4l2_codec || use_vaapi) {
configs += [ "//third_party/libyuv:libyuv_config" ]
sources = [
"jpeg_encode_accelerator_unittest.cc",
"test/video_accelerator_unittest_helpers.h",
]
if (use_x11) {
deps += [ "//ui/gfx/x" ]
......@@ -539,6 +538,7 @@ if (use_v4l2_codec || use_vaapi) {
if (is_chromeos || is_linux) {
test("jpeg_decode_accelerator_unittest") {
deps = [
"test:helpers",
"//base",
"//media:test_support",
"//media/gpu",
......@@ -556,7 +556,6 @@ if (is_chromeos || is_linux) {
configs += [ "//third_party/libyuv:libyuv_config" ]
sources = [
"jpeg_decode_accelerator_unittest.cc",
"test/video_accelerator_unittest_helpers.h",
]
data = [
"//media/test/data/peach_pi-1280x720.jpg",
......
......@@ -2,10 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This has to be included first.
// See http://code.google.com/p/googletest/issues/detail?id=371
#include "testing/gtest/include/gtest/gtest.h"
#include <stddef.h>
#include <stdint.h>
#include <string.h>
......@@ -34,6 +30,7 @@
#include "media/gpu/test/video_accelerator_unittest_helpers.h"
#include "media/video/jpeg_decode_accelerator.h"
#include "mojo/core/embedder/embedder.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/libyuv/include/libyuv.h"
#include "ui/gfx/codec/jpeg_codec.h"
#include "ui/gfx/codec/png_codec.h"
......@@ -246,9 +243,10 @@ enum ClientState {
class JpegClient : public JpegDecodeAccelerator::Client {
public:
// JpegClient takes ownership of |note|.
JpegClient(const std::vector<ParsedJpegImage*>& test_image_files,
std::unique_ptr<ClientStateNotification<ClientState>> note,
bool is_skip);
JpegClient(
const std::vector<ParsedJpegImage*>& test_image_files,
std::unique_ptr<media::test::ClientStateNotification<ClientState>> note,
bool is_skip);
~JpegClient() override;
void CreateJpegDecoder();
void StartDecode(int32_t bitstream_buffer_id, bool do_prepare_memory = true);
......@@ -261,7 +259,9 @@ class JpegClient : public JpegDecodeAccelerator::Client {
JpegDecodeAccelerator::Error error) override;
// Accessors.
ClientStateNotification<ClientState>* note() const { return note_.get(); }
media::test::ClientStateNotification<ClientState>* note() const {
return note_.get();
}
private:
FRIEND_TEST_ALL_PREFIXES(JpegClientTest, GetMeanAbsoluteDifference);
......@@ -284,7 +284,7 @@ class JpegClient : public JpegDecodeAccelerator::Client {
ClientState state_;
// Used to notify another thread about the state. JpegClient owns this.
std::unique_ptr<ClientStateNotification<ClientState>> note_;
std::unique_ptr<media::test::ClientStateNotification<ClientState>> note_;
// Skip JDA decode result. Used for testing performance.
bool is_skip_;
......@@ -311,7 +311,7 @@ class JpegClient : public JpegDecodeAccelerator::Client {
JpegClient::JpegClient(
const std::vector<ParsedJpegImage*>& test_image_files,
std::unique_ptr<ClientStateNotification<ClientState>> note,
std::unique_ptr<media::test::ClientStateNotification<ClientState>> note,
bool is_skip)
: test_image_files_(test_image_files),
state_(CS_CREATED),
......@@ -588,7 +588,8 @@ void JpegDecodeAcceleratorTest::TestDecode(
for (size_t i = 0; i < num_concurrent_decoders; i++) {
auto client = std::make_unique<JpegClient>(
images, std::make_unique<ClientStateNotification<ClientState>>(),
images,
std::make_unique<media::test::ClientStateNotification<ClientState>>(),
false /* is_skip */);
scoped_clients.emplace_back(
new ScopedJpegClient(decoder_thread.task_runner(), std::move(client)));
......@@ -624,7 +625,8 @@ void JpegDecodeAcceleratorTest::PerfDecodeByJDA(
ASSERT_TRUE(decoder_thread.Start());
auto client = std::make_unique<JpegClient>(
images, std::make_unique<ClientStateNotification<ClientState>>(),
images,
std::make_unique<media::test::ClientStateNotification<ClientState>>(),
true /* is_skip */);
auto scoped_client = std::make_unique<ScopedJpegClient>(
decoder_thread.task_runner(), std::move(client));
......@@ -658,7 +660,8 @@ void JpegDecodeAcceleratorTest::PerfDecodeBySW(
LOG_ASSERT(images.size() == 1);
std::unique_ptr<JpegClient> client = std::make_unique<JpegClient>(
images, std::make_unique<ClientStateNotification<ClientState>>(),
images,
std::make_unique<media::test::ClientStateNotification<ClientState>>(),
true /* is_skip */);
const int32_t bitstream_buffer_id = 0;
......
......@@ -240,7 +240,7 @@ class JpegClient : public JpegEncodeAccelerator::Client {
public:
JpegClient(const std::vector<TestImage*>& test_aligned_images,
const std::vector<TestImage*>& test_images,
ClientStateNotification<ClientState>* note);
media::test::ClientStateNotification<ClientState>* note);
~JpegClient() override;
void CreateJpegEncoder();
void DestroyJpegEncoder();
......@@ -291,7 +291,7 @@ class JpegClient : public JpegEncodeAccelerator::Client {
// Used to notify another thread about the state. JpegClient does not own
// this.
ClientStateNotification<ClientState>* note_;
media::test::ClientStateNotification<ClientState>* note_;
// Output buffer prepared for JpegEncodeAccelerator.
std::unique_ptr<BitstreamBuffer> encoded_buffer_;
......@@ -308,7 +308,7 @@ class JpegClient : public JpegEncodeAccelerator::Client {
JpegClient::JpegClient(const std::vector<TestImage*>& test_aligned_images,
const std::vector<TestImage*>& test_images,
ClientStateNotification<ClientState>* note)
media::test::ClientStateNotification<ClientState>* note)
: test_aligned_images_(test_aligned_images),
test_images_(test_images),
state_(ClientState::CREATED),
......@@ -594,11 +594,14 @@ void JpegEncodeAcceleratorTest::TestEncode(size_t num_concurrent_encoders) {
base::Thread encoder_thread("EncoderThread");
ASSERT_TRUE(encoder_thread.Start());
std::vector<std::unique_ptr<ClientStateNotification<ClientState>>> notes;
std::vector<
std::unique_ptr<media::test::ClientStateNotification<ClientState>>>
notes;
std::vector<std::unique_ptr<JpegClient>> clients;
for (size_t i = 0; i < num_concurrent_encoders; i++) {
notes.push_back(std::make_unique<ClientStateNotification<ClientState>>());
notes.push_back(
std::make_unique<media::test::ClientStateNotification<ClientState>>());
clients.push_back(std::make_unique<JpegClient>(
test_aligned_images_, test_images_, notes.back().get()));
encoder_thread.task_runner()->PostTask(
......
......@@ -5,25 +5,39 @@
import("//build/config/ui.gni")
import("//media/gpu/args.gni")
# TODO(dstaessens@) Split up in encode/decode/render/common helpers
source_set("helpers") {
testonly = true
sources = [
"video_accelerator_unittest_helpers.h",
]
deps = [
"//base:base",
]
}
source_set("render_helpers") {
testonly = true
sources = [
"rendering_helper.cc",
"rendering_helper.h",
"texture_ref.cc",
"texture_ref.h",
"video_accelerator_unittest_helpers.h",
"video_decode_accelerator_unittest_helpers.cc",
"video_decode_accelerator_unittest_helpers.h",
"video_encode_accelerator_unittest_helpers.cc",
"video_encode_accelerator_unittest_helpers.h",
]
deps = [
"//media/gpu",
"//ui/gl/init:init",
]
if (use_ozone) {
deps += [ "//ui/ozone" ]
}
}
source_set("frame_mapper") {
testonly = true
sources = [
"video_frame_mapper.h",
"video_frame_mapper_factory.cc",
"video_frame_mapper_factory.h",
"video_frame_validator.cc",
"video_frame_validator.h",
]
if (is_chromeos) {
sources += [
......@@ -37,22 +51,67 @@ source_set("helpers") {
]
}
}
deps = [
"//media/gpu",
]
}
source_set("frame_validator") {
testonly = true
sources = [
"video_frame_validator.cc",
"video_frame_validator.h",
]
public_deps = [
":frame_mapper",
]
deps = [
":decode_helpers",
":helpers",
"//media/gpu",
]
}
source_set("decode_helpers") {
testonly = true
sources = [
"video_decode_accelerator_unittest_helpers.cc",
"video_decode_accelerator_unittest_helpers.h",
]
public_deps = [
":helpers",
":render_helpers",
]
deps = [
"//media/gpu",
"//testing/gtest",
"//third_party/libyuv",
"//ui/gl/init:init",
]
if (use_ozone) {
deps += [ "//ui/ozone" ]
}
}
source_set("encode_helpers") {
testonly = true
sources = [
"video_encode_accelerator_unittest_helpers.cc",
"video_encode_accelerator_unittest_helpers.h",
]
public_deps = [
":helpers",
":render_helpers",
]
deps = [
":frame_mapper",
"//media/gpu",
]
}
# TODO(dstaessens@) Make this work on other platforms too.
if (is_chromeos) {
static_library("video_player") {
testonly = true
sources = [
"video_player/frame_renderer.h",
"video_player/frame_renderer_dummy.cc",
......@@ -66,16 +125,13 @@ if (is_chromeos) {
"video_player/video_player.cc",
"video_player/video_player.h",
]
data = [
"//media/test/data/",
]
deps = [
":helpers",
":decode_helpers",
"//media/gpu",
]
if (use_ozone) {
deps += [ "//ui/ozone" ]
}
......
......@@ -9,6 +9,7 @@
#include <algorithm>
#include <memory>
#include <numeric>
#include <utility>
#include <vector>
#include "base/bind.h"
......@@ -25,7 +26,6 @@
#include "base/time/time.h"
#include "build/build_config.h"
#include "media/gpu/test/texture_ref.h"
#include "media/gpu/test/video_decode_accelerator_unittest_helpers.h"
#include "ui/gfx/buffer_types.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_implementation.h"
......
......@@ -12,6 +12,7 @@
#include "base/synchronization/lock.h"
namespace media {
namespace test {
// Helper class allowing one thread to wait on a notification from another.
// If notifications come in faster than they are Wait()'d for, they are
......@@ -57,6 +58,7 @@ StateEnum ClientStateNotification<StateEnum>::Wait() {
return ret;
}
} // namespace test
} // namespace media
#endif // MEDIA_GPU_TEST_VIDEO_ACCELERATOR_UNITTEST_HELPERS_H_
......@@ -8,12 +8,10 @@
#include "base/callback_helpers.h"
#include "base/files/file_util.h"
#include "base/files/scoped_file.h"
#include "base/strings/string_split.h"
#include "base/threading/thread_task_runner_handle.h"
#include "media/base/video_decoder_config.h"
#include "media/gpu/test/rendering_helper.h"
#include "media/gpu/test/texture_ref.h"
#include "media/video/h264_parser.h"
#if defined(OS_CHROMEOS)
......
......@@ -3,8 +3,6 @@
// found in the LICENSE file.
#include "media/gpu/test/video_frame_validator.h"
// TODO(dstaessens@) Avoid depending on video_decode_accelerator here.
#include "media/gpu/test/video_decode_accelerator_unittest_helpers.h"
#include <libyuv.h>
......@@ -13,6 +11,7 @@
#include "base/memory/ptr_util.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/stringprintf.h"
#include "media/gpu/test/video_decode_accelerator_unittest_helpers.h"
namespace media {
namespace test {
......
......@@ -15,7 +15,6 @@
#include "base/threading/thread_checker.h"
#include "media/base/video_frame.h"
#include "media/base/video_types.h"
#include "media/gpu/test/video_decode_accelerator_unittest_helpers.h"
#include "media/gpu/test/video_frame_mapper.h"
#include "media/gpu/test/video_frame_mapper_factory.h"
#include "ui/gfx/geometry/rect.h"
......
......@@ -88,7 +88,6 @@
#endif // defined(OS_CHROMEOS)
namespace media {
namespace {
// Values optionally filled in from flags; see main() below.
......@@ -293,7 +292,7 @@ class GLRenderingVDAClient
std::string encoded_data,
RenderingHelper* rendering_helper,
std::unique_ptr<media::test::VideoFrameValidator> video_frame_validator,
ClientStateNotification<ClientState>* note);
media::test::ClientStateNotification<ClientState>* note);
~GLRenderingVDAClient() override;
void CreateAndStartDecoder();
......@@ -353,7 +352,7 @@ class GLRenderingVDAClient
gfx::Size frame_size_;
size_t outstanding_decodes_;
int next_bitstream_buffer_id_;
ClientStateNotification<ClientState>* const note_;
media::test::ClientStateNotification<ClientState>* const note_;
std::unique_ptr<VideoDecodeAccelerator> decoder_;
base::WeakPtr<VideoDecodeAccelerator> weak_vda_;
std::unique_ptr<base::WeakPtrFactory<VideoDecodeAccelerator>>
......@@ -414,7 +413,7 @@ GLRenderingVDAClient::GLRenderingVDAClient(
std::string encoded_data,
RenderingHelper* rendering_helper,
std::unique_ptr<media::test::VideoFrameValidator> video_frame_validator,
ClientStateNotification<ClientState>* note)
media::test::ClientStateNotification<ClientState>* note)
: config_(std::move(config)),
rendering_helper_(rendering_helper),
frame_size_(config_.frame_size),
......@@ -927,11 +926,13 @@ class VideoDecodeAcceleratorTest : public ::testing::Test {
TestFilesVector* test_video_files);
void InitializeRenderingHelper(const RenderingHelperParams& helper_params);
void CreateAndStartDecoder(GLRenderingVDAClient* client,
ClientStateNotification<ClientState>* note);
void CreateAndStartDecoder(
GLRenderingVDAClient* client,
media::test::ClientStateNotification<ClientState>* note);
// Wait until decode finishes and return the last state.
ClientState WaitUntilDecodeFinish(ClientStateNotification<ClientState>* note);
ClientState WaitUntilDecodeFinish(
media::test::ClientStateNotification<ClientState>* note);
void WaitUntilIdle();
void OutputLogFile(const base::FilePath::CharType* log_path,
......@@ -946,8 +947,8 @@ class VideoDecodeAcceleratorTest : public ::testing::Test {
static void Delete(T item) {
// |item| is cleared when the scope of this function is left.
}
using NotesVector =
std::vector<std::unique_ptr<ClientStateNotification<ClientState>>>;
using NotesVector = std::vector<
std::unique_ptr<media::test::ClientStateNotification<ClientState>>>;
using ClientsVector = std::vector<std::unique_ptr<GLRenderingVDAClient>>;
NotesVector notes_;
......@@ -1074,7 +1075,7 @@ void VideoDecodeAcceleratorTest::InitializeRenderingHelper(
void VideoDecodeAcceleratorTest::CreateAndStartDecoder(
GLRenderingVDAClient* client,
ClientStateNotification<ClientState>* note) {
media::test::ClientStateNotification<ClientState>* note) {
g_env->GetRenderingTaskRunner()->PostTask(
FROM_HERE, base::BindOnce(&GLRenderingVDAClient::CreateAndStartDecoder,
base::Unretained(client)));
......@@ -1082,7 +1083,7 @@ void VideoDecodeAcceleratorTest::CreateAndStartDecoder(
}
ClientState VideoDecodeAcceleratorTest::WaitUntilDecodeFinish(
ClientStateNotification<ClientState>* note) {
media::test::ClientStateNotification<ClientState>* note) {
ClientState state = CS_DESTROYED;
for (int i = 0; i < CS_MAX; i++) {
state = note->Wait();
......@@ -1132,7 +1133,7 @@ class VideoDecodeAcceleratorParamTest
// Wait for |note| to report a state and if it's not |expected_state| then
// assert |client| has deleted its decoder.
static void AssertWaitForStateOrDeleted(
ClientStateNotification<ClientState>* note,
media::test::ClientStateNotification<ClientState>* note,
GLRenderingVDAClient* client,
ClientState expected_state) {
// Skip waiting state if decoder of |client| is already deleted.
......@@ -1220,8 +1221,8 @@ TEST_P(VideoDecodeAcceleratorParamTest, MAYBE_TestSimpleDecode) {
for (size_t index = 0; index < num_concurrent_decoders; ++index) {
TestVideoFile* video_file =
test_video_files_[index % test_video_files_.size()].get();
std::unique_ptr<ClientStateNotification<ClientState>> note =
std::make_unique<ClientStateNotification<ClientState>>();
std::unique_ptr<media::test::ClientStateNotification<ClientState>> note =
std::make_unique<media::test::ClientStateNotification<ClientState>>();
notes_[index] = std::move(note);
size_t delay_reuse_after_frame_num = std::numeric_limits<size_t>::max();
......@@ -1274,7 +1275,7 @@ TEST_P(VideoDecodeAcceleratorParamTest, MAYBE_TestSimpleDecode) {
// Only check performance & correctness later if we play through only once.
bool skip_performance_and_correctness_checks = num_play_throughs > 1;
for (size_t i = 0; i < num_concurrent_decoders; ++i) {
ClientStateNotification<ClientState>* note = notes_[i].get();
media::test::ClientStateNotification<ClientState>* note = notes_[i].get();
ClientState state = note->Wait();
EXPECT_TRUE(delete_decoder_state != CS_DECODER_SET ||
state == CS_DESTROYED);
......@@ -1597,7 +1598,8 @@ WRAPPED_INSTANTIATE_TEST_CASE_P(
// Measure the median of the decode time when VDA::Decode is called 30 times per
// second.
TEST_F(VideoDecodeAcceleratorTest, TestDecodeTimeMedian) {
notes_.push_back(std::make_unique<ClientStateNotification<ClientState>>());
notes_.push_back(
std::make_unique<media::test::ClientStateNotification<ClientState>>());
const TestVideoFile* video_file = test_video_files_[0].get();
GLRenderingVDAClient::Config config;
......@@ -1632,7 +1634,8 @@ TEST_F(VideoDecodeAcceleratorTest, TestDecodeTimeMedian) {
// is not considered as a failure because the input may be unsupported or
// corrupted videos.
TEST_F(VideoDecodeAcceleratorTest, NoCrash) {
notes_.push_back(std::make_unique<ClientStateNotification<ClientState>>());
notes_.push_back(
std::make_unique<media::test::ClientStateNotification<ClientState>>());
const TestVideoFile* video_file = test_video_files_[0].get();
GLRenderingVDAClient::Config config;
......@@ -1662,7 +1665,8 @@ TEST_F(VideoDecodeAcceleratorTest, DISABLED_GenMD5) {
g_test_import = true;
ASSERT_EQ(test_video_files_.size(), 1u);
notes_.push_back(std::make_unique<ClientStateNotification<ClientState>>());
notes_.push_back(
std::make_unique<media::test::ClientStateNotification<ClientState>>());
const TestVideoFile* video_file = test_video_files_[0].get();
GLRenderingVDAClient::Config config;
config.frame_size = gfx::Size(video_file->width, video_file->height);
......
......@@ -1185,7 +1185,8 @@ class VEAClientBase : public VideoEncodeAccelerator::Client {
}
protected:
VEAClientBase(ClientStateNotification<ClientState>* note)
explicit VEAClientBase(
media::test::ClientStateNotification<ClientState>* note)
: note_(note), next_output_buffer_id_(0) {}
bool has_encoder() { return encoder_.get(); }
......@@ -1196,7 +1197,7 @@ class VEAClientBase : public VideoEncodeAccelerator::Client {
// Used to notify another thread about the state. VEAClientBase does not own
// this.
ClientStateNotification<ClientState>* note_;
media::test::ClientStateNotification<ClientState>* note_;
// All methods of this class should be run on the same thread.
base::ThreadChecker thread_checker_;
......@@ -1208,7 +1209,7 @@ class VEAClientBase : public VideoEncodeAccelerator::Client {
class VEAClient : public VEAClientBase {
public:
VEAClient(TestStream* test_stream,
ClientStateNotification<ClientState>* note,
media::test::ClientStateNotification<ClientState>* note,
bool save_to_file,
unsigned int keyframe_period,
bool force_bitrate,
......@@ -1418,7 +1419,7 @@ class VEAClient : public VEAClientBase {
};
VEAClient::VEAClient(TestStream* test_stream,
ClientStateNotification<ClientState>* note,
media::test::ClientStateNotification<ClientState>* note,
bool save_to_file,
unsigned int keyframe_period,
bool force_bitrate,
......@@ -2121,7 +2122,7 @@ class SimpleVEAClientBase : public VEAClientBase {
size_t output_buffer_size) override;
protected:
SimpleVEAClientBase(ClientStateNotification<ClientState>* note,
SimpleVEAClientBase(media::test::ClientStateNotification<ClientState>* note,
const int width,
const int height);
......@@ -2137,7 +2138,7 @@ class SimpleVEAClientBase : public VEAClientBase {
};
SimpleVEAClientBase::SimpleVEAClientBase(
ClientStateNotification<ClientState>* note,
media::test::ClientStateNotification<ClientState>* note,
const int width,
const int height)
: VEAClientBase(note),
......@@ -2214,7 +2215,8 @@ void SimpleVEAClientBase::FeedEncoderWithOutput(base::SharedMemory* shm,
// frame before getting any input.
class VEANoInputClient : public SimpleVEAClientBase {
public:
explicit VEANoInputClient(ClientStateNotification<ClientState>* note);
explicit VEANoInputClient(
media::test::ClientStateNotification<ClientState>* note);
void DestroyEncoder();
// VideoDecodeAccelerator::Client implementation.
......@@ -2231,7 +2233,8 @@ class VEANoInputClient : public SimpleVEAClientBase {
std::unique_ptr<base::OneShotTimer> timer_;
};
VEANoInputClient::VEANoInputClient(ClientStateNotification<ClientState>* note)
VEANoInputClient::VEANoInputClient(
media::test::ClientStateNotification<ClientState>* note)
: SimpleVEAClientBase(note, 320, 240) {}
void VEANoInputClient::DestroyEncoder() {
......@@ -2269,7 +2272,7 @@ void VEANoInputClient::BitstreamBufferReady(
class VEACacheLineUnalignedInputClient : public SimpleVEAClientBase {
public:
explicit VEACacheLineUnalignedInputClient(
ClientStateNotification<ClientState>* note);
media::test::ClientStateNotification<ClientState>* note);
// VideoDecodeAccelerator::Client implementation.
void RequireBitstreamBuffers(unsigned int input_count,
......@@ -2285,7 +2288,7 @@ class VEACacheLineUnalignedInputClient : public SimpleVEAClientBase {
};
VEACacheLineUnalignedInputClient::VEACacheLineUnalignedInputClient(
ClientStateNotification<ClientState>* note)
media::test::ClientStateNotification<ClientState>* note)
: SimpleVEAClientBase(note, 368, 368) {
} // 368 is divisible by 16 but not 32
......@@ -2401,7 +2404,9 @@ TEST_P(VideoEncodeAcceleratorTest, TestSimpleEncode) {
std::get<7>(GetParam()) || g_env->verify_all_output();
const bool verify_output_timestamp = std::get<8>(GetParam());
std::vector<std::unique_ptr<ClientStateNotification<ClientState>>> notes;
std::vector<
std::unique_ptr<media::test::ClientStateNotification<ClientState>>>
notes;
std::vector<std::unique_ptr<VEAClient>> clients;
base::Thread vea_client_thread("EncoderClientThread");
StartVEAThread(&vea_client_thread);
......@@ -2426,7 +2431,8 @@ TEST_P(VideoEncodeAcceleratorTest, TestSimpleEncode) {
(save_to_file &&
!g_env->test_streams_[test_stream_index]->out_filename.empty());
notes.push_back(std::make_unique<ClientStateNotification<ClientState>>());
notes.push_back(
std::make_unique<media::test::ClientStateNotification<ClientState>>());
clients.push_back(std::make_unique<VEAClient>(
g_env->test_streams_[test_stream_index].get(), notes.back().get(),
encoder_save_to_file, keyframe_period, force_bitrate, test_perf,
......@@ -2478,8 +2484,8 @@ class VideoEncodeAcceleratorSimpleTest : public ::testing::TestWithParam<int> {
template <class TestClient>
void SimpleTestFunc() {
std::unique_ptr<ClientStateNotification<ClientState>> note(
new ClientStateNotification<ClientState>());
std::unique_ptr<media::test::ClientStateNotification<ClientState>> note(
new media::test::ClientStateNotification<ClientState>());
std::unique_ptr<TestClient> client(new TestClient(note.get()));
base::Thread vea_client_thread("EncoderClientThread");
ASSERT_TRUE(vea_client_thread.Start());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment