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

Side by Side Diff: webrtc/video/rtc_event_log2rtp_dump.cc

Issue 1295753003: Convenience functions to convert RtcEvents to webrtc types. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase and change CHECK to RTC_CHECK Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « webrtc/video/rtc_event_log.cc ('k') | webrtc/video/rtc_event_log_parser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #include <iostream> 11 #include <iostream>
12 #include <sstream> 12 #include <sstream>
13 #include <string> 13 #include <string>
14 14
15 #include "gflags/gflags.h" 15 #include "gflags/gflags.h"
16 #include "webrtc/base/checks.h" 16 #include "webrtc/base/checks.h"
17 #include "webrtc/base/scoped_ptr.h" 17 #include "webrtc/base/scoped_ptr.h"
18 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" 18 #include "webrtc/modules/rtp_rtcp/source/byte_io.h"
19 #include "webrtc/test/rtp_file_writer.h" 19 #include "webrtc/test/rtp_file_writer.h"
20 #include "webrtc/video/rtc_event_log.h" 20 #include "webrtc/video/rtc_event_log.h"
21 #include "webrtc/video/rtc_event_log_parser.h"
21 22
22 // Files generated at build-time by the protobuf compiler. 23 // Files generated at build-time by the protobuf compiler.
23 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD 24 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD
24 #include "external/webrtc/webrtc/video/rtc_event_log.pb.h" 25 #include "external/webrtc/webrtc/video/rtc_event_log.pb.h"
25 #else 26 #else
26 #include "webrtc/video/rtc_event_log.pb.h" 27 #include "webrtc/video/rtc_event_log.pb.h"
27 #endif 28 #endif
28 29
29 namespace { 30 namespace {
30 31
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } 89 }
89 std::string input_file = argv[1]; 90 std::string input_file = argv[1];
90 std::string output_file = argv[2]; 91 std::string output_file = argv[2];
91 92
92 uint32_t ssrc_filter = 0; 93 uint32_t ssrc_filter = 0;
93 if (!FLAGS_ssrc.empty()) 94 if (!FLAGS_ssrc.empty())
94 RTC_CHECK(ParseSsrc(FLAGS_ssrc, &ssrc_filter)) 95 RTC_CHECK(ParseSsrc(FLAGS_ssrc, &ssrc_filter))
95 << "Flag verification has failed."; 96 << "Flag verification has failed.";
96 97
97 webrtc::rtclog::EventStream event_stream; 98 webrtc::rtclog::EventStream event_stream;
98 if (!webrtc::RtcEventLog::ParseRtcEventLog(input_file, &event_stream)) { 99 if (!webrtc::RtcEventLogParser::ParseRtcEventLog(input_file, &event_stream)) {
99 std::cerr << "Error while parsing input file: " << input_file << std::endl; 100 std::cerr << "Error while parsing input file: " << input_file << std::endl;
100 return -1; 101 return -1;
101 } 102 }
102 103
103 rtc::scoped_ptr<webrtc::test::RtpFileWriter> rtp_writer( 104 rtc::scoped_ptr<webrtc::test::RtpFileWriter> rtp_writer(
104 webrtc::test::RtpFileWriter::Create( 105 webrtc::test::RtpFileWriter::Create(
105 webrtc::test::RtpFileWriter::FileFormat::kRtpDump, output_file)); 106 webrtc::test::RtpFileWriter::FileFormat::kRtpDump, output_file));
106 107
107 if (!rtp_writer.get()) { 108 if (!rtp_writer.get()) {
108 std::cerr << "Error while opening output file: " << output_file 109 std::cerr << "Error while opening output file: " << output_file
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 } else { 199 } else {
199 std::cout << "Skipping malformed event." << std::endl; 200 std::cout << "Skipping malformed event." << std::endl;
200 } 201 }
201 } 202 }
202 } 203 }
203 std::cout << "Wrote " << rtp_counter << (header_only ? " header-only" : "") 204 std::cout << "Wrote " << rtp_counter << (header_only ? " header-only" : "")
204 << " RTP packets and " << rtcp_counter << " RTCP packets to the " 205 << " RTP packets and " << rtcp_counter << " RTCP packets to the "
205 << "output file." << std::endl; 206 << "output file." << std::endl;
206 return 0; 207 return 0;
207 } 208 }
OLDNEW
« no previous file with comments | « webrtc/video/rtc_event_log.cc ('k') | webrtc/video/rtc_event_log_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698