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