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

Unified Diff: webrtc/video/rtc_event_log_parser.h

Issue 1295753003: Convenience functions to convert RtcEvents to webrtc types. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase and change CHECK to RTC_CHECK Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/video/rtc_event_log2rtp_dump.cc ('k') | webrtc/video/rtc_event_log_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/rtc_event_log_parser.h
diff --git a/webrtc/video/rtc_event_log_parser.h b/webrtc/video/rtc_event_log_parser.h
new file mode 100644
index 0000000000000000000000000000000000000000..8f34cc976ce178ca788abfbfd8ccdf77a8f7b3fc
--- /dev/null
+++ b/webrtc/video/rtc_event_log_parser.h
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+#ifndef WEBRTC_VIDEO_RTC_EVENT_LOG_PARSER_H_
+#define WEBRTC_VIDEO_RTC_EVENT_LOG_PARSER_H_
+
+#include <string>
+
+#include "webrtc/video_receive_stream.h"
+#include "webrtc/video_send_stream.h"
+
+// Files generated at build-time by the protobuf compiler.
+#ifdef WEBRTC_ANDROID_PLATFORM_BUILD
+#include "external/webrtc/webrtc/video/rtc_event_log.pb.h"
+#else
+#include "webrtc/video/rtc_event_log.pb.h"
+#endif
+
+namespace webrtc {
+
+enum class MediaType;
+
+class RtcEventLogParser {
+ public:
+ // Converts a MediaType as stored by the protobuf to a
+ // webrtc::MediaType as used by all other runtime functions.
+ static MediaType GetRuntimeMediaType(rtclog::MediaType media_type);
+
+ // Converts an RtcpMode as stored by the protobuf to a
+ // newapi::RtcpMode as used in the VideoReceiveStream::Config.
+ static newapi::RtcpMode GetRuntimeRtcpMode(
+ rtclog::VideoReceiveConfig::RtcpMode rtcp_mode);
+
+ // Reads an RtcEventLog file and returns true when reading was successful.
+ // The result is stored in the given EventStream object.
+ static bool ParseRtcEventLog(const std::string& file_name,
+ rtclog::EventStream* result);
+
+ // Returns the number of events in an EventStream.
+ static int GetNumberOfEvents(const rtclog::EventStream& stream);
+
+ // Returns a pointer to a specific event in the EventStream.
+ static const rtclog::Event* GetEvent(const rtclog::EventStream& stream,
+ int index);
+
+ // Reads the arrival timestamp (in microseconds) from a rtclog::Event.
+ static int64_t GetTimestamp(const rtclog::Event& event);
+
+ // Reads the event type of a rtclog::Event.
+ static rtclog::Event_EventType GetEventType(const rtclog::Event& event);
+
+ // Reads the header, direction, media type, header length and packet length
+ // from an RTP event and stores it in the corresponding output parameter.
+ // If some value is irrelevant, then that output parameter can be set to NULL.
+ // NB: The header must have space for at least IP_PACKET_SIZE bytes.
+ static void GetRtpHeader(const rtclog::Event& event,
+ bool* incoming,
+ MediaType* media_type,
+ uint8_t* header,
+ size_t* header_length,
+ size_t* total_length);
+
+ // Reads packet, direction, media type and packet length from an RTCP event
+ // and stores the results in the corresponding output parameters.
+ // If some value is irrelevant, then that output parameter can be set to NULL.
+ // NB: The packet must have space for at least IP_PACKET_SIZE bytes.
+ static void GetRtcpPacket(const rtclog::Event& event,
+ bool* incoming,
+ MediaType* media_type,
+ uint8_t* packet,
+ size_t* length);
+
+ // Reads a config event to a (non NULL) VideoReceiveStream::Config struct.
+ // Only the fields that are stored in the protobuf will be written.
+ static void GetVideoReceiveConfig(const rtclog::Event& event,
+ VideoReceiveStream::Config* config);
+
+ // Reads a config event to a (non NULL) VideoSendStream::Config struct.
+ // Only the fields that are stored in the protobuf will be written.
+ static void GetVideoSendConfig(const rtclog::Event& event,
+ VideoSendStream::Config* config);
+};
+
+} // namespace webrtc
+
+#endif // WEBRTC_VIDEO_RTC_EVENT_LOG_PARSER_H_
« no previous file with comments | « webrtc/video/rtc_event_log2rtp_dump.cc ('k') | webrtc/video/rtc_event_log_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698