blob: 6de6f8f0afa9a3443c6c3ffd5d2fb0140d3e38d2 [file] [log] [blame]
Steve Anton1d03a752017-11-27 14:30:09 -08001/*
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
16namespace webrtc {
17
18// Returns the RtpTransceiverDirection that satisfies specified send and receive
19// conditions.
20RtpTransceiverDirection RtpTransceiverDirectionFromSendRecv(bool send,
21 bool recv);
22
23// Returns true only if the direction will send media.
24bool RtpTransceiverDirectionHasSend(RtpTransceiverDirection direction);
25
26// Returns true only if the direction will receive media.
27bool RtpTransceiverDirectionHasRecv(RtpTransceiverDirection direction);
28
29// Returns the RtpTransceiverDirection which is the reverse of the given
30// direction.
31RtpTransceiverDirection RtpTransceiverDirectionReversed(
32 RtpTransceiverDirection direction);
33
Steve Anton22da89f2018-01-25 13:58:07 -080034// Returns the RtpTransceiverDirection with its send component set to |send|.
35RtpTransceiverDirection RtpTransceiverDirectionWithSendSet(
36 RtpTransceiverDirection direction,
37 bool send = true);
38
39// Returns the RtpTransceiverDirection with its recv component set to |recv|.
40RtpTransceiverDirection RtpTransceiverDirectionWithRecvSet(
41 RtpTransceiverDirection direction,
42 bool recv = true);
43
Steve Anton4e70a722017-11-28 14:57:10 -080044// Returns an unspecified string representation of the given direction.
45const char* RtpTransceiverDirectionToString(RtpTransceiverDirection direction);
46
Steve Anton1d03a752017-11-27 14:30:09 -080047} // namespace webrtc
48
49#endif // PC_RTPMEDIAUTILS_H_