2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
11 #ifndef WEBRTC_MODULES_UTILITY_SOURCE_RTP_DUMP_IMPL_H_
12 #define WEBRTC_MODULES_UTILITY_SOURCE_RTP_DUMP_IMPL_H_
14 #include "webrtc/modules/utility/interface/rtp_dump.h"
17 class CriticalSectionWrapper;
19 class RtpDumpImpl : public RtpDump
23 virtual ~RtpDumpImpl();
25 virtual int32_t Start(const char* fileNameUTF8) OVERRIDE;
26 virtual int32_t Stop() OVERRIDE;
27 virtual bool IsActive() const OVERRIDE;
28 virtual int32_t DumpPacket(const uint8_t* packet,
29 uint16_t packetLength) OVERRIDE;
31 // Return the system time in ms.
32 inline uint32_t GetTimeInMS() const;
33 // Return x in network byte order (big endian).
34 inline uint32_t RtpDumpHtonl(uint32_t x) const;
35 // Return x in network byte order (big endian).
36 inline uint16_t RtpDumpHtons(uint16_t x) const;
38 // Return true if the packet starts with a valid RTCP header.
39 // Note: See RtpUtility::RtpHeaderParser::RTCP() for details on how
40 // to determine if the packet is an RTCP packet.
41 bool RTCP(const uint8_t* packet) const;
44 CriticalSectionWrapper* _critSect;
49 #endif // WEBRTC_MODULES_UTILITY_SOURCE_RTP_DUMP_IMPL_H_