| 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 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 // Checks whether a files is a valid RTP dump or PCAP (Wireshark) file. | 38 // Checks whether a files is a valid RTP dump or PCAP (Wireshark) file. |
| 39 static bool ValidRtpDump(const std::string& file_name); | 39 static bool ValidRtpDump(const std::string& file_name); |
| 40 static bool ValidPcap(const std::string& file_name); | 40 static bool ValidPcap(const std::string& file_name); |
| 41 | 41 |
| 42 virtual ~RtpFileSource(); | 42 virtual ~RtpFileSource(); |
| 43 | 43 |
| 44 // Registers an RTP header extension and binds it to |id|. | 44 // Registers an RTP header extension and binds it to |id|. |
| 45 virtual bool RegisterRtpHeaderExtension(RTPExtensionType type, uint8_t id); | 45 virtual bool RegisterRtpHeaderExtension(RTPExtensionType type, uint8_t id); |
| 46 | 46 |
| 47 // Returns a pointer to the next packet. Returns NULL if end of file was | 47 std::unique_ptr<Packet> NextPacket() override; |
| 48 // reached, or if a the data was corrupt. | |
| 49 Packet* NextPacket() override; | |
| 50 | 48 |
| 51 private: | 49 private: |
| 52 static const int kFirstLineLength = 40; | 50 static const int kFirstLineLength = 40; |
| 53 static const int kRtpFileHeaderSize = 4 + 4 + 4 + 2 + 2; | 51 static const int kRtpFileHeaderSize = 4 + 4 + 4 + 2 + 2; |
| 54 static const size_t kPacketHeaderSize = 8; | 52 static const size_t kPacketHeaderSize = 8; |
| 55 | 53 |
| 56 RtpFileSource(); | 54 RtpFileSource(); |
| 57 | 55 |
| 58 bool OpenFile(const std::string& file_name); | 56 bool OpenFile(const std::string& file_name); |
| 59 | 57 |
| 60 std::unique_ptr<RtpFileReader> rtp_reader_; | 58 std::unique_ptr<RtpFileReader> rtp_reader_; |
| 61 std::unique_ptr<RtpHeaderParser> parser_; | 59 std::unique_ptr<RtpHeaderParser> parser_; |
| 62 | 60 |
| 63 RTC_DISALLOW_COPY_AND_ASSIGN(RtpFileSource); | 61 RTC_DISALLOW_COPY_AND_ASSIGN(RtpFileSource); |
| 64 }; | 62 }; |
| 65 | 63 |
| 66 } // namespace test | 64 } // namespace test |
| 67 } // namespace webrtc | 65 } // namespace webrtc |
| 68 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_RTP_FILE_SOURCE_H_ | 66 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_RTP_FILE_SOURCE_H_ |
| OLD | NEW |