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

Side by Side Diff: webrtc/call/call.h

Issue 2924393002: Move MinPositive to call.h (Closed)
Patch Set: Rebase 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
« no previous file with comments | « no previous file | webrtc/call/call.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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_CALL_CALL_H_ 10 #ifndef WEBRTC_CALL_CALL_H_
11 #define WEBRTC_CALL_CALL_H_ 11 #define WEBRTC_CALL_CALL_H_
12 12
13 #include <algorithm>
13 #include <memory> 14 #include <memory>
14 #include <string> 15 #include <string>
15 #include <vector> 16 #include <vector>
16 17
17 #include "webrtc/api/rtcerror.h" 18 #include "webrtc/api/rtcerror.h"
18 #include "webrtc/base/networkroute.h" 19 #include "webrtc/base/networkroute.h"
19 #include "webrtc/base/platform_file.h" 20 #include "webrtc/base/platform_file.h"
20 #include "webrtc/base/socket.h" 21 #include "webrtc/base/socket.h"
21 #include "webrtc/call/audio_receive_stream.h" 22 #include "webrtc/call/audio_receive_stream.h"
22 #include "webrtc/call/audio_send_stream.h" 23 #include "webrtc/call/audio_send_stream.h"
23 #include "webrtc/call/audio_state.h" 24 #include "webrtc/call/audio_state.h"
24 #include "webrtc/call/flexfec_receive_stream.h" 25 #include "webrtc/call/flexfec_receive_stream.h"
25 #include "webrtc/call/rtp_transport_controller_send_interface.h" 26 #include "webrtc/call/rtp_transport_controller_send_interface.h"
26 #include "webrtc/common_types.h" 27 #include "webrtc/common_types.h"
27 #include "webrtc/video_receive_stream.h" 28 #include "webrtc/video_receive_stream.h"
28 #include "webrtc/video_send_stream.h" 29 #include "webrtc/video_send_stream.h"
29 30
30 namespace webrtc { 31 namespace webrtc {
31 32
32 class AudioProcessing; 33 class AudioProcessing;
33 class RtcEventLog; 34 class RtcEventLog;
34 35
35 enum class MediaType { 36 enum class MediaType {
36 ANY, 37 ANY,
37 AUDIO, 38 AUDIO,
38 VIDEO, 39 VIDEO,
39 DATA 40 DATA
40 }; 41 };
41 42
43 // Like std::min, but considers non-positive values to be unset.
44 // TODO(zstein): Remove once all callers use rtc::Optional.
45 template <typename T>
46 static T MinPositive(T a, T b) {
47 if (a <= 0) {
48 return b;
49 }
50 if (b <= 0) {
51 return a;
52 }
53 return std::min(a, b);
54 }
55
42 class PacketReceiver { 56 class PacketReceiver {
43 public: 57 public:
44 enum DeliveryStatus { 58 enum DeliveryStatus {
45 DELIVERY_OK, 59 DELIVERY_OK,
46 DELIVERY_UNKNOWN_SSRC, 60 DELIVERY_UNKNOWN_SSRC,
47 DELIVERY_PACKET_ERROR, 61 DELIVERY_PACKET_ERROR,
48 }; 62 };
49 63
50 virtual DeliveryStatus DeliverPacket(MediaType media_type, 64 virtual DeliveryStatus DeliverPacket(MediaType media_type,
51 const uint8_t* packet, 65 const uint8_t* packet,
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 const rtc::NetworkRoute& network_route) = 0; 198 const rtc::NetworkRoute& network_route) = 0;
185 199
186 virtual void OnSentPacket(const rtc::SentPacket& sent_packet) = 0; 200 virtual void OnSentPacket(const rtc::SentPacket& sent_packet) = 0;
187 201
188 virtual ~Call() {} 202 virtual ~Call() {}
189 }; 203 };
190 204
191 } // namespace webrtc 205 } // namespace webrtc
192 206
193 #endif // WEBRTC_CALL_CALL_H_ 207 #endif // WEBRTC_CALL_CALL_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/call/call.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698