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

Side by Side Diff: webrtc/logging/rtc_event_log/rtc_event_log_parser.h

Issue 2918103002: Make rtc_event_log2text output header extensions (Closed)
Patch Set: Add comment about colliding video and audio ssrcs and extension maps Created 3 years, 6 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) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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 #ifndef WEBRTC_LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_PARSER_H_ 10 #ifndef WEBRTC_LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_PARSER_H_
11 #define WEBRTC_LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_PARSER_H_ 11 #define WEBRTC_LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_PARSER_H_
12 12
13 #include <map>
13 #include <string> 14 #include <string>
15 #include <utility> // pair
14 #include <vector> 16 #include <vector>
15 17
16 #include "webrtc/base/ignore_wundef.h" 18 #include "webrtc/base/ignore_wundef.h"
17 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" 19 #include "webrtc/logging/rtc_event_log/rtc_event_log.h"
20 #include "webrtc/modules/rtp_rtcp/source/byte_io.h"
21 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extension.h"
18 #include "webrtc/video_receive_stream.h" 22 #include "webrtc/video_receive_stream.h"
19 #include "webrtc/video_send_stream.h" 23 #include "webrtc/video_send_stream.h"
20 24
21 // Files generated at build-time by the protobuf compiler. 25 // Files generated at build-time by the protobuf compiler.
22 RTC_PUSH_IGNORING_WUNDEF() 26 RTC_PUSH_IGNORING_WUNDEF()
23 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD 27 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD
24 #include "external/webrtc/webrtc/logging/rtc_event_log/rtc_event_log.pb.h" 28 #include "external/webrtc/webrtc/logging/rtc_event_log/rtc_event_log.pb.h"
25 #else 29 #else
26 #include "webrtc/logging/rtc_event_log/rtc_event_log.pb.h" 30 #include "webrtc/logging/rtc_event_log/rtc_event_log.pb.h"
27 #endif 31 #endif
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 int64_t GetTimestamp(size_t index) const; 96 int64_t GetTimestamp(size_t index) const;
93 97
94 // Reads the event type of the rtclog::Event at |index|. 98 // Reads the event type of the rtclog::Event at |index|.
95 EventType GetEventType(size_t index) const; 99 EventType GetEventType(size_t index) const;
96 100
97 // Reads the header, direction, header length and packet length from the RTP 101 // Reads the header, direction, header length and packet length from the RTP
98 // event at |index|, and stores the values in the corresponding output 102 // event at |index|, and stores the values in the corresponding output
99 // parameters. Each output parameter can be set to nullptr if that value 103 // parameters. Each output parameter can be set to nullptr if that value
100 // isn't needed. 104 // isn't needed.
101 // NB: The header must have space for at least IP_PACKET_SIZE bytes. 105 // NB: The header must have space for at least IP_PACKET_SIZE bytes.
102 void GetRtpHeader(size_t index, 106 // Returns: a pointer to a header extensions map acquired from parsing
103 PacketDirection* incoming, 107 // corresponding Audio/Video Sender/Receiver config events.
104 uint8_t* header, 108 // Warning: if the same SSRC is reused by both video and audio streams during
105 size_t* header_length, 109 // call, extensions maps may be incorrect (the last one would be returned).
106 size_t* total_length) const; 110 webrtc::RtpHeaderExtensionMap* GetRtpHeader(size_t index,
111 PacketDirection* incoming,
112 uint8_t* header,
113 size_t* header_length,
114 size_t* total_length) const;
107 115
108 // Reads packet, direction and packet length from the RTCP event at |index|, 116 // Reads packet, direction and packet length from the RTCP event at |index|,
109 // and stores the values in the corresponding output parameters. 117 // and stores the values in the corresponding output parameters.
110 // Each output parameter can be set to nullptr if that value isn't needed. 118 // Each output parameter can be set to nullptr if that value isn't needed.
111 // NB: The packet must have space for at least IP_PACKET_SIZE bytes. 119 // NB: The packet must have space for at least IP_PACKET_SIZE bytes.
112 void GetRtcpPacket(size_t index, 120 void GetRtcpPacket(size_t index,
113 PacketDirection* incoming, 121 PacketDirection* incoming,
114 uint8_t* packet, 122 uint8_t* packet,
115 size_t* length) const; 123 size_t* length) const;
116 124
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 std::vector<rtclog::StreamConfig> GetVideoSendConfig( 179 std::vector<rtclog::StreamConfig> GetVideoSendConfig(
172 const rtclog::Event& event) const; 180 const rtclog::Event& event) const;
173 rtclog::StreamConfig GetAudioReceiveConfig(const rtclog::Event& event) const; 181 rtclog::StreamConfig GetAudioReceiveConfig(const rtclog::Event& event) const;
174 rtclog::StreamConfig GetAudioSendConfig(const rtclog::Event& event) const; 182 rtclog::StreamConfig GetAudioSendConfig(const rtclog::Event& event) const;
175 183
176 std::vector<rtclog::Event> events_; 184 std::vector<rtclog::Event> events_;
177 185
178 struct Stream { 186 struct Stream {
179 Stream(uint32_t ssrc, 187 Stream(uint32_t ssrc,
180 MediaType media_type, 188 MediaType media_type,
181 webrtc::PacketDirection direction) 189 webrtc::PacketDirection direction,
182 : ssrc(ssrc), media_type(media_type), direction(direction) {} 190 webrtc::RtpHeaderExtensionMap map)
191 : ssrc(ssrc),
192 media_type(media_type),
193 direction(direction),
194 rtp_extensions_map(map) {}
183 uint32_t ssrc; 195 uint32_t ssrc;
184 MediaType media_type; 196 MediaType media_type;
185 webrtc::PacketDirection direction; 197 webrtc::PacketDirection direction;
198 webrtc::RtpHeaderExtensionMap rtp_extensions_map;
186 }; 199 };
187 200
188 // All configured streams found in the event log. 201 // All configured streams found in the event log.
189 std::vector<Stream> streams_; 202 std::vector<Stream> streams_;
203
204 // To find configured extensions map for given stream, what are needed to
205 // parse a header.
206 typedef std::pair<uint32_t, webrtc::PacketDirection> StreamId;
207 std::map<StreamId, webrtc::RtpHeaderExtensionMap*> rtp_extensions_maps_;
190 }; 208 };
191 209
192 } // namespace webrtc 210 } // namespace webrtc
193 211
194 #endif // WEBRTC_LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_PARSER_H_ 212 #endif // WEBRTC_LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_PARSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698