OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 public: | 124 public: |
125 RtpDumpReader() : file_(NULL) {} | 125 RtpDumpReader() : file_(NULL) {} |
126 virtual ~RtpDumpReader() { | 126 virtual ~RtpDumpReader() { |
127 if (file_ != NULL) { | 127 if (file_ != NULL) { |
128 fclose(file_); | 128 fclose(file_); |
129 file_ = NULL; | 129 file_ = NULL; |
130 } | 130 } |
131 } | 131 } |
132 | 132 |
133 bool Init(const std::string& filename, | 133 bool Init(const std::string& filename, |
134 const std::set<uint32_t>& ssrc_filter) override { | 134 const std::set<uint32_t>& ssrc_filter) { |
135 file_ = fopen(filename.c_str(), "rb"); | 135 file_ = fopen(filename.c_str(), "rb"); |
136 if (file_ == NULL) { | 136 if (file_ == NULL) { |
137 printf("ERROR: Can't open file: %s\n", filename.c_str()); | 137 printf("ERROR: Can't open file: %s\n", filename.c_str()); |
138 return false; | 138 return false; |
139 } | 139 } |
140 | 140 |
141 char firstline[kFirstLineLength + 1] = {0}; | 141 char firstline[kFirstLineLength + 1] = {0}; |
142 if (fgets(firstline, kFirstLineLength, file_) == NULL) { | 142 if (fgets(firstline, kFirstLineLength, file_) == NULL) { |
143 DEBUG_LOG("ERROR: Can't read from file\n"); | 143 DEBUG_LOG("ERROR: Can't read from file\n"); |
144 return false; | 144 return false; |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 return reader; | 666 return reader; |
667 } | 667 } |
668 | 668 |
669 RtpFileReader* RtpFileReader::Create(FileFormat format, | 669 RtpFileReader* RtpFileReader::Create(FileFormat format, |
670 const std::string& filename) { | 670 const std::string& filename) { |
671 return RtpFileReader::Create(format, filename, std::set<uint32_t>()); | 671 return RtpFileReader::Create(format, filename, std::set<uint32_t>()); |
672 } | 672 } |
673 | 673 |
674 } // namespace test | 674 } // namespace test |
675 } // namespace webrtc | 675 } // namespace webrtc |
OLD | NEW |