Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Unified Diff: webrtc/test/frame_generator.h

Issue 2705973002: Replace test::FrameGenerator::ChromaGenerator with new FrameGenerator::SquareGenerator (Closed)
Patch Set: addressed comments. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/video_coding/video_sender_unittest.cc ('k') | webrtc/test/frame_generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/test/frame_generator.h
diff --git a/webrtc/test/frame_generator.h b/webrtc/test/frame_generator.h
index e2519c15d9e54dfd1ac6dccd83929a5b9f44c74d..95b0798bf6a248dc65a6c48dfd03364aa48d6e2c 100644
--- a/webrtc/test/frame_generator.h
+++ b/webrtc/test/frame_generator.h
@@ -10,6 +10,7 @@
#ifndef WEBRTC_TEST_FRAME_GENERATOR_H_
#define WEBRTC_TEST_FRAME_GENERATOR_H_
+#include <memory>
#include <string>
#include <vector>
@@ -47,8 +48,7 @@ class FrameForwarder : public rtc::VideoSourceInterface<VideoFrame> {
class FrameGenerator {
public:
- FrameGenerator() {}
- virtual ~FrameGenerator() {}
+ virtual ~FrameGenerator() = default;
// Returns video frame that remains valid until next call.
virtual VideoFrame* NextFrame() = 0;
@@ -58,17 +58,19 @@ class FrameGenerator {
RTC_NOTREACHED();
}
- // Creates a test frame generator that creates fully saturated frames with
- // varying U, V values over time.
- static FrameGenerator* CreateChromaGenerator(size_t width, size_t height);
+ // Creates a frame generator that produces frames with small squares that
+ // move randomly towards the lower right corner.
+ static std::unique_ptr<FrameGenerator> CreateSquareGenerator(int width,
+ int height);
// Creates a frame generator that repeatedly plays a set of yuv files.
// The frame_repeat_count determines how many times each frame is shown,
// with 1 = show each frame once, etc.
- static FrameGenerator* CreateFromYuvFile(std::vector<std::string> files,
- size_t width,
- size_t height,
- int frame_repeat_count);
+ static std::unique_ptr<FrameGenerator> CreateFromYuvFile(
+ std::vector<std::string> files,
+ size_t width,
+ size_t height,
+ int frame_repeat_count);
// Creates a frame generator which takes a set of yuv files (wrapping a
// frame generator created by CreateFromYuvFile() above), but outputs frames
@@ -78,7 +80,7 @@ class FrameGenerator {
// be scrolled top to bottom/left to right for scroll_tim_ms milliseconds.
// After that the image will stay in place for pause_time_ms milliseconds,
// and then this will be repeated with the next file from the input set.
- static FrameGenerator* CreateScrollingInputFromYuvFiles(
+ static std::unique_ptr<FrameGenerator> CreateScrollingInputFromYuvFiles(
Clock* clock,
std::vector<std::string> filenames,
size_t source_width,
« no previous file with comments | « webrtc/modules/video_coding/video_sender_unittest.cc ('k') | webrtc/test/frame_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698