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

Side by Side Diff: webrtc/pc/rtptransporttestutil.h

Issue 2981013002: Introduce RtpTransportInternal and SrtpTransport. (Closed)
Patch Set: Created 3 years, 5 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
(Empty)
1 /*
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved.
3 *
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.
9 */
10
11 #ifndef WEBRTC_PC_RTPTRANSPORTTESTUTIL_H_
12 #define WEBRTC_PC_RTPTRANSPORTTESTUTIL_H_
13
14 #include "webrtc/pc/rtptransportinternal.h"
15 #include "webrtc/rtc_base/sigslot.h"
16
17 namespace webrtc {
18
19 class SignalPacketReceivedCounter : public sigslot::has_slots<> {
20 public:
21 explicit SignalPacketReceivedCounter(RtpTransportInternal* transport) {
22 transport->SignalPacketReceived.connect(
23 this, &SignalPacketReceivedCounter::OnPacketReceived);
24 }
25 int rtcp_count() const { return rtcp_count_; }
26 int rtp_count() const { return rtp_count_; }
27
28 private:
29 void OnPacketReceived(bool rtcp,
30 rtc::CopyOnWriteBuffer*,
31 const rtc::PacketTime&) {
32 if (rtcp) {
33 ++rtcp_count_;
34 } else {
35 ++rtp_count_;
36 }
37 }
38 int rtcp_count_ = 0;
39 int rtp_count_ = 0;
40 };
41
42 } // namespace webrtc
43
44 #endif // WEBRTC_PC_RTPTRANSPORTTESTUTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698