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

Unified Diff: webrtc/video/video_quality_test.cc

Issue 2303273002: Expose Ivf logging through the native API (Closed)
Patch Set: Nit Created 4 years, 3 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/video/video_quality_test.h ('k') | webrtc/video/video_receive_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/video_quality_test.cc
diff --git a/webrtc/video/video_quality_test.cc b/webrtc/video/video_quality_test.cc
index f9440ad86c9441e41cf4dcc7758b1c1bfdc36ff5..ea0e0d9f791fa227845c0f6f1e5d7e50fdb49515 100644
--- a/webrtc/video/video_quality_test.cc
+++ b/webrtc/video/video_quality_test.cc
@@ -22,6 +22,7 @@
#include "webrtc/base/event.h"
#include "webrtc/base/format_macros.h"
#include "webrtc/base/optional.h"
+#include "webrtc/base/platform_file.h"
#include "webrtc/base/timeutils.h"
#include "webrtc/call.h"
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
@@ -798,7 +799,8 @@ class VideoAnalyzer : public PacketReceiver,
rtc::Event done_;
};
-VideoQualityTest::VideoQualityTest() : clock_(Clock::GetRealTimeClock()) {}
+VideoQualityTest::VideoQualityTest()
+ : clock_(Clock::GetRealTimeClock()), receive_logs_(0), send_logs_(0) {}
void VideoQualityTest::TestBody() {}
@@ -1188,6 +1190,8 @@ void VideoQualityTest::RunWithAnalyzer(const Params& params) {
rtc::VideoSinkWants wants;
capturer_->AddOrUpdateSink(analyzer.InputInterface(), wants);
+ StartEncodedFrameLogs(video_send_stream_);
+ StartEncodedFrameLogs(video_receive_streams_[0]);
video_send_stream_->Start();
for (VideoReceiveStream* receive_stream : video_receive_streams_)
receive_stream->Start();
@@ -1311,12 +1315,15 @@ void VideoQualityTest::RunWithRenderers(const Params& params) {
if (params_.audio_video_sync)
audio_config.sync_group = kSyncGroup;
- audio_receive_stream =call->CreateAudioReceiveStream(audio_config);
+ audio_receive_stream = call->CreateAudioReceiveStream(audio_config);
const CodecInst kOpusInst = {120, "OPUS", 48000, 960, 2, 64000};
EXPECT_EQ(0, voe.codec->SetSendCodec(voe.send_channel_id, kOpusInst));
}
+ StartEncodedFrameLogs(video_receive_stream);
+ StartEncodedFrameLogs(video_send_stream_);
+
// Start sending and receiving video.
video_receive_stream->Start();
video_send_stream_->Start();
@@ -1364,4 +1371,29 @@ void VideoQualityTest::RunWithRenderers(const Params& params) {
DestroyVoiceEngine(&voe);
}
+void VideoQualityTest::StartEncodedFrameLogs(VideoSendStream* stream) {
+ if (!params_.common.encoded_frame_base_path.empty()) {
+ std::ostringstream str;
+ str << send_logs_++;
+ std::string prefix =
+ params_.common.encoded_frame_base_path + "." + str.str() + ".send.";
+ stream->EnableEncodedFrameRecording(
+ std::vector<rtc::PlatformFile>(
+ {rtc::CreatePlatformFile(prefix + "1.ivf"),
+ rtc::CreatePlatformFile(prefix + "2.ivf"),
+ rtc::CreatePlatformFile(prefix + "3.ivf")}),
+ 10000000);
+ }
+}
+void VideoQualityTest::StartEncodedFrameLogs(VideoReceiveStream* stream) {
+ if (!params_.common.encoded_frame_base_path.empty()) {
+ std::ostringstream str;
+ str << receive_logs_++;
+ std::string path =
+ params_.common.encoded_frame_base_path + "." + str.str() + ".recv.ivf";
+ stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path),
+ 10000000);
+ }
+}
+
} // namespace webrtc
« no previous file with comments | « webrtc/video/video_quality_test.h ('k') | webrtc/video/video_receive_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698