ossu | 7bb87ee | 2017-01-23 12:56:25 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 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 | |
Mirko Bonadei | 92ea95e | 2017-09-15 04:47:31 | [diff] [blame] | 11 | #ifndef API_MEDIATYPES_H_ |
| 12 | #define API_MEDIATYPES_H_ |
ossu | 7bb87ee | 2017-01-23 12:56:25 | [diff] [blame] | 13 | |
| 14 | #include <string> |
| 15 | |
Patrik Höglund | b6b29e0 | 2018-06-21 14:58:01 | [diff] [blame] | 16 | // The cricket and webrtc have separate definitions for what a media type is. |
| 17 | // They're not compatible. Watch out for this. |
| 18 | |
ossu | 7bb87ee | 2017-01-23 12:56:25 | [diff] [blame] | 19 | namespace cricket { |
| 20 | |
Yves Gerey | 665174f | 2018-06-19 13:03:05 | [diff] [blame] | 21 | enum MediaType { MEDIA_TYPE_AUDIO, MEDIA_TYPE_VIDEO, MEDIA_TYPE_DATA }; |
ossu | 7bb87ee | 2017-01-23 12:56:25 | [diff] [blame] | 22 | |
| 23 | std::string MediaTypeToString(MediaType type); |
deadbeef | e814a0d | 2017-02-26 02:15:09 | [diff] [blame] | 24 | // Aborts on invalid string. Only expected to be used on strings that are |
| 25 | // guaranteed to be valid, such as MediaStreamTrackInterface::kind(). |
| 26 | MediaType MediaTypeFromString(const std::string& type_str); |
ossu | 7bb87ee | 2017-01-23 12:56:25 | [diff] [blame] | 27 | |
| 28 | } // namespace cricket |
| 29 | |
Patrik Höglund | b6b29e0 | 2018-06-21 14:58:01 | [diff] [blame] | 30 | namespace webrtc { |
| 31 | |
| 32 | enum class MediaType { ANY, AUDIO, VIDEO, DATA }; |
| 33 | |
| 34 | } // namespace webrtc |
| 35 | |
Mirko Bonadei | 92ea95e | 2017-09-15 04:47:31 | [diff] [blame] | 36 | #endif // API_MEDIATYPES_H_ |