Commit fafcccd9 authored by David Staessens's avatar David Staessens Committed by Commit Bot

media/gpu/test: Remove test VideoCollection.

This class was introduced in an early prototype of the new video decoder tests,
to manage test video files. Video test files are now managed by the Tast test
framework, so this class is no longer needed.

TEST=ran new VDA (perf) tests on nocturne

BUG=879065

Change-Id: I6645cad5d59d9d28addffd3842c6d15f6537e80f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1552385
Commit-Queue: David Staessens <dstaessens@chromium.org>
Reviewed-by: default avatarAlexandre Courbot <acourbot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#648604}
parent b47be621
......@@ -154,8 +154,6 @@ if (is_chromeos) {
"video_player/test_vda_video_decoder.h",
"video_player/video.cc",
"video_player/video.h",
"video_player/video_collection.cc",
"video_player/video_collection.h",
"video_player/video_decoder_client.cc",
"video_player/video_decoder_client.h",
"video_player/video_player.cc",
......
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "media/gpu/test/video_player/video_collection.h"
#include <utility>
#include "media/gpu/test/video_player/video.h"
namespace media {
namespace test {
constexpr base::FilePath::CharType kTestVideoH264[] = "test-25fps.h264";
constexpr base::FilePath::CharType kTestVideoVP8[] = "test-25fps.vp8";
constexpr base::FilePath::CharType kTestVideoVP9[] = "test-25fps.vp9";
const VideoCollection kDefaultTestVideoCollection =
std::move(VideoCollection()
.Add(std::make_unique<Video>(base::FilePath(kTestVideoH264)))
.Add(std::make_unique<Video>(base::FilePath(kTestVideoVP8)))
.Add(std::make_unique<Video>(base::FilePath(kTestVideoVP9))));
VideoCollection::VideoCollection() {}
VideoCollection::~VideoCollection() {}
VideoCollection::VideoCollection(VideoCollection&& other) {
video_collection_ = std::move(other.video_collection_);
}
VideoCollection& VideoCollection::Add(std::unique_ptr<Video> video) {
video_collection_.push_back(std::move(video));
return *this;
}
const Video& VideoCollection::operator[](size_t index) const {
CHECK_LT(index, video_collection_.size());
Video* video = video_collection_.at(index).get();
// Only load video when actually requested, to avoid loading all videos in the
// collection, even when only a single video is needed.
if (!video->IsLoaded()) {
bool loaded = video->Load();
LOG_IF(FATAL, !loaded) << "Loading video failed";
}
return *video;
}
size_t VideoCollection::Size() const {
return video_collection_.size();
}
} // namespace test
} // namespace media
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef MEDIA_GPU_TEST_VIDEO_PLAYER_VIDEO_COLLECTION_H_
#define MEDIA_GPU_TEST_VIDEO_PLAYER_VIDEO_COLLECTION_H_
#include <stdint.h>
#include <memory>
#include <vector>
#include "base/macros.h"
namespace media {
namespace test {
class Video;
// TODO(dstaessens@) Deprecated, remove.
// The video collection class helps managing different sets of test videos.
// Multiple test video collections can be maintained:
// * A collection of lightweight videos for CQ testing.
// * A collection of large video files for performance testing.
// * A set of corrupt videos to test decoder stability.
// * A set of small generated video files with various properties.
// TODO(dstaessens@):
// * Add functionality to fetch video by codec/resolution/name/...
// * Add a collection of videos to test different codecs.
// * Add a collection of videos to test various resolutions.
// * Add a collection of lightweight videos (defined directly in code?).
class VideoCollection {
public:
VideoCollection();
~VideoCollection();
VideoCollection(VideoCollection&& other);
// Add a video to the collection, this will transfer ownership.
VideoCollection& Add(std::unique_ptr<Video> video);
// Get the video with specified index from the collection.
const Video& operator[](size_t index) const;
size_t Size() const;
private:
std::vector<std::unique_ptr<Video>> video_collection_;
DISALLOW_COPY_AND_ASSIGN(VideoCollection);
};
// The default video test file collection
extern const VideoCollection kDefaultTestVideoCollection;
} // namespace test
} // namespace media
#endif // MEDIA_GPU_TEST_VIDEO_PLAYER_VIDEO_COLLECTION_H_
......@@ -9,7 +9,6 @@
#include "media/base/test_data_util.h"
#include "media/gpu/test/video_player/frame_renderer_dummy.h"
#include "media/gpu/test/video_player/video.h"
#include "media/gpu/test/video_player/video_collection.h"
#include "media/gpu/test/video_player/video_decoder_client.h"
#include "media/gpu/test/video_player/video_player.h"
#include "media/gpu/test/video_player/video_player_test_environment.h"
......
......@@ -9,7 +9,6 @@
#include "media/gpu/test/video_player/frame_renderer_dummy.h"
#include "media/gpu/test/video_player/frame_renderer_thumbnail.h"
#include "media/gpu/test/video_player/video.h"
#include "media/gpu/test/video_player/video_collection.h"
#include "media/gpu/test/video_player/video_decoder_client.h"
#include "media/gpu/test/video_player/video_player.h"
#include "media/gpu/test/video_player/video_player_test_environment.h"
......
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