Steve Anton | 1d03a75 | 2017-11-27 14:30:09 -0800 | [diff] [blame] | 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 PC_RTPMEDIAUTILS_H_ |
| 12 | #define PC_RTPMEDIAUTILS_H_ |
| 13 | |
| 14 | #include "api/rtptransceiverinterface.h" |
| 15 | |
| 16 | namespace webrtc { |
| 17 | |
| 18 | // Returns the RtpTransceiverDirection that satisfies specified send and receive |
| 19 | // conditions. |
| 20 | RtpTransceiverDirection RtpTransceiverDirectionFromSendRecv(bool send, |
| 21 | bool recv); |
| 22 | |
| 23 | // Returns true only if the direction will send media. |
| 24 | bool RtpTransceiverDirectionHasSend(RtpTransceiverDirection direction); |
| 25 | |
| 26 | // Returns true only if the direction will receive media. |
| 27 | bool RtpTransceiverDirectionHasRecv(RtpTransceiverDirection direction); |
| 28 | |
| 29 | // Returns the RtpTransceiverDirection which is the reverse of the given |
| 30 | // direction. |
| 31 | RtpTransceiverDirection RtpTransceiverDirectionReversed( |
| 32 | RtpTransceiverDirection direction); |
| 33 | |
Steve Anton | 22da89f | 2018-01-25 13:58:07 -0800 | [diff] [blame] | 34 | // Returns the RtpTransceiverDirection with its send component set to |send|. |
| 35 | RtpTransceiverDirection RtpTransceiverDirectionWithSendSet( |
| 36 | RtpTransceiverDirection direction, |
| 37 | bool send = true); |
| 38 | |
| 39 | // Returns the RtpTransceiverDirection with its recv component set to |recv|. |
| 40 | RtpTransceiverDirection RtpTransceiverDirectionWithRecvSet( |
| 41 | RtpTransceiverDirection direction, |
| 42 | bool recv = true); |
| 43 | |
Steve Anton | 4e70a72 | 2017-11-28 14:57:10 -0800 | [diff] [blame] | 44 | // Returns an unspecified string representation of the given direction. |
| 45 | const char* RtpTransceiverDirectionToString(RtpTransceiverDirection direction); |
| 46 | |
Steve Anton | 1d03a75 | 2017-11-27 14:30:09 -0800 | [diff] [blame] | 47 | } // namespace webrtc |
| 48 | |
| 49 | #endif // PC_RTPMEDIAUTILS_H_ |