OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 private: | 126 private: |
127 // Check if its matches "#!rtpplay1.0 address/port\n". | 127 // Check if its matches "#!rtpplay1.0 address/port\n". |
128 bool CheckFirstLine(const std::string& first_line); | 128 bool CheckFirstLine(const std::string& first_line); |
129 | 129 |
130 rtc::StreamInterface* stream_; | 130 rtc::StreamInterface* stream_; |
131 bool file_header_read_; | 131 bool file_header_read_; |
132 size_t first_line_and_file_header_len_; | 132 size_t first_line_and_file_header_len_; |
133 uint32 start_time_ms_; | 133 uint32 start_time_ms_; |
134 uint32 ssrc_override_; | 134 uint32 ssrc_override_; |
135 | 135 |
136 DISALLOW_COPY_AND_ASSIGN(RtpDumpReader); | 136 RTC_DISALLOW_COPY_AND_ASSIGN(RtpDumpReader); |
137 }; | 137 }; |
138 | 138 |
139 // RtpDumpLoopReader reads RTP dump packets from the input stream and rewinds | 139 // RtpDumpLoopReader reads RTP dump packets from the input stream and rewinds |
140 // the stream when it ends. RtpDumpLoopReader maintains the elapsed time, the | 140 // the stream when it ends. RtpDumpLoopReader maintains the elapsed time, the |
141 // RTP sequence number and the RTP timestamp properly. RtpDumpLoopReader can | 141 // RTP sequence number and the RTP timestamp properly. RtpDumpLoopReader can |
142 // handle both RTP dump and RTCP dump. We assume that the dump does not mix | 142 // handle both RTP dump and RTCP dump. We assume that the dump does not mix |
143 // RTP packets and RTCP packets. | 143 // RTP packets and RTCP packets. |
144 class RtpDumpLoopReader : public RtpDumpReader { | 144 class RtpDumpLoopReader : public RtpDumpReader { |
145 public: | 145 public: |
146 explicit RtpDumpLoopReader(rtc::StreamInterface* stream); | 146 explicit RtpDumpLoopReader(rtc::StreamInterface* stream); |
(...skipping 27 matching lines...) Expand all Loading... |
174 uint32 frame_count_; | 174 uint32 frame_count_; |
175 // The elapsed time, RTP sequence number, and RTP timestamp of the first and | 175 // The elapsed time, RTP sequence number, and RTP timestamp of the first and |
176 // the previous dump packets in the input stream. | 176 // the previous dump packets in the input stream. |
177 uint32 first_elapsed_time_; | 177 uint32 first_elapsed_time_; |
178 int first_rtp_seq_num_; | 178 int first_rtp_seq_num_; |
179 uint32 first_rtp_timestamp_; | 179 uint32 first_rtp_timestamp_; |
180 uint32 prev_elapsed_time_; | 180 uint32 prev_elapsed_time_; |
181 int prev_rtp_seq_num_; | 181 int prev_rtp_seq_num_; |
182 uint32 prev_rtp_timestamp_; | 182 uint32 prev_rtp_timestamp_; |
183 | 183 |
184 DISALLOW_COPY_AND_ASSIGN(RtpDumpLoopReader); | 184 RTC_DISALLOW_COPY_AND_ASSIGN(RtpDumpLoopReader); |
185 }; | 185 }; |
186 | 186 |
187 class RtpDumpWriter { | 187 class RtpDumpWriter { |
188 public: | 188 public: |
189 explicit RtpDumpWriter(rtc::StreamInterface* stream); | 189 explicit RtpDumpWriter(rtc::StreamInterface* stream); |
190 | 190 |
191 // Filter to control what packets we actually record. | 191 // Filter to control what packets we actually record. |
192 void set_packet_filter(int filter); | 192 void set_packet_filter(int filter); |
193 // Write a RTP or RTCP packet. The parameters data points to the packet and | 193 // Write a RTP or RTCP packet. The parameters data points to the packet and |
194 // data_len is its length. | 194 // data_len is its length. |
(...skipping 23 matching lines...) Expand all Loading... |
218 uint32 elapsed, bool rtcp); | 218 uint32 elapsed, bool rtcp); |
219 size_t FilterPacket(const void* data, size_t data_len, bool rtcp); | 219 size_t FilterPacket(const void* data, size_t data_len, bool rtcp); |
220 rtc::StreamResult WriteToStream(const void* data, size_t data_len); | 220 rtc::StreamResult WriteToStream(const void* data, size_t data_len); |
221 | 221 |
222 rtc::StreamInterface* stream_; | 222 rtc::StreamInterface* stream_; |
223 int packet_filter_; | 223 int packet_filter_; |
224 bool file_header_written_; | 224 bool file_header_written_; |
225 uint32 start_time_ms_; // Time when the record starts. | 225 uint32 start_time_ms_; // Time when the record starts. |
226 // If writing to the stream takes longer than this many ms, log a warning. | 226 // If writing to the stream takes longer than this many ms, log a warning. |
227 uint32 warn_slow_writes_delay_; | 227 uint32 warn_slow_writes_delay_; |
228 DISALLOW_COPY_AND_ASSIGN(RtpDumpWriter); | 228 RTC_DISALLOW_COPY_AND_ASSIGN(RtpDumpWriter); |
229 }; | 229 }; |
230 | 230 |
231 } // namespace cricket | 231 } // namespace cricket |
232 | 232 |
233 #endif // TALK_MEDIA_BASE_RTPDUMP_H_ | 233 #endif // TALK_MEDIA_BASE_RTPDUMP_H_ |
OLD | NEW |