From 3f06c3bf048fcd7d870a1d31c7a0cda151178ff9 Mon Sep 17 00:00:00 2001 From: Rasmus Brandt Date: Thu, 22 Feb 2018 13:29:27 +0100 Subject: [PATCH] Change text output from VideoProcessor slightly. Changes: * Prefix sections with "==>" and "-->" headers. * Add some more newlines. Motivation: Make output more quickly parsed by humans. BUG=webrtc:8448 Change-Id: I02118e2c25eeae3534285cfe756d8b4818997659 Reviewed-on: https://webrtc-review.googlesource.com/56120 Commit-Queue: Rasmus Brandt Reviewed-by: Sergey Silkin Cr-Commit-Position: refs/heads/master@{#22153} --- modules/video_coding/codecs/test/stats.cc | 2 +- modules/video_coding/codecs/test/test_config.cc | 16 +++++++++------- .../test/videoprocessor_integrationtest.cc | 9 ++++++--- .../videoprocessor_integrationtest_libvpx.cc | 3 ++- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/modules/video_coding/codecs/test/stats.cc b/modules/video_coding/codecs/test/stats.cc index ca6f2149cd..b7294c0efa 100644 --- a/modules/video_coding/codecs/test/stats.cc +++ b/modules/video_coding/codecs/test/stats.cc @@ -46,7 +46,7 @@ std::string FrameStatistics::ToString() const { std::string VideoStatistics::ToString(std::string prefix) const { std::stringstream ss; - ss << "\n" << prefix << "target_bitrate_kbps: " << target_bitrate_kbps; + ss << prefix << "target_bitrate_kbps: " << target_bitrate_kbps; ss << "\n" << prefix << "input_framerate_fps: " << input_framerate_fps; ss << "\n" << prefix << "spatial_layer_idx: " << spatial_layer_idx; ss << "\n" << prefix << "temporal_layer_idx: " << temporal_layer_idx; diff --git a/modules/video_coding/codecs/test/test_config.cc b/modules/video_coding/codecs/test/test_config.cc index 7d2582cf14..05960283d4 100644 --- a/modules/video_coding/codecs/test/test_config.cc +++ b/modules/video_coding/codecs/test/test_config.cc @@ -31,7 +31,7 @@ std::string CodecSpecificToString(const webrtc::VideoCodec& codec) { std::stringstream ss; switch (codec.codecType) { case kVideoCodecVP8: - ss << "\ncomplexity: " << codec.VP8().complexity; + ss << "complexity: " << codec.VP8().complexity; ss << "\nresilience: " << codec.VP8().resilience; ss << "\nnum_temporal_layers: " << static_cast(codec.VP8().numberOfTemporalLayers); @@ -41,7 +41,7 @@ std::string CodecSpecificToString(const webrtc::VideoCodec& codec) { ss << "\nkey_frame_interval: " << codec.VP8().keyFrameInterval; break; case kVideoCodecVP9: - ss << "\ncomplexity: " << codec.VP9().complexity; + ss << "complexity: " << codec.VP9().complexity; ss << "\nresilience: " << codec.VP9().resilienceOn; ss << "\nnum_temporal_layers: " << static_cast(codec.VP9().numberOfTemporalLayers); @@ -55,7 +55,7 @@ std::string CodecSpecificToString(const webrtc::VideoCodec& codec) { ss << "\nflexible_mode: " << codec.VP9().flexibleMode; break; case kVideoCodecH264: - ss << "\nframe_dropping: " << codec.H264().frameDroppingOn; + ss << "frame_dropping: " << codec.H264().frameDroppingOn; ss << "\nkey_frame_interval: " << codec.H264().keyFrameInterval; ss << "\nprofile: " << codec.H264().profile; break; @@ -195,12 +195,13 @@ std::vector TestConfig::FrameTypeForFrame(size_t frame_idx) const { std::string TestConfig::ToString() const { std::string codec_type = CodecTypeToPayloadString(codec_settings.codecType); std::stringstream ss; - ss << "\nfilename: " << filename; - ss << "\nwidth: " << codec_settings.width; - ss << "\nheight: " << codec_settings.height; + ss << "filename: " << filename; ss << "\nnum_frames: " << num_frames; ss << "\nnum_cores: " << NumberOfCores(); ss << "\ncodec_type: " << codec_type; + ss << "\n--> codec_settings"; + ss << "\nwidth: " << codec_settings.width; + ss << "\nheight: " << codec_settings.height; ss << "\nmax_framerate_fps: " << codec_settings.maxFramerate; ss << "\nstart_bitrate_kbps: " << codec_settings.startBitrate; ss << "\nmax_bitrate_kbps: " << codec_settings.maxBitrate; @@ -208,7 +209,8 @@ std::string TestConfig::ToString() const { ss << "\nmax_qp: " << codec_settings.qpMax; ss << "\nnum_simulcast_streams : " << static_cast(codec_settings.numberOfSimulcastStreams); - ss << "\n" << codec_type << " specific: "; + ss << "\n" + << "--> codec_settings." << codec_type << "\n"; ss << CodecSpecificToString(codec_settings); return ss.str(); } diff --git a/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc b/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc index d5411a12b5..4f79628fa6 100644 --- a/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc +++ b/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc @@ -253,12 +253,14 @@ void VideoProcessorIntegrationTest::AnalyzeAllFrames( std::vector layer_stats = stats_.SliceAndCalcLayerVideoStatistic(first_frame_num, last_frame_num); + printf("==> Receive stats\n"); for (const auto& layer_stat : layer_stats) { - printf("%s\n", layer_stat.ToString("recv_").c_str()); + printf("%s\n\n", layer_stat.ToString("recv_").c_str()); } VideoStatistics send_stat = stats_.SliceAndCalcAggregatedVideoStatistic( first_frame_num, last_frame_num); + printf("==> Send stats\n"); printf("%s\n", send_stat.ToString("send_").c_str()); const RateControlThresholds* rc_threshold = @@ -273,6 +275,7 @@ void VideoProcessorIntegrationTest::AnalyzeAllFrames( } cpu_process_time_->Print(); + printf("\n"); } void VideoProcessorIntegrationTest::VerifyVideoStatistic( @@ -473,10 +476,10 @@ void VideoProcessorIntegrationTest::ReleaseAndCloseObjects( void VideoProcessorIntegrationTest::PrintSettings( rtc::TaskQueue* task_queue) const { - printf("VideoProcessor settings\n==\n"); + printf("==> TestConfig\n"); printf("%s\n", config_.ToString().c_str()); - printf("VideoProcessorIntegrationTest settings\n==\n"); + printf("==> Codec names\n"); std::string encoder_name; std::string decoder_name; rtc::Event sync_event(false, false); diff --git a/modules/video_coding/codecs/test/videoprocessor_integrationtest_libvpx.cc b/modules/video_coding/codecs/test/videoprocessor_integrationtest_libvpx.cc index 8f0d466a60..6f6da14112 100644 --- a/modules/video_coding/codecs/test/videoprocessor_integrationtest_libvpx.cc +++ b/modules/video_coding/codecs/test/videoprocessor_integrationtest_libvpx.cc @@ -46,7 +46,8 @@ class VideoProcessorIntegrationTestLibvpx } void PrintRdPerf(std::map> rd_stats) { - printf("\n%13s %7s %7s %13s %13s %7s %13s %13s\n", "uplink_kbps", "width", + printf("--> Summary\n"); + printf("%13s %7s %7s %13s %13s %7s %13s %13s\n", "uplink_kbps", "width", "height", "downlink_kbps", "framerate_fps", "psnr", "enc_speed_fps", "dec_speed_fps"); for (const auto& rd_stat : rd_stats) {