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

Unified Diff: webrtc/test/fake_encoder.h

Issue 2573453002: Add multithreaded fake encoder and corresponding FlexFEC VideoSendStreamTest. (Closed)
Patch Set: Fix android. Created 4 years 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 | « no previous file | webrtc/test/fake_encoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/test/fake_encoder.h
diff --git a/webrtc/test/fake_encoder.h b/webrtc/test/fake_encoder.h
index 57b39a4404ed857b3e4c4cc7323e9e1f2fb0034e..b81a04b43f2d9d3e4f3106688722e46ebf367a59 100644
--- a/webrtc/test/fake_encoder.h
+++ b/webrtc/test/fake_encoder.h
@@ -14,6 +14,7 @@
#include <vector>
#include "webrtc/base/criticalsection.h"
+#include "webrtc/base/task_queue.h"
#include "webrtc/common_types.h"
#include "webrtc/system_wrappers/include/clock.h"
#include "webrtc/video_encoder.h"
@@ -86,6 +87,31 @@ class DelayedEncoder : public test::FakeEncoder {
rtc::CriticalSection lock_;
int delay_ms_ GUARDED_BY(&lock_);
};
+
+// This class implements a multi-threaded fake encoder by posting
+// FakeH264Encoder::Encode(.) tasks to |queue1_| and |queue2_|, in an
+// alternating fashion.
+class MultiThreadedFakeH264Encoder : public test::FakeH264Encoder {
+ public:
+ MultiThreadedFakeH264Encoder(Clock* clock);
+ virtual ~MultiThreadedFakeH264Encoder() override;
+
+ int32_t Encode(const VideoFrame& input_image,
+ const CodecSpecificInfo* codec_specific_info,
+ const std::vector<FrameType>* frame_types) override;
+
+ int32_t EncodeCallback(const VideoFrame& input_image,
+ const CodecSpecificInfo* codec_specific_info,
+ const std::vector<FrameType>* frame_types);
+
+ protected:
+ class EncodeTask;
+
+ int current_queue_;
+ rtc::TaskQueue queue1_;
+ rtc::TaskQueue queue2_;
+};
+
} // namespace test
} // namespace webrtc
« no previous file with comments | « no previous file | webrtc/test/fake_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698