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

Side by Side Diff: webrtc/modules/audio_coding/neteq/tools/rtp_file_source.h

Issue 2005873002: Let PacketSource::NextPacket() return an std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 7 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
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/neteq/tools/rtp_analyze.cc ('k') | webrtc/modules/audio_coding/neteq/tools/rtp_file_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698