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 | #include "api/media_types.h" |
deadbeef | e814a0d | 2017-02-25 18:15:09 -0800 | [diff] [blame] | 12 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 13 | #include "rtc_base/checks.h" |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 14 | |
| 15 | namespace cricket { |
| 16 | |
Niels Möller | 6dcd4dc | 2019-08-26 10:45:28 +0200 | [diff] [blame] | 17 | const char kMediaTypeVideo[] = "video"; |
| 18 | const char kMediaTypeAudio[] = "audio"; |
| 19 | const char kMediaTypeData[] = "data"; |
| 20 | |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 21 | std::string MediaTypeToString(MediaType type) { |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 22 | switch (type) { |
| 23 | case MEDIA_TYPE_AUDIO: |
Niels Möller | 6dcd4dc | 2019-08-26 10:45:28 +0200 | [diff] [blame] | 24 | return kMediaTypeAudio; |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 25 | case MEDIA_TYPE_VIDEO: |
Niels Möller | 6dcd4dc | 2019-08-26 10:45:28 +0200 | [diff] [blame] | 26 | return kMediaTypeVideo; |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 27 | case MEDIA_TYPE_DATA: |
deadbeef | e814a0d | 2017-02-25 18:15:09 -0800 | [diff] [blame] | 28 | return kMediaTypeData; |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 29 | } |
deadbeef | e814a0d | 2017-02-25 18:15:09 -0800 | [diff] [blame] | 30 | FATAL(); |
deadbeef | 3c8771e | 2017-02-28 18:30:35 -0800 | [diff] [blame] | 31 | // Not reachable; avoids compile warning. |
| 32 | return ""; |
deadbeef | e814a0d | 2017-02-25 18:15:09 -0800 | [diff] [blame] | 33 | } |
| 34 | |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 35 | } // namespace cricket |